From 0966e6eedbfa85ecc7aae612fc6ed9cc6afd19e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B9=B3=E8=89=BA?= <52643018@qq.com> Date: Fri, 30 Jul 2021 11:53:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E5=8F=91=E8=B5=B7?= =?UTF-8?q?=E6=8A=A5=E4=BB=B7=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/api.js | 3 +- common/mixin.js | 2 +- pages.json | 3 +- pages/supply/gonghuo/detail.vue | 7 +- pages/supply/offer/index.vue | 146 ++++++++++++++++++++++---------- pages/supply/order/detail.vue | 7 +- 6 files changed, 116 insertions(+), 52 deletions(-) diff --git a/common/api.js b/common/api.js index e279477..1920e27 100644 --- a/common/api.js +++ b/common/api.js @@ -14,13 +14,14 @@ export const API_SUPPLIER_QUOTATIONAPPLY = '/api/supplier/quotationApply'; // export const API_SUPPLIER_QUOTATIONORDERLIST = '/api/supplier/quotationOrderList'; // 申请报价-订单列表 export const API_SUPPLIER_PURCHASEORDERLIST = '/api/supplier/purchaseOrderList'; // 供货订单列表 export const API_SUPPLIER_QUOTATIONDETAIL = '/api/supplier/quotationDetail'; // 报价订单详情 -export const API_SUPPLIER_TEMPORARYQUOTATION = '/api/supplier/temporaryQuotation'; // 报价订单 临时保存 export const API_SUPPLIER_QUOTATIONUPDATE = '/api/supplier/quotationUpdate'; // 改变报价订单状态 export const API_SUPPLIER_PURCHASEORDERACCEPT = '/api/supplier/purchaseOrderAccept'; // 供应商接单 export const API_SUPPLIER_PURCHASEDETAIL = '/api/supplier/purchaseDetail'; // 供货订单详情 export const API_SUPPLIER_PURCHASEORDERSENDOUT = '/api/supplier/purchaseOrderSendout'; // 供应商确认发货 export const API_SUPPLIER_PURCHASEUPLOADVOUCHER = '/api/supplier/purchaseUploadVoucher'; // 上传凭证 export const API_SUPPLIER_PURCHASESAVEVOUCHER = '/api/supplier/purchaseSaveVoucher'; // 保存凭证 +export const API_SUPPLIER_QUOTATIONREUSEBYORDER = '/api/supplier/quotationReuseByOrder'; // 报价订单复用 根据【订单号】 +export const API_SUPPLIER_QUOTATIONREUSEBYBATCH = '/api/supplier/quotationReuseByBatch'; // 报价订单复用 根据【批次号】 /* 食堂相关接口 */ export const API_CANTEEN_LOGIN = '/api/canteen/login'; // 登录 diff --git a/common/mixin.js b/common/mixin.js index 99f5dcd..4af40e3 100644 --- a/common/mixin.js +++ b/common/mixin.js @@ -126,7 +126,7 @@ export default{ 'pages/empty/index', '/preview-image' ]; - if(intercept_route.includes(this.$getPageType())){ + if(intercept_route.includes(this.currentPage)){ return; // 忽略提示跳转的路由 } let path_url = '/pages/'+ this.$getPageType() +'/login/index'; diff --git a/pages.json b/pages.json index fd5d4f4..6be489e 100644 --- a/pages.json +++ b/pages.json @@ -22,8 +22,7 @@ { "path": "pages/supply/offer/index", "style": { - "navigationBarTitleText": "发起报价", - "disableScroll": true + "navigationBarTitleText": "发起报价" } }, { diff --git a/pages/supply/gonghuo/detail.vue b/pages/supply/gonghuo/detail.vue index 712af92..a526dd6 100644 --- a/pages/supply/gonghuo/detail.vue +++ b/pages/supply/gonghuo/detail.vue @@ -128,7 +128,7 @@ }, onLoad(options){ this.p_sn = options.p_sn; - // this.getData(); + this.getData(); }, methods: { getData(){ @@ -259,7 +259,10 @@ } this.is_show_receiving = false; this.$http(this.API.API_SUPPLIER_PURCHASEORDERSENDOUT, { - p_sn: this.p_sn + p_sn: this.p_sn, + deliver_phone: driver_phone, + deliver_man: driver_name, + car_license: l_p_num }).then(res => { console.log("confirmDeliver", res); this.$msg('确认收货成功') diff --git a/pages/supply/offer/index.vue b/pages/supply/offer/index.vue index 2c0d116..463c569 100644 --- a/pages/supply/offer/index.vue +++ b/pages/supply/offer/index.vue @@ -27,7 +27,12 @@ - + @@ -54,17 +59,24 @@ label: '规格', key: 'spec' },{ - label: '税前价', - key: 'pre_tax_price' + label: '单位', + key: 'unit' },{ - label: '税后价', - key: 'after_tax_price' + label: '品牌', + key: 'brand' + },{ + label: '品质', + key: 'quality_level' + },{ + label: '报价', + key: 'offer' }], contents: [], is_show: false, - relation_list: [], + relation_list: [], // 关联食堂列表 node_top: 0, - q_sn: '' // 订单号,如果有 + code: '', // 订单号,批次号,如果有 + type: 0 } }, computed: { @@ -83,10 +95,21 @@ } }, onLoad(options){ - this.q_sn = options.q_sn || ''; - // todo 临时保存的数据,下次进来再请求一个接口,页面显示出来 - this.getMaterialList(); - // this.getCanteenList(); + this.code = options.code || ''; + this.type = options.type || 0; + if(options.type == 1){ + // 编辑,不可更换食堂 + this.editMaterialList(); + }else if(options.type == 2){ + // 复用订单号 + this.materialListByOrder(); + }else if(options.type == 3){ + // 复用批次号 + this.materialListByBatch(); + }else{ + // 单纯发起报价 + this.getMaterialList(); + } }, onReady(){ let that = this; @@ -101,45 +124,80 @@ methods: { // 获取物资列表 getMaterialList(){ - this.$http(this.API.API_SUPPLIER_TEMPORARYQUOTATION, { - supplier_id: getApp().globalData.supplier_id, - // q_sn: this.q_sn // 传入订单号 + this.$http(this.API.API_SUPPLIER_MATERIALLIST).then(res => { + let list = res.data.spec || []; + let contents = list.map(item => { + return { + name: item?.material?.m_name || '', + material_id: item?.material?.id || 0, + spec: item.name, + spec_id: item.id, + unit: item?.material?.unit?.unit_name || '', + brand: item?.material?.brand || '', + quality_level: item?.material?.quality_level || '', + offer: {edit: true, value: ''} + } + }) + this.contents = contents; + this.getCanteenList(); + }) + }, + // 编辑物资列表 + editMaterialList(){ + // this.$http(this.API.).then(res => { + // console.log("editMaterialList", res); + // }) + }, + // 复用报价订单号 + materialListByOrder(){ + this.$http(this.API.API_SUPPLIER_QUOTATIONREUSEBYORDER, { + q_sn: this.code }).then(res => { + console.log("materialListByOrder", res); let list = res.data.order || []; + let canteen = res.data.canteen || []; let contents = list.map(item => { - let obj = { - name: item.material?.m_name, - material_id: item.material?.id, + return { + name: item?.material?.m_name || '', + material_id: item?.material?.id || 0, spec: item.name, spec_id: item.id, - pre_tax_price: {edit: true, value: ''}, - after_tax_price: {edit: true, value: ''} + unit: item?.material?.unit?.unit_name || '', + brand: item?.material?.brand || '', + quality_level: item?.material?.quality_level || '', + offer: {edit: true, value: ''} } - if(item.quotation && Object.keys(item.quotation).length){ - obj.pre_tax_price.value = item.quotation.tax_price; - obj.after_tax_price.value = item.quotation.non_tax_price; + }) + this.contents = contents; + this.getCanteenList(canteen); + }) + }, + // 复用批次号 + materialListByBatch(){ + this.$http(this.API.API_SUPPLIER_QUOTATIONREUSEBYBATCH, { + batch_sn: this.code + }).then(res => { + console.log("materialListByBatch", res); + let list = res.data.order || []; + let canteen = res.data.canteen || []; + let contents = list.map(item => { + return { + name: item?.material?.m_name || '', + material_id: item?.material?.id || 0, + spec: item.name, + spec_id: item.id, + unit: item?.material?.unit?.unit_name || '', + brand: item?.material?.brand || '', + quality_level: item?.material?.quality_level || '', + offer: {edit: true, value: ''} } - return obj; - }); + }) this.contents = contents; - this.getCanteenList(res.data.canteen || []); - // let list = res.data.material || []; - // let contents = list.map(item => { - // console.log("item", item) - // return { - // name: item.material?.m_name, - // spec: item.name, - // pre_tax_price: {edit: true, value: item.tax_standard_price}, - // after_tax_price: {edit: true, value: item.non_tax_standard_price}, - // spec_id: item.id, - // material_id: item.material?.id - // } - // }) - // this.contents = contents; + this.getCanteenList(canteen); }) }, // 关联食堂列表 - getCanteenList(canteen){ + getCanteenList(canteen = []){ this.$http(this.API.API_SUPPLIER_CANTEENLIST).then(res => { let list = res.data.list.map(item => { item.checked = false; @@ -170,12 +228,11 @@ // 物资列表 let list = []; this.contents.map(item => { - if(item.pre_tax_price.value || item.after_tax_price.value){ + if(item.offer.value){ list.push({ m_id: item.material_id, m_spec_id: item.spec_id, - tax_price: item.pre_tax_price.value, - non_tax_price: item.after_tax_price.value + offer: item.offer.value }) } }); @@ -189,8 +246,11 @@ if(canteen_ids.length <= 0){ return this.$msg('您未选择关联食堂哦') } + if(list.length <= 0){ + return this.$msg('没有需要报价的物资') + } // 操作状态,是保存还是直接发起 - let state = ['待发单', '待审核'][_t]; + let state = ['待发起', '待审核'][_t]; this.$http(this.API.API_SUPPLIER_QUOTATIONAPPLY, { data: list, state: state, diff --git a/pages/supply/order/detail.vue b/pages/supply/order/detail.vue index 7c97f00..4450a4e 100644 --- a/pages/supply/order/detail.vue +++ b/pages/supply/order/detail.vue @@ -26,11 +26,12 @@ - + - + + 报价已通过 报价已被拒绝 @@ -44,7 +45,7 @@ components: { wybTable }, data(){ return { - type: 1, + type: 3, order: {}, headers: [{ label: '菜品名称',