From fdfcc811477ec3d8f3f481818290eb7e31cb9c7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Wed, 29 Sep 2021 01:17:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=B9=E6=AC=A1=E5=95=86?= =?UTF-8?q?=E5=93=81=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jshERP-web/src/api/api.js | 2 + .../src/components/jeecg/JEditableTable.vue | 13 +- .../src/components/jeecgbiz/JSelectList.vue | 91 +++++++ .../jeecgbiz/modal/JSelectBatchModal.vue | 248 ++++++++++++++++++ .../jeecgbiz/modal/JSelectMaterialModal.vue | 12 +- .../src/views/bill/mixins/BillModalMixin.js | 26 +- .../views/bill/modules/PurchaseInModal.vue | 2 +- .../src/views/bill/modules/SaleOutModal.vue | 6 +- .../src/views/system/SerialNumberList.vue | 1 + 9 files changed, 388 insertions(+), 13 deletions(-) create mode 100644 jshERP-web/src/components/jeecgbiz/JSelectList.vue create mode 100644 jshERP-web/src/components/jeecgbiz/modal/JSelectBatchModal.vue diff --git a/jshERP-web/src/api/api.js b/jshERP-web/src/api/api.js index f5a96d96..066dd948 100644 --- a/jshERP-web/src/api/api.js +++ b/jshERP-web/src/api/api.js @@ -97,6 +97,7 @@ const findBySelectRetail = (params)=>postAction("/supplier/findBySelect_retail", //单据相关 const findBillDetailByNumber = (params)=>getAction("/depotHead/getDetailByNumber",params); const findStockByDepotAndBarCode = (params)=>getAction("/depotItem/findStockByDepotAndBarCode",params); +const getBatchNumberList = (params)=>getAction("/depotItem/getBatchNumberList",params); const findFinancialDetailByNumber = (params)=>getAction("/accountHead/getDetailByNumber",params); export { @@ -176,6 +177,7 @@ export { findBySelectRetail, findBillDetailByNumber, findStockByDepotAndBarCode, + getBatchNumberList, findFinancialDetailByNumber } diff --git a/jshERP-web/src/components/jeecg/JEditableTable.vue b/jshERP-web/src/components/jeecg/JEditableTable.vue index 445a6324..e1cea84d 100644 --- a/jshERP-web/src/components/jeecg/JEditableTable.vue +++ b/jshERP-web/src/components/jeecg/JEditableTable.vue @@ -405,7 +405,9 @@ @mouseover="()=>{handleMouseoverCommono(row,col)}" @mouseout="()=>{handleMouseoutCommono(row,col)}"> - @@ -767,14 +769,14 @@ import { getFileAccessHttpUrl } from '@/api/manage'; import JInputPop from '@/components/jeecg/minipop/JInputPop' import JFilePop from '@/components/jeecg/minipop/JFilePop' - import JSelectMaterial from '@/components/jeecgbiz/JSelectMaterial' + import JSelectList from '@/components/jeecgbiz/JSelectList' // 行高,需要在实例加载完成前用到 let rowHeight = 42 export default { name: 'JEditableTable', - components: { JDate, Draggable, JInputPop, JFilePop, JSelectMaterial }, + components: { JDate, Draggable, JInputPop, JFilePop, JSelectList }, provide() { return { parentIsJEditableTable: true, @@ -2704,6 +2706,11 @@ getPopupJshValue(id) { return this.popupJshValues[id] }, + /** popupJsh构造传值 */ + getPopupJshRows(row) { + let { values } = this.getValuesSync({ validate: false, rowIds: [row.id] }) + return JSON.stringify(values[0]) + }, handleRadioChange(value, id, row, column) { this.radioValues = this.bindValuesChange(value, id, 'radioValues') // 做单个表单验证 diff --git a/jshERP-web/src/components/jeecgbiz/JSelectList.vue b/jshERP-web/src/components/jeecgbiz/JSelectList.vue new file mode 100644 index 00000000..a451a6a5 --- /dev/null +++ b/jshERP-web/src/components/jeecgbiz/JSelectList.vue @@ -0,0 +1,91 @@ + + + + + \ No newline at end of file diff --git a/jshERP-web/src/components/jeecgbiz/modal/JSelectBatchModal.vue b/jshERP-web/src/components/jeecgbiz/modal/JSelectBatchModal.vue new file mode 100644 index 00000000..1432ae66 --- /dev/null +++ b/jshERP-web/src/components/jeecgbiz/modal/JSelectBatchModal.vue @@ -0,0 +1,248 @@ + + + + + \ No newline at end of file diff --git a/jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal.vue b/jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal.vue index 9ecf2265..31d0a8d6 100644 --- a/jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal.vue +++ b/jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal.vue @@ -6,7 +6,7 @@ @ok="handleSubmit" @cancel="close" cancelText="关闭" - style="margin-top: -70px" + style="top:5%;height: 100%;overflow-y: hidden" wrapClassName="ant-modal-cust-warp" > @@ -76,11 +76,11 @@ name: 'JSelectMaterialModal', mixins:[JeecgListMixin], components: {}, - props: ['modalWidth', 'multi', 'barCode'], + props: ['modalWidth', 'rows', 'multi', 'barCode'], data() { return { queryParam: { - q: "", + q: '', depotId: '' }, labelCol: { @@ -163,6 +163,11 @@ } }, async loadData(arg) { + if(this.rows) { + if(JSON.parse(this.rows).depotId){ + this.queryParam.depotId = JSON.parse(this.rows).depotId-0 + } + } if (arg === 1) { this.ipagination.current = 1; } @@ -233,7 +238,6 @@ this.visible = false; }, handleTableChange(pagination, filters, sorter) { - //TODO 筛选 if (Object.keys(sorter).length > 0) { this.isorter.column = sorter.field; this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc'; diff --git a/jshERP-web/src/views/bill/mixins/BillModalMixin.js b/jshERP-web/src/views/bill/mixins/BillModalMixin.js index 171cdc5f..34c67694 100644 --- a/jshERP-web/src/views/bill/mixins/BillModalMixin.js +++ b/jshERP-web/src/views/bill/mixins/BillModalMixin.js @@ -1,5 +1,6 @@ import { FormTypes } from '@/utils/JEditableTableUtil' -import {findBySelectSup,findBySelectCus,findBySelectRetail,getMaterialByBarCode,findStockByDepotAndBarCode,getAccount,getPersonByNumType} from '@/api/api' +import {findBySelectSup,findBySelectCus,findBySelectRetail,getMaterialByBarCode,findStockByDepotAndBarCode,getAccount, + getPersonByNumType, getBatchNumberList} from '@/api/api' import { getAction,putAction } from '@/api/manage' import { getMpListShort, getNowFormatDateTime } from "@/utils/util" import Vue from 'vue' @@ -213,7 +214,7 @@ export const BillModalMixin = { onValueChange(event) { let that = this const { type, row, column, value, target } = event - let param,operNumber,unitPrice,taxUnitPrice,allPrice,taxRate,taxMoney,taxLastMoney + let param,batchNumber,operNumber,unitPrice,taxUnitPrice,allPrice,taxRate,taxMoney,taxLastMoney switch(column.key) { case "depotId": if(row.barCode){ @@ -274,6 +275,27 @@ export const BillModalMixin = { } }); break; + case "batchNumber": + batchNumber = value-0 + getBatchNumberList({name:'', depotId: row.depotId, barCode: row.barCode, batchNumber: batchNumber}).then((res) => { + if (res && res.code === 200) { + if(res.data && res.data.rows) { + let info = res.data.rows[0] + operNumber = info.totalNum + taxRate = row.taxRate-0 //税率 + unitPrice = row.unitPrice-0 //单价 + taxUnitPrice = row.taxUnitPrice-0 + allPrice = (unitPrice*operNumber).toFixed(2)-0 + taxMoney =((taxRate*0.01)*allPrice).toFixed(2)-0 + taxLastMoney = (allPrice + taxMoney).toFixed(2)-0 + target.setValues([{rowKey: row.id, values: {expirationDate: info.expirationDateStr, operNumber: operNumber, + allPrice: allPrice, taxMoney: taxMoney, taxLastMoney: taxLastMoney}}]) + target.recalcAllStatisticsColumns() + that.autoChangePrice(target) + } + } + }) + break; case "operNumber": operNumber = value-0 taxRate = row.taxRate-0 //税率 diff --git a/jshERP-web/src/views/bill/modules/PurchaseInModal.vue b/jshERP-web/src/views/bill/modules/PurchaseInModal.vue index 1577298a..faa1ed51 100644 --- a/jshERP-web/src/views/bill/modules/PurchaseInModal.vue +++ b/jshERP-web/src/views/bill/modules/PurchaseInModal.vue @@ -173,7 +173,7 @@ { title: '仓库名称', key: 'depotId', width: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [], allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }] }, - { title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, multi: true, + { title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true, validateRules: [{ required: true, message: '${title}不能为空' }] }, { title: '名称', key: 'name', width: '6%', type: FormTypes.input, readonly: true }, diff --git a/jshERP-web/src/views/bill/modules/SaleOutModal.vue b/jshERP-web/src/views/bill/modules/SaleOutModal.vue index 88e10e34..7fcf76c5 100644 --- a/jshERP-web/src/views/bill/modules/SaleOutModal.vue +++ b/jshERP-web/src/views/bill/modules/SaleOutModal.vue @@ -177,7 +177,7 @@ { title: '仓库名称', key: 'depotId', width: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [], allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }] }, - { title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, multi: true, + { title: '条码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true, validateRules: [{ required: true, message: '${title}不能为空' }] }, { title: '名称', key: 'name', width: '6%', type: FormTypes.input, readonly: true }, @@ -187,8 +187,8 @@ { title: '库存', key: 'stock', width: '5%', type: FormTypes.input, readonly: true }, { title: '单位', key: 'unit', width: '4%', type: FormTypes.input, readonly: true }, { title: '序列号', key: 'snList', width: '5%', type: FormTypes.input }, - { title: '批号', key: 'batchNumber', width: '5%', type: FormTypes.input }, - { title: '有效期', key: 'expirationDate',width: '7%', type: FormTypes.input }, + { title: '批号', key: 'batchNumber', width: '7%', type: FormTypes.popupJsh, kind: 'batch', multi: false }, + { title: '有效期', key: 'expirationDate',width: '5%', type: FormTypes.input, readonly: true }, { title: '多属性', key: 'sku', width: '4%', type: FormTypes.input, readonly: true }, { title: '原数量', key: 'preNumber', width: '4%', type: FormTypes.input, readonly: true }, { title: '已入库', key: 'finishNumber', width: '4%', type: FormTypes.input, readonly: true }, diff --git a/jshERP-web/src/views/system/SerialNumberList.vue b/jshERP-web/src/views/system/SerialNumberList.vue index 0d7f0918..b8a99fdc 100644 --- a/jshERP-web/src/views/system/SerialNumberList.vue +++ b/jshERP-web/src/views/system/SerialNumberList.vue @@ -125,6 +125,7 @@ {title: '序列号',align: "left", dataIndex: 'serialNumber', width: 180}, {title: '商品条码', align: "center",dataIndex: 'materialCode', width: 120}, {title: '商品名称', align: "center",dataIndex: 'materialName', width: 120}, + {title: '仓库', align: "center", dataIndex: 'depotName', width: 150}, { title: '单据编号', align: "center", dataIndex: 'depotHeadNumber', width: 150, scopedSlots: { customRender: 'numberCustomRender' },