diff --git a/src/views/order/component/PolicySelectModal.vue b/src/views/order/component/PolicySelectModal.vue new file mode 100644 index 0000000..f71b282 --- /dev/null +++ b/src/views/order/component/PolicySelectModal.vue @@ -0,0 +1,104 @@ + + + + + + diff --git a/src/views/order/orderList.vue b/src/views/order/orderList.vue index 7a5ee36..b0d11ea 100644 --- a/src/views/order/orderList.vue +++ b/src/views/order/orderList.vue @@ -157,6 +157,11 @@ + @@ -164,7 +169,8 @@ import { getList, index as getTypes, - clone as cloneOrder + clone as cloneOrder, + save as saveOrder } from "@/api/order" import { parseTime @@ -180,17 +186,21 @@ import orderLog from '@/views/order/component/orderLog' import actions from '@/views/order/component/actions' import orderEdit from '@/views/order/component/orderEdit' + import policySelectModal from '@/views/order/component/PolicySelectModal' export default { components: { orderLog, actions, - orderEdit + orderEdit, + policySelectModal }, data() { return { selectId: null, isShowLog: false, isShowEdit: false, + isShowPolicySelect: false, + currentOrderId: null, memberId:"", merchants: [], orderItemStates: [], @@ -398,6 +408,30 @@ label: "预产期", width: 120 }, + { + label: "关联政策", + prop: 'order_policy.name', + width: 150, + align: 'left', + customFn: (row) => { + const policyName = row.order_policy?.name || '' + return ( +
+ {policyName} + { + this.currentOrderId = row.order?.id + this.isShowPolicySelect = true + } + }} + > +
+ ) + } + }, { prop: "product_type.name", label: "产品类型", @@ -408,6 +442,12 @@ label: "产品型号", width: 100 }, + { + prop: "product.merchant.username", + label: "商品商家", + align: "left", + width: 160 + }, { prop: "merchant.username", label: "服务商家", @@ -706,6 +746,26 @@ // 用户取消操作,不做任何处理 }) }, + selectPolicy(row) { + if (!this.currentOrderId || !row) { + return + } + saveOrder({ + id: this.currentOrderId, + policy_id: row.id + }).then(res => { + Message({ + type: 'success', + message: '更新关联政策成功' + }) + this.getOrders() + }).catch(err => { + Message({ + type: 'error', + message: err?.errmsg || '更新关联政策失败' + }) + }) + }, downloadExel() { diff --git a/vue.config.js b/vue.config.js index 8daba2c..079ca25 100644 --- a/vue.config.js +++ b/vue.config.js @@ -25,7 +25,7 @@ module.exports = { * Detail: https://cli.vuejs.org/config/#publicpath */ publicPath: '/admin/', - outputDir: '/Users/mac/Documents/朗业/2022/y-孕育邦/后端代码/yunyubang/public/admin_test', + outputDir: '/Users/mac/Documents/朗业/2022/y-孕育邦/后端代码/yunyubang/public/admin', assetsDir: 'static', css: { loaderOptions: { // 向 CSS 相关的 loader 传递选项