From 30ab58d46617ac47dfafdfcd45afa3dc106dc561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B9=B3=E8=89=BA?= <52643018@qq.com> Date: Wed, 28 Jul 2021 19:11:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=AF=B9=E6=8E=A5=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E5=87=BA=E5=BA=93=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/api.js | 3 +- pages.json | 6 + pages/canteen/classification/warehouse.vue | 222 +++++++++++++++++++++ pages/canteen/delivery/apply.vue | 70 ++++--- 4 files changed, 264 insertions(+), 37 deletions(-) create mode 100644 pages/canteen/classification/warehouse.vue diff --git a/common/api.js b/common/api.js index f8f8b53..953cc23 100644 --- a/common/api.js +++ b/common/api.js @@ -31,4 +31,5 @@ export const API_CANTEEN_PURCHASEORDERLIST = '/api/canteen/purchaseOrderList'; / export const API_CANTEEN_WAREHOUSEOUT = '/api/canteen/warehouseOut'; // 出库申请 export const API_CANTEEN_WAREHOUSEOUTLIST = '/api/canteen/warehouseOutList'; // 出库申请列表 export const API_CANTEEN_PURCHASEDETAIL = '/api/canteen/purchaseDetail'; // 采购单详情 -export const API_CANTEEN_SUPPLIERLIST = '/api/canteen/supplierList'; // 供应商列表 \ No newline at end of file +export const API_CANTEEN_SUPPLIERLIST = '/api/canteen/supplierList'; // 供应商列表 +export const API_CANTEEN_MATERIALLISTBYWAREHOUSE = '/api/canteen/materialListByWarehouse'; // 仓库物资列表 \ No newline at end of file diff --git a/pages.json b/pages.json index b833b2a..fd5d4f4 100644 --- a/pages.json +++ b/pages.json @@ -101,6 +101,12 @@ "navigationBarTitleText": "添加物资" } }, + { + "path": "pages/canteen/classification/warehouse", + "style": { + "navigationBarTitleText": "添加物资" + } + }, { "path": "pages/canteen/delivery/apply", "style": { diff --git a/pages/canteen/classification/warehouse.vue b/pages/canteen/classification/warehouse.vue new file mode 100644 index 0000000..6d9adf9 --- /dev/null +++ b/pages/canteen/classification/warehouse.vue @@ -0,0 +1,222 @@ + + + + + diff --git a/pages/canteen/delivery/apply.vue b/pages/canteen/delivery/apply.vue index cf3a48c..2efc37a 100644 --- a/pages/canteen/delivery/apply.vue +++ b/pages/canteen/delivery/apply.vue @@ -3,8 +3,7 @@ 出库清单 - - + @@ -15,12 +14,12 @@ 物资明细 - + - - + + @@ -36,57 +35,56 @@ return { headers: [{ label: '菜品名称', - key: 'name' + key: 'material_name' },{ label: '规格', - key: 'spec' + key: 'spec_name' },{ - label: '税前价', - key: 'pre_tax_price' - },{ - label: '税后价', - key: 'after_tax_price' + label: '批次', + key: 'purchase_id' }], - contents: [] + contents: [], + warehouse_list: {} } }, onLoad(){ - this.getMaterialList(); + // 监听warehouse_list被操作 + uni.$on('addWarehouseList', res => { + this.warehouse_list = res; + }) + }, + onShow(){ + let contents = []; + let warehouse_list = this.warehouse_list; + for(let i in warehouse_list){ + contents.push(warehouse_list[i]); + } + this.contents = contents; }, methods: { - getMaterialList(){ - this.$http(this.API.API_CANTEEN_MATERIALLIST, { - // category_id: 1 // 分类id 不传则显示默认分类 - }).then(res => { - let list = res.data.material || []; - let contents = list.map(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; - }) - }, + // todo table输入框 onInputChange(event){ console.log("检测到table input被更改", event); - this.contents[event.contentIndex][event.key].value = event.detailValue; + // this.contents[event.contentIndex][event.key].value = event.detailValue; }, + // 保存,出库 save(_t){ - // todo console.log("dddddd", this.contents) + if(this.contents.length <= 0) { + return this.$msg('您未选择物资') + } let list = this.contents.map(item => { return { 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 + tax_price: '', + non_tax_price: '', + purchase_id: item.purchase_id, + out_number: '' } }); + + // let state = ['', ''][_t]; // 传入状态 this.$http(this.API.API_CANTEEN_WAREHOUSEOUT, { data: list }).then(res => {