|
@@ -1,163 +1,14 @@
|
|
<template>
|
|
<template>
|
|
- <div class="app-container">
|
|
|
|
- <!-- 筛选条件 -->
|
|
|
|
- <div>
|
|
|
|
- <Collapse :screen-form="screenForm">
|
|
|
|
- <template #right_btn>
|
|
|
|
- <el-button size="mini" @click="resetScreenForm">清空</el-button>
|
|
|
|
- <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
|
|
|
|
- </template>
|
|
|
|
- <template #search>
|
|
|
|
- <el-form ref="screenForm" :model="screenForm" label-width="120px" size="mini" label-position="left">
|
|
|
|
- <el-row :gutter="20">
|
|
|
|
- <el-col :xs="24" :sm="12" :lg="6">
|
|
|
|
- <el-form-item label="物流公司名称" prop="customerTel">
|
|
|
|
- <el-input placeholder="请输入物流公司名称" v-model="screenForm.logisticsCompany"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :xs="24" :sm="12" :lg="6">
|
|
|
|
- <el-form-item label="客服电话" prop="logisticsCompany">
|
|
|
|
- <el-input placeholder="请输入客服电话" v-model="screenForm.customerTel"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
- </el-form>
|
|
|
|
- </template>
|
|
|
|
- </Collapse>
|
|
|
|
- </div>
|
|
|
|
- <!-- 按钮 -->
|
|
|
|
- <div class="btn-group clearfix">
|
|
|
|
- <div class="fl">
|
|
|
|
- <el-button
|
|
|
|
- type="primary"
|
|
|
|
- icon="el-icon-plus"
|
|
|
|
- size="mini"
|
|
|
|
- @click="hanleAdd"
|
|
|
|
- v-if="$checkBtnRole('add', $route.meta.roles)"
|
|
|
|
- >新增</el-button
|
|
|
|
- >
|
|
|
|
- <el-popconfirm
|
|
|
|
- v-if="$checkBtnRole('del', $route.meta.roles)"
|
|
|
|
- confirm-button-text="好的"
|
|
|
|
- cancel-button-text="不用了"
|
|
|
|
- icon="el-icon-info"
|
|
|
|
- icon-color="red"
|
|
|
|
- title="内容确定删除吗?"
|
|
|
|
- @onConfirm="hanleDelete"
|
|
|
|
- >
|
|
|
|
- <el-button type="primary" size="mini" slot="reference" class="el-popover-left">删除</el-button>
|
|
|
|
- </el-popconfirm>
|
|
|
|
- </div>
|
|
|
|
- <div class="fr">
|
|
|
|
- <!-- <ExportButton :exUrl="'/logistics/export'" :exParams="exParams" /> -->
|
|
|
|
-
|
|
|
|
- <el-button type="primary" size="mini" @click="handleExport">导出</el-button>
|
|
|
|
- <!-- <el-button type="primary" size="mini" @click="hanlePrint"
|
|
|
|
- >打印</el-button
|
|
|
|
- > -->
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <!-- 列表 -->
|
|
|
|
- <div class="mymain-container">
|
|
|
|
- <div class="table">
|
|
|
|
- <el-table
|
|
|
|
- v-loading="listLoading"
|
|
|
|
- :data="dataList"
|
|
|
|
- element-loading-text="Loading"
|
|
|
|
- @select="hanleSelectAll"
|
|
|
|
- @select-all="hanleSelectAll"
|
|
|
|
- border
|
|
|
|
- fit
|
|
|
|
- highlight-current-row
|
|
|
|
- stripe
|
|
|
|
- >
|
|
|
|
- <el-table-column type="selection" align="center"></el-table-column>
|
|
|
|
- <el-table-column
|
|
|
|
- align="center"
|
|
|
|
- label="物流公司名称"
|
|
|
|
- prop="logisticsCompany"
|
|
|
|
- min-width="160"
|
|
|
|
- show-overflow-tooltip
|
|
|
|
- >
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column
|
|
|
|
- align="center"
|
|
|
|
- label="物流公司代码"
|
|
|
|
- prop="logisticsNumber"
|
|
|
|
- min-width="160"
|
|
|
|
- show-overflow-tooltip
|
|
|
|
- >
|
|
|
|
- </el-table-column>
|
|
|
|
- <!-- <el-table-column
|
|
|
|
- align="center"
|
|
|
|
- label="提货人"
|
|
|
|
- prop="pickName"
|
|
|
|
- min-width="160"
|
|
|
|
- show-overflow-tooltip
|
|
|
|
- >
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column
|
|
|
|
- align="center"
|
|
|
|
- label="提货人电话"
|
|
|
|
- prop="pickTel"
|
|
|
|
- min-width="160"
|
|
|
|
- show-overflow-tooltip
|
|
|
|
- >
|
|
|
|
- </el-table-column> -->
|
|
|
|
- <el-table-column align="center" label="客服电话" prop="customerTel" min-width="160" show-overflow-tooltip>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column align="center" label="创建人" prop="createBy" min-width="160" show-overflow-tooltip>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column align="center" label="创建时间" prop="createTime" min-width="160" show-overflow-tooltip>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column align="center" label="更新人" prop="updateBy" min-width="160" show-overflow-tooltip>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column align="center" label="更新时间" prop="updateTime" min-width="160" show-overflow-tooltip>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column align="center" label="操作" min-width="160" show-overflow-tooltip>
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <!-- <el-button
|
|
|
|
- type="text"
|
|
|
|
- class="textColor"
|
|
|
|
- @click="hanleDetail(scope.row)"
|
|
|
|
- >详情</el-button
|
|
|
|
- > -->
|
|
|
|
- <el-button
|
|
|
|
- type="text"
|
|
|
|
- v-if="$checkBtnRole('edit', $route.meta.roles)"
|
|
|
|
- class="textColor"
|
|
|
|
- @click="editFn(scope.row.id, scope.row)"
|
|
|
|
- >编辑</el-button
|
|
|
|
- >
|
|
|
|
- <el-popconfirm
|
|
|
|
- v-if="$checkBtnRole('del', $route.meta.roles)"
|
|
|
|
- confirm-button-text="好的"
|
|
|
|
- cancel-button-text="不用了"
|
|
|
|
- icon="el-icon-info"
|
|
|
|
- icon-color="red"
|
|
|
|
- title="内容确定删除吗?"
|
|
|
|
- @onConfirm="hanleDelete(scope.row.id)"
|
|
|
|
- >
|
|
|
|
- <el-button slot="reference" type="text" class="textColor el-popover-left">删除</el-button>
|
|
|
|
- </el-popconfirm>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
- </div>
|
|
|
|
- <!-- 分页 -->
|
|
|
|
- <div class="fr">
|
|
|
|
- <el-pagination
|
|
|
|
- @size-change="handleSizeChange"
|
|
|
|
- @current-change="handleCurrentChange"
|
|
|
|
- :current-page="currentPage"
|
|
|
|
- :page-sizes="[10, 20, 30, 50]"
|
|
|
|
- :page-size="10"
|
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
- :total="listTotal"
|
|
|
|
- >
|
|
|
|
- </el-pagination>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <template-page
|
|
|
|
+ ref="pageRef"
|
|
|
|
+ :getList="getList"
|
|
|
|
+ :exportList="exportList"
|
|
|
|
+ :operation="operation()"
|
|
|
|
+ :tableAttributes="tableAttributes"
|
|
|
|
+ :tableEvents="tableEvents"
|
|
|
|
+ :optionsEvensGroup="optionsEvensGroup"
|
|
|
|
+ :columnParsing="columnParsing"
|
|
|
|
+ >
|
|
<!-- 弹窗 -->
|
|
<!-- 弹窗 -->
|
|
<el-dialog
|
|
<el-dialog
|
|
title="物流公司"
|
|
title="物流公司"
|
|
@@ -166,7 +17,7 @@
|
|
:show-close="false"
|
|
:show-close="false"
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
>
|
|
>
|
|
- <el-form ref="form" :rules="type == 2 ? rules : ''" :model="diaLogForm" label-width="120px">
|
|
|
|
|
|
+ <el-form ref="form" :rules="rules" :model="diaLogForm" label-width="120px">
|
|
<el-form-item label="物流公司名称" prop="logisticsCompany">
|
|
<el-form-item label="物流公司名称" prop="logisticsCompany">
|
|
<el-input v-model="diaLogForm.logisticsCompany"></el-input>
|
|
<el-input v-model="diaLogForm.logisticsCompany"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -184,22 +35,79 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
- <el-button @click="hanleCancel('form')">取 消</el-button>
|
|
|
|
|
|
+ <el-button @click="handleClose('form')">取 消</el-button>
|
|
<el-button type="primary" @click="handelInfo('form')">确 定</el-button>
|
|
<el-button type="primary" @click="handelInfo('form')">确 定</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
- </div>
|
|
|
|
|
|
+ </template-page>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import Mixin from '@/mixin/index'
|
|
|
|
-import { addInof, deleteInfo, getLogisticsList, updateInfo } from '@/api/basic_data/logistics'
|
|
|
|
|
|
+import TemplatePage from '@/components/template/template-page-1.vue'
|
|
|
|
+import import_mixin from '@/components/template/import_mixin.js'
|
|
|
|
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
|
|
|
|
+import Popu from '@/components/template/popu.vue'
|
|
|
|
+import {
|
|
|
|
+ addInof,
|
|
|
|
+ deleteInfo,
|
|
|
|
+ getLogisticsList,
|
|
|
|
+ updateInfo,
|
|
|
|
+ getLogisticsV2,
|
|
|
|
+ exportLogisticsV2
|
|
|
|
+} from '@/api/basic_data/logistics'
|
|
import { downloadFiles } from '@/utils/util'
|
|
import { downloadFiles } from '@/utils/util'
|
|
-
|
|
|
|
export default {
|
|
export default {
|
|
- mixins: [Mixin],
|
|
|
|
|
|
+ components: { TemplatePage, Popu },
|
|
|
|
+ mixins: [import_mixin, add_callback_mixin],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ visible: false,
|
|
|
|
+ // 事件组合
|
|
|
|
+ optionsEvensGroup: [
|
|
|
|
+ [
|
|
|
|
+ [
|
|
|
|
+ {
|
|
|
|
+ name: '新增',
|
|
|
|
+ click: this.addOn(() => {
|
|
|
|
+ this.hanleAdd()
|
|
|
|
+ }),
|
|
|
|
+ isRole: this.$checkBtnRole('add', this.$route.meta.roles)
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ ],
|
|
|
|
+ [
|
|
|
|
+ [
|
|
|
|
+ {
|
|
|
|
+ name: '批量删除',
|
|
|
|
+ click: async () => {
|
|
|
|
+ if (this.recordSelected.length === 0) {
|
|
|
|
+ this.$message.error('请选择需要删除的数据')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ let ids = this.recordSelected.map(v => {
|
|
|
|
+ return v.id
|
|
|
|
+ })
|
|
|
|
+ let params = ids
|
|
|
|
+ await deleteInfo(params)
|
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
|
+ this.$message.success('批量删除成功')
|
|
|
|
+ },
|
|
|
|
+ isRole: this.$checkBtnRole('del', this.$route.meta.roles)
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ ]
|
|
|
|
+ ],
|
|
|
|
+ // 表格属性
|
|
|
|
+ tableAttributes: {
|
|
|
|
+ // 启用勾选列
|
|
|
|
+ selectColumn: true
|
|
|
|
+ }, // 关闭新增弹窗
|
|
|
|
+
|
|
|
|
+ // 表格事件
|
|
|
|
+ tableEvents: {
|
|
|
|
+ 'selection-change': this.selectionChange
|
|
|
|
+ },
|
|
|
|
+ recordSelected: [],
|
|
type: 1, // 1 ,2, 3
|
|
type: 1, // 1 ,2, 3
|
|
diaLogForm: {
|
|
diaLogForm: {
|
|
id: null,
|
|
id: null,
|
|
@@ -221,20 +129,60 @@ export default {
|
|
rules: {
|
|
rules: {
|
|
logisticsCompany: [{ required: true, message: '请输入物流公司名称', trigger: 'blur' }],
|
|
logisticsCompany: [{ required: true, message: '请输入物流公司名称', trigger: 'blur' }],
|
|
logisticsNumber: [{ required: true, message: '请输入物流公司代码', trigger: 'blur' }]
|
|
logisticsNumber: [{ required: true, message: '请输入物流公司代码', trigger: 'blur' }]
|
|
- // pickName: [
|
|
|
|
- // { required: true, message: "请输入提货人", trigger: "blur" },
|
|
|
|
- // ],
|
|
|
|
- // pickTel: [
|
|
|
|
- // { required: true, message: "请输入提货人电话", trigger: "blur" },
|
|
|
|
- // ],
|
|
|
|
- // customerTel: [
|
|
|
|
- // { required: true, message: "请输入客服电话", trigger: "blur" },
|
|
|
|
- // ],
|
|
|
|
- },
|
|
|
|
- isCollapse: true
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 列表请求函数
|
|
|
|
+ getList(...p) {
|
|
|
|
+ this.recordSelected = []
|
|
|
|
+ return getLogisticsV2(...p)
|
|
|
|
+ },
|
|
|
|
+ // 列表导出函数
|
|
|
|
+ exportList: exportLogisticsV2,
|
|
|
|
+ // 表格列解析渲染数据更改
|
|
|
|
+ columnParsing(item, defaultData) {
|
|
|
|
+ return defaultData
|
|
|
|
+ },
|
|
|
|
+ // 监听勾选变化
|
|
|
|
+ selectionChange(data) {
|
|
|
|
+ this.recordSelected = data
|
|
|
|
+ },
|
|
|
|
+ operation() {
|
|
|
|
+ return (h, { row, index, column }) => {
|
|
|
|
+ return (
|
|
|
|
+ <div class="operation-btns">
|
|
|
|
+ {this.$checkBtnRole('edit', this.$route.meta.roles) ? (
|
|
|
|
+ <el-button type="text" class="textColor" onClick={() => this.editFn(row.id, row)}>
|
|
|
|
+ 编辑
|
|
|
|
+ </el-button>
|
|
|
|
+ ) : null}
|
|
|
|
+ {this.$checkBtnRole('del', this.$route.meta.roles) ? (
|
|
|
|
+ <el-popconfirm
|
|
|
|
+ confirm-button-text="好的"
|
|
|
|
+ cancel-button-text="不用了"
|
|
|
|
+ icon="el-icon-info"
|
|
|
|
+ icon-color="red"
|
|
|
|
+ title="内容确定删除吗?"
|
|
|
|
+ onOnConfirm={() => this.hanleDelete(row.id)}
|
|
|
|
+ >
|
|
|
|
+ <el-button slot="reference" type="text" class="textColor el-popover-left">
|
|
|
|
+ 删除
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-popconfirm>
|
|
|
|
+ ) : null}
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleClose() {
|
|
|
|
+ this.$refs['form'].resetFields()
|
|
|
|
+
|
|
|
|
+ this.addOff(() => {
|
|
|
|
+ this.type = 2
|
|
|
|
+ this.showDialogForm = false
|
|
|
|
+ })()
|
|
|
|
+ },
|
|
//显示新增弹框
|
|
//显示新增弹框
|
|
hanleAdd() {
|
|
hanleAdd() {
|
|
this.type = 2
|
|
this.type = 2
|
|
@@ -253,24 +201,10 @@ export default {
|
|
}
|
|
}
|
|
this.showDialogForm = true
|
|
this.showDialogForm = true
|
|
},
|
|
},
|
|
- // 初始化数据
|
|
|
|
- getList() {
|
|
|
|
- this.listLoading = true
|
|
|
|
- let params = {
|
|
|
|
- pageNum: this.currentPage,
|
|
|
|
- pageSize: this.pageSize,
|
|
|
|
- customerTel: this.screenForm.customerTel,
|
|
|
|
- logisticsCompany: this.screenForm.logisticsCompany
|
|
|
|
- }
|
|
|
|
- getLogisticsList(params).then(res => {
|
|
|
|
- this.dataList = res.data.records
|
|
|
|
- this.listTotal = res.data.total
|
|
|
|
- this.listLoading = false
|
|
|
|
- console.log(this.dataList, 1233)
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
|
|
+
|
|
//新增数据或者编辑数据请求接口 type 1 为编辑 type 2 新增
|
|
//新增数据或者编辑数据请求接口 type 1 为编辑 type 2 新增
|
|
handelInfo(formName) {
|
|
handelInfo(formName) {
|
|
|
|
+ console.log(this.type, '999')
|
|
if (this.type === 1) {
|
|
if (this.type === 1) {
|
|
const params = {
|
|
const params = {
|
|
...this.diaLogForm
|
|
...this.diaLogForm
|
|
@@ -278,8 +212,8 @@ export default {
|
|
updateInfo(params).then(res => {
|
|
updateInfo(params).then(res => {
|
|
this.$successMsg('编辑成功')
|
|
this.$successMsg('编辑成功')
|
|
this.showDialogForm = false
|
|
this.showDialogForm = false
|
|
- this.getList()
|
|
|
|
- this.hanleCancel()
|
|
|
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
|
+ this.handleClose()
|
|
})
|
|
})
|
|
this.diaLogForm.id = null
|
|
this.diaLogForm.id = null
|
|
} else if (this.type === 2) {
|
|
} else if (this.type === 2) {
|
|
@@ -288,8 +222,8 @@ export default {
|
|
addInof(this.diaLogForm).then(res => {
|
|
addInof(this.diaLogForm).then(res => {
|
|
this.$successMsg('保存成功')
|
|
this.$successMsg('保存成功')
|
|
this.showDialogForm = false
|
|
this.showDialogForm = false
|
|
- this.hanleCancel()
|
|
|
|
- this.getList()
|
|
|
|
|
|
+ this.handleClose()
|
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
console.log('error submit!!')
|
|
console.log('error submit!!')
|
|
@@ -305,7 +239,7 @@ export default {
|
|
this.type = 3
|
|
this.type = 3
|
|
this.showDialogForm = true
|
|
this.showDialogForm = true
|
|
this.diaLogForm = detail
|
|
this.diaLogForm = detail
|
|
- this.hanleCancel()
|
|
|
|
|
|
+ this.handleClose()
|
|
},
|
|
},
|
|
// 导出文档
|
|
// 导出文档
|
|
handleExport() {
|
|
handleExport() {
|
|
@@ -318,29 +252,15 @@ export default {
|
|
|
|
|
|
// 删除数据
|
|
// 删除数据
|
|
hanleDelete(id) {
|
|
hanleDelete(id) {
|
|
- this.hanleDeleteAllPromise(id).then(ids => {
|
|
|
|
- deleteInfo(ids).then(() => {
|
|
|
|
- this.$successMsg('删除成功')
|
|
|
|
- this.getList()
|
|
|
|
- })
|
|
|
|
|
|
+ deleteInfo([id]).then(() => {
|
|
|
|
+ this.$successMsg('删除成功')
|
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
})
|
|
})
|
|
- },
|
|
|
|
- // 取消按钮重置数据
|
|
|
|
- hanleCancel(form) {
|
|
|
|
- this.$refs['form'].resetFields()
|
|
|
|
- // this.diaLogForm = {
|
|
|
|
- // id: null,
|
|
|
|
- // customerTel: "",
|
|
|
|
- // logisticsCompany: "",
|
|
|
|
- // logisticsNumber: "",
|
|
|
|
- // pickName: "",
|
|
|
|
- // pickTel: "",
|
|
|
|
- // };
|
|
|
|
- this.showDialogForm = false
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
+
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
.textColor {
|
|
.textColor {
|
|
color: black;
|
|
color: black;
|