From 39b24b34ce055cfcf0f0ec7e5fde45aebbe55c51 Mon Sep 17 00:00:00 2001 From: huyuanxiang <273637057@qq.com> Date: Wed, 7 Jun 2023 16:24:24 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E9=A1=B5=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request.js | 3 +- src/views/erp/AddrManagerList.vue | 67 +------ src/views/erp/GoodsList.vue | 57 +----- src/views/erp/OrderList.vue | 255 ++++++++++++++++--------- src/views/erp/const/addrManagerList.js | 65 +++++++ src/views/erp/const/goodsList.js | 55 ++++++ src/views/erp/const/orderList.js | 92 +++++++++ src/views/erp/modules/OrderForm.vue | 24 ++- 8 files changed, 401 insertions(+), 217 deletions(-) create mode 100644 src/views/erp/const/addrManagerList.js create mode 100644 src/views/erp/const/goodsList.js create mode 100644 src/views/erp/const/orderList.js diff --git a/src/utils/request.js b/src/utils/request.js index f7ea2fe..adce2a3 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -11,7 +11,8 @@ import { ACCESS_TOKEN, TENANT_ID } from "@/store/mutation-types" * 则映射后端域名,通过 vue.config.js * @type {*|string} */ -let apiBaseUrl = window._CONFIG['domianURL'] || "/jeecg-boot"; +let apiBaseUrl = 'http://47.100.1.234:8080/jeecg-boot' +// let apiBaseUrl = window._CONFIG['domianURL'] || "/jeecg-boot"; //console.log("apiBaseUrl= ",apiBaseUrl) // 创建 axios 实例 const service = axios.create({ diff --git a/src/views/erp/AddrManagerList.vue b/src/views/erp/AddrManagerList.vue index 37644dd..8327e65 100644 --- a/src/views/erp/AddrManagerList.vue +++ b/src/views/erp/AddrManagerList.vue @@ -100,6 +100,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin' import AddrManagerModal from './modules/AddrManagerModal' import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' + import addrManagerList from '@views/erp/const/addrManagerList' export default { name: 'AddrManagerList', @@ -111,71 +112,7 @@ return { description: '地址管理管理页面', // 表头 - columns: [ - { - title: '#', - dataIndex: '', - key:'rowIndex', - width:60, - align:"center", - customRender:function (t,r,index) { - return parseInt(index)+1; - } - }, - { - title:'用户id', - align:"center", - dataIndex: 'userId' - }, - { - title:'省', - align:"center", - dataIndex: 'province' - }, - { - title:'市', - align:"center", - dataIndex: 'city' - }, - { - title:'地区', - align:"center", - dataIndex: 'county' - }, - { - title:'地址', - align:"center", - dataIndex: 'detail' - }, - { - title:'接收人', - align:"center", - dataIndex: 'recipient' - }, - { - title:'手机', - align:"center", - dataIndex: 'telephone' - }, - { - title:'是否默认,0:否 默认,1:是', - align:"center", - dataIndex: 'isDefault_dictText' - }, - { - title:'备注', - align:"center", - dataIndex: 'remark' - }, - { - title: '操作', - dataIndex: 'action', - align:"center", - fixed:"right", - width:147, - scopedSlots: { customRender: 'action' } - } - ], + columns: addrManagerList, url: { list: "/erp/addrManager/list", delete: "/erp/addrManager/delete", diff --git a/src/views/erp/GoodsList.vue b/src/views/erp/GoodsList.vue index ea89bac..00bf2e8 100644 --- a/src/views/erp/GoodsList.vue +++ b/src/views/erp/GoodsList.vue @@ -100,6 +100,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin' import GoodsModal from './modules/GoodsModal' import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' + import goodsList from '@views/erp/const/goodsList' export default { name: 'GoodsList', @@ -111,61 +112,7 @@ return { description: '产品信息管理页面', // 表头 - columns: [ - { - title: '#', - dataIndex: '', - key:'rowIndex', - width:60, - align:"center", - customRender:function (t,r,index) { - return parseInt(index)+1; - } - }, - { - title:'价格', - align:"center", - dataIndex: 'price' - }, - { - title:'产品名称', - align:"center", - dataIndex: 'goodsName' - }, - { - title:'分类', - align:"center", - dataIndex: 'category' - }, - { - title:'规格', - align:"center", - dataIndex: 'specs' - }, - { - title:'厂商', - align:"center", - dataIndex: 'factory' - }, - { - title:'是否销售,0:否,1:是 默认', - align:"center", - dataIndex: 'ifSale_dictText' - }, - { - title:'备注', - align:"center", - dataIndex: 'remark' - }, - { - title: '操作', - dataIndex: 'action', - align:"center", - fixed:"right", - width:147, - scopedSlots: { customRender: 'action' } - } - ], + columns: goodsList, url: { list: "/erp/goods/list", delete: "/erp/goods/delete", diff --git a/src/views/erp/OrderList.vue b/src/views/erp/OrderList.vue index a7da2e6..c969010 100644 --- a/src/views/erp/OrderList.vue +++ b/src/views/erp/OrderList.vue @@ -46,7 +46,20 @@ :loading="loading" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange"> + @@ -69,8 +82,8 @@ 编辑 - 审核 - 派发 + 审核 + 派发 @@ -92,6 +105,42 @@ + + + + + + + + + + + @@ -102,6 +151,9 @@ import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' import '@/assets/less/TableExpand.less' import { editOrder } from '@/api/shop' + import orderList from '@views/erp/const/orderList' + import { mapGetters } from 'vuex' + import moment from 'moment' export default { name: "OrderList", @@ -111,88 +163,25 @@ }, data () { return { + labelCol: { span: 4 }, + wrapperCol: { span: 18 }, + other: '', + rowInfo: { + state: -1, + row: {} + }, + form: { }, + rules: { + }, + infoModel: { + title: '审核', + visible: false, + confirmLoading: false, + ModalText: 'Content of the modal', + }, description: '订单管理页面', // 表头 - columns: [ - { - title: '#', - dataIndex: '', - key:'rowIndex', - width:60, - align:"center", - customRender:function (t,r,index) { - return parseInt(index)+1; - } - }, - { - title:'收件人', - align:"center", - dataIndex: 'recipient' - }, - { - title:'手机', - align:"center", - dataIndex: 'mobile' - }, - { - title:'总金额', - align:"center", - dataIndex: 'totalAmount' - }, - { - title:'用户id', - align:"center", - dataIndex: 'userId' - }, - { - title:'地址', - align:"center", - dataIndex: 'addr' - }, - { - title:'审核人', - align:"center", - dataIndex: 'financeReview' - }, - { - title:'审核时间', - align:"center", - dataIndex: 'financeTime' - }, - { - title:'审核意见', - align:"center", - dataIndex: 'financeRemark' - }, - { - title:'派单人', - align:"center", - dataIndex: 'dispacher' - }, - { - title:'派发时间', - align:"center", - dataIndex: 'dispacherTime' - }, - { - title:'状态,0:待付款 默认,1:待发货,2:已发货,3:完结,4:退换货', - align:"center", - dataIndex: 'state_dictText' - }, - { - title:'备注', - align:"center", - dataIndex: 'remark' - }, - { - title: '操作', - dataIndex: 'action', - align:"center", - fixed:"right", - width:147, - scopedSlots: { customRender: 'action' }, - } - ], + columns: orderList, url: { list: "/erp/order/list", delete: "/erp/order/delete", @@ -214,21 +203,99 @@ } }, methods: { - handleConfirm(state, row) { - const that = this + ...mapGetters(["userInfo"]), + handleOk(type) { + const that = this + const user = that.userInfo() + if (type === "ok" && that.rowInfo.state === 2 && !that.form.logistics_id) { + this.$message.warn('请填写物流单号') + return + } + this.$refs.ruleForm.validate(valid => { + if (valid) { + this.$confirm({ - title: "确认操作", - content: "是否确认此操作?", - onOk: function () { - row.state = state - addOrder(row).then(res => { - that.$message.success('操作成功'); - that.loadData(1); - }) + title: "确认操作", + content: "是否确认此操作?", + onOk: function () { + that.infoModel.confirmLoading = true + const state = type === 'cancel'? 5 : that.rowInfo.state + const time = moment().format('YYYY-MM-DD HH:mm:ss') + let params = { + state, + id: that.rowInfo.row.id } + if (that.rowInfo.state === 1) { + params.financeReview = user.realname + params.financeTime = time + params.financeId = user.id + params.financeRemark = that.form.desc + } else if (that.rowInfo.state === 2) { + params.dispacher = user.realname + params.dispacherId = user.id + params.logisticsId = that.form.logistics_id + params.dispacherTime = time + params.dispacherRemark = that.form.desc + } + params = Object.assign({}, that.rowInfo.row, params) + editOrder(params).then(res => { + that.infoModel.confirmLoading = false + that.infoModel.visible = false + if (res.result) { + that.$message.success('操作成功'); + that.loadData(1); + } else { + that.$message.warn(res.message); + } + }).catch(() => { + that.infoModel.confirmLoading = false + that.infoModel.visible = false }) - - }, + } + }) + } else { + return false; + } + }); + }, + handleCancel() { + console.log() + }, + handleCloseInfoModal() { + this.infoModel.visible = false + }, + handleConfirm(state, row) { + if (![0, 1].includes(row.state)) { + this.$message.error('该状态无权限操作') + return + } + this.form = {} + this.rules = {} + const baseObject = {desc: ''} + const baseObjectRules = { desc: [{ message: '填写备注', trigger: 'blur' }]} + const textOBj = { + 1: '审核', + 2: '派发' + } + const obj = { + 1: Object.assign({}, baseObject), + 2: Object.assign({ + logistics_id: '', + }, baseObject) + } + this.form = obj[state] + // 派发填写物流单号 + // this.rules = state === 2 ? Object.assign({}, this.rules, { + // logistics_id: [ + // { required: true, message: '填写物流单号', trigger: 'blur' }, + // ],}) : this.rules + this.infoModel.title = textOBj[state] + this.infoModel.visible = true + this.rowInfo = { + row, + state + } + }, initDictConfig(){ }, getSuperFieldList(){ diff --git a/src/views/erp/const/addrManagerList.js b/src/views/erp/const/addrManagerList.js new file mode 100644 index 0000000..de79fb2 --- /dev/null +++ b/src/views/erp/const/addrManagerList.js @@ -0,0 +1,65 @@ +export default [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'用户id', + align:"center", + dataIndex: 'userId' + }, + { + title:'省', + align:"center", + dataIndex: 'province' + }, + { + title:'市', + align:"center", + dataIndex: 'city' + }, + { + title:'地区', + align:"center", + dataIndex: 'county' + }, + { + title:'地址', + align:"center", + dataIndex: 'detail' + }, + { + title:'接收人', + align:"center", + dataIndex: 'recipient' + }, + { + title:'手机', + align:"center", + dataIndex: 'telephone' + }, + { + title:'默认地址', + align:"center", + dataIndex: 'isDefault_dictText' + }, + { + title:'备注', + align:"center", + dataIndex: 'remark' + }, + { + title: '操作', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } +] \ No newline at end of file diff --git a/src/views/erp/const/goodsList.js b/src/views/erp/const/goodsList.js new file mode 100644 index 0000000..040487f --- /dev/null +++ b/src/views/erp/const/goodsList.js @@ -0,0 +1,55 @@ +export default [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'价格', + align:"center", + dataIndex: 'price' + }, + { + title:'产品名称', + align:"center", + dataIndex: 'goodsName' + }, + { + title:'分类', + align:"center", + dataIndex: 'category' + }, + { + title:'规格', + align:"center", + dataIndex: 'specs' + }, + { + title:'厂商', + align:"center", + dataIndex: 'factory' + }, + { + title:'是否销售', + align:"center", + dataIndex: 'ifSale_dictText' + }, + { + title:'备注', + align:"center", + dataIndex: 'remark' + }, + { + title: '操作', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } +] \ No newline at end of file diff --git a/src/views/erp/const/orderList.js b/src/views/erp/const/orderList.js new file mode 100644 index 0000000..bf65234 --- /dev/null +++ b/src/views/erp/const/orderList.js @@ -0,0 +1,92 @@ +export default [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'收件人', + align:"center", + dataIndex: 'recipient' + }, + { + title:'手机', + align:"center", + dataIndex: 'mobile' + }, + { + title:'总金额', + align:"center", + dataIndex: 'totalAmount' + }, + { + title:'用户id', + align:"center", + dataIndex: 'userId' + }, + { + title:'订单状态', + align:"center", + dataIndex: 'state', + scopedSlots: { customRender: 'state' } + }, + { + title:'下单地址', + align:"center", + dataIndex: 'addr' + }, + { + title:'审核人', + align:"center", + dataIndex: 'financeReview' + }, + { + title:'审核时间', + align:"center", + dataIndex: 'financeTime' + }, + { + title:'审核意见', + align:"center", + dataIndex: 'financeRemark' + }, + { + title:'派单人', + align:"center", + dataIndex: 'dispacher' + }, + { + title:'派发时间', + align:"center", + dataIndex: 'dispacherTime' + }, + { + title:'物流单号', + align:"center", + dataIndex: 'logisticsId' + }, + { + title:'派发意见', + align:"center", + dataIndex: 'dispacherRemark' + }, + + { + title:'订单备注', + align:"center", + dataIndex: 'remark' + }, + { + title: '操作', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' }, + } +] \ No newline at end of file diff --git a/src/views/erp/modules/OrderForm.vue b/src/views/erp/modules/OrderForm.vue index 091ae5e..ccbce6e 100644 --- a/src/views/erp/modules/OrderForm.vue +++ b/src/views/erp/modules/OrderForm.vue @@ -29,6 +29,11 @@ + + + + + @@ -44,19 +49,34 @@ + + + + + + + + + + - - + + + + + + +