Quellcode durchsuchen

Merge branch 'dev_ml_423' of http://121.40.253.172:3000/pengyue/jsh_erp into dev_huangjunjie

huang vor 1 Woche
Ursprung
Commit
aff058f510

+ 6 - 6
jshERP-web/src/views/bill/dialog/BillDetail.vue

@@ -1669,7 +1669,7 @@ export default {
         { title: '实际入库数量', dataIndex: 'actualQuantityInStorage', width: 115 },
         { title: '入库差异', dataIndex: 'warehousingVariance', width: 90 },
         { title: '入库差异原因', dataIndex: 'reasonOfDifference', width: 115 },
-        { title: '入库人', dataIndex: 'warehousingUser', width: 90 },
+        { title: '入库人', dataIndex: 'warehousingUserName', width: 90 },
         { title: '入库时间', dataIndex: 'warehousingTime', width: 90 },
 
         { title: '重量', dataIndex: 'weight', width: 90 },
@@ -1775,7 +1775,7 @@ export default {
         { title: '实际出库数量', dataIndex: 'actualQuantityInStorage', width: 115 },
         { title: '出库差异', dataIndex: 'warehousingVariance', width: 90 },
         { title: '出库差异原因', dataIndex: 'reasonOfDifference', width: 115 },
-        { title: '出库人', dataIndex: 'warehousingUser', width: 90 },
+        { title: '出库人', dataIndex: 'warehousingUserName', width: 90 },
         { title: '出库时间', dataIndex: 'warehousingTime', width: 90 },
 
         { title: '重量', dataIndex: 'weight', width: 90 },
@@ -1815,7 +1815,7 @@ export default {
         { title: '实际出库数量', dataIndex: 'actualQuantityInStorage', width: 115 },
         { title: '出库差异', dataIndex: 'warehousingVariance', width: 90 },
         { title: '出库差异原因', dataIndex: 'reasonOfDifference', width: 115 },
-        { title: '出库人', dataIndex: 'warehousingUser', width: 90 },
+        { title: '出库人', dataIndex: 'warehousingUserName', width: 90 },
         { title: '出库时间', dataIndex: 'warehousingTime', width: 90 },
 
         { title: '重量', dataIndex: 'weight', width: 90 },
@@ -1877,7 +1877,7 @@ export default {
         { title: '实际入库数量', dataIndex: 'actualQuantityInStorage', width: 115 },
         { title: '入库差异', dataIndex: 'warehousingVariance', width: 90 },
         { title: '入库差异原因', dataIndex: 'reasonOfDifference', width: 115 },
-        { title: '入库人', dataIndex: 'warehousingUser', width: 90 },
+        { title: '入库人', dataIndex: 'warehousingUserName', width: 90 },
         { title: '入库时间', dataIndex: 'warehousingTime', width: 90 },
 
         { title: '重量', dataIndex: 'weight', width: 90 },
@@ -1912,7 +1912,7 @@ export default {
         { title: '实际出库数量', dataIndex: 'actualQuantityInStorage', width: 115 },
         { title: '出库差异', dataIndex: 'warehousingVariance', width: 90 },
         { title: '出库差异原因', dataIndex: 'reasonOfDifference', width: 115 },
-        { title: '出库人', dataIndex: 'warehousingUser', width: 90 },
+        { title: '出库人', dataIndex: 'warehousingUserName', width: 90 },
         { title: '出库时间', dataIndex: 'warehousingTime', width: 90 },
 
         { title: '重量', dataIndex: 'weight', width: 90 },
@@ -1947,7 +1947,7 @@ export default {
         { title: '实际出库数量', dataIndex: 'actualQuantityInStorage', width: 115 },
         { title: '出库差异', dataIndex: 'warehousingVariance', width: 90 },
         { title: '出库差异原因', dataIndex: 'reasonOfDifference', width: 115 },
-        { title: '出库人', dataIndex: 'warehousingUser', width: 90 },
+        { title: '出库人', dataIndex: 'warehousingUserName', width: 90 },
         { title: '出库时间', dataIndex: 'warehousingTime', width: 90 },
 
         { title: '重量', dataIndex: 'weight', width: 90 },

+ 94 - 120
jshERP-web/src/views/bill/mixins/BillModalMixin.js

@@ -474,34 +474,19 @@ export const BillModalMixin = {
       //   })
       // }
     },
-    //根据【仓库名】带出对应的【仓位货架】
+    //根据仓库名、商品条码带出对应的仓位货架、库存数量
     async setProPosition(barCode, depotId, event){
       const { row, column, value, target } = event
-      const res = await getMaterialBySelect({
-        q: barCode,
-        page: 1,
-        rows: 20
+      findStockByDepotAndBarCode({ depotId: depotId, barCode: barCode }).then(res => {
+        const {position,stock} = res.data
+        target.setValues([
+          {
+            rowKey: row.id,
+            values: { position,inventory: stock },
+          },
+        ])
+        target.$forceUpdate()
       })
-      let proDetail
-      if (res && res.rows) {
-        proDetail = res.rows[0]? res.rows[0] : {}
-      }
-      // 商品id
-      if(proDetail.mid){
-        const res2 = await getAction('/material/getPositionByDidAndMid', { mid: proDetail.mid, did: depotId })
-        console.log('getPositionByDidAndMid======',res2)
-        if (res2 && res2.code === 200) {
-          const msg = res2.msg
-          if(msg){
-            target.setValues([
-              {
-                rowKey: row.id,
-                values: { position: msg },
-              },
-            ])
-          }
-        }
-      }
     },
     //单元值改变一个字符就触发一次
     onValueChange(event) {
@@ -511,98 +496,95 @@ export const BillModalMixin = {
       switch (column.key) {
         case 'depotId':
           that.currentSelectDepotId = row.depotId
-          if (row.barCode) {
-            that.getStockByDepotBarCode(row, target)
-          }
           console.log('row========', row)
           // // 选择商品自动带出barCode、商品ID
-          if(row.depotId&&row.barCode){
+          if(row.depotId&&row.barCode&&type=='select'){
             // // 根据仓库id自动带出仓位货架(若有)参数:商品id、仓库id
             this.setProPosition(row.barCode, row.depotId, event)
           }
           break
-        case 'batchNumber':
-          param = {
-            batchNumber: value,
-            organId: this.form.getFieldValue('organId'),
-            mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
-            prefixNo: this.prefixNo,
-          }
-          getMaterialByBatchNumber(param).then((res) => {
-            if (res && res.code === 200) {
-              let mList = res.data
+        // case 'batchNumber':
+        //   param = {
+        //     batchNumber: value,
+        //     organId: this.form.getFieldValue('organId'),
+        //     mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
+        //     prefixNo: this.prefixNo,
+        //   }
+        //   getMaterialByBatchNumber(param).then((res) => {
+        //     if (res && res.code === 200) {
+        //       let mList = res.data
 
-              if (value.indexOf(',') > -1) {
-                //多个条码
-                this.$refs.materialDataTable.getValues((error, values) => {
-                  values.pop() //移除最后一行数据
-                  let mArr = values
-                  for (let i = 0; i < mList.length; i++) {
-                    let mInfo = mList[i]
-                    if (mInfo.unitId) {
-                      mInfo.unitList = JSON.stringify(mInfo.unitList)
-                    }
-                    this.changeColumnShow(mInfo)
-                    let mObj = this.parseInfoToObj(mInfo)
-                    mObj.depotId = mInfo.depotId
-                    mObj.stock = mInfo.stock
-                    mObj.inventory = mInfo.inventory
-                    mArr.push(mObj)
-                  }
-                  let allPriceTotal = 0
-                  let taxLastMoneyTotal = 0
-                  for (let j = 0; j < mArr.length; j++) {
-                    allPriceTotal += mArr[j].allPrice - 0
-                    taxLastMoneyTotal += mArr[j].taxLastMoney - 0
-                    //组合和拆分单据给商品类型进行重新赋值
-                    if (j === 0) {
-                      mArr[0].mType = '组合件'
-                    } else {
-                      mArr[j].mType = '普通子件'
-                    }
-                  }
+        //       if (value.indexOf(',') > -1) {
+        //         //多个条码
+        //         this.$refs.materialDataTable.getValues((error, values) => {
+        //           values.pop() //移除最后一行数据
+        //           let mArr = values
+        //           for (let i = 0; i < mList.length; i++) {
+        //             let mInfo = mList[i]
+        //             if (mInfo.unitId) {
+        //               mInfo.unitList = JSON.stringify(mInfo.unitList)
+        //             }
+        //             this.changeColumnShow(mInfo)
+        //             let mObj = this.parseInfoToObj(mInfo)
+        //             mObj.depotId = mInfo.depotId
+        //             mObj.stock = mInfo.stock
+        //             mObj.inventory = mInfo.inventory
+        //             mArr.push(mObj)
+        //           }
+        //           let allPriceTotal = 0
+        //           let taxLastMoneyTotal = 0
+        //           for (let j = 0; j < mArr.length; j++) {
+        //             allPriceTotal += mArr[j].allPrice - 0
+        //             taxLastMoneyTotal += mArr[j].taxLastMoney - 0
+        //             //组合和拆分单据给商品类型进行重新赋值
+        //             if (j === 0) {
+        //               mArr[0].mType = '组合件'
+        //             } else {
+        //               mArr[j].mType = '普通子件'
+        //             }
+        //           }
 
-                  this.materialTable.dataSource = mArr
-                  if (this.prefixNo === 'LSCK' || this.prefixNo === 'LSTH') {
-                    target.statisticsColumns.allPrice = allPriceTotal
-                  } else {
-                    target.statisticsColumns.taxLastMoney = taxLastMoneyTotal
-                  }
-                  that.autoChangePrice(target)
-                  //强制渲染
-                  target.$forceUpdate()
-                })
-              } else {
-                //单个条码
-                let depotIdSelected = row.depotId || ''
-                findStockByDepotAndBarCode({ depotId: depotIdSelected, barCode: row.batchNumber }).then((res) => {
-                  if (res && res.code === 200) {
-                    let mArr = []
-                    let mInfo = mList[0]
-                    if (mInfo.unitId) {
-                      mInfo.unitList = JSON.stringify(mInfo.unitList)
-                    }
-                    this.changeColumnShow(mInfo)
-                    let mInfoEx = this.parseInfoToObj(mInfo)
-                    mInfoEx.stock = res.data.stock
-                    mInfoEx.inventory = mInfo.inventory
-                    let mObj = {
-                      rowKey: row.id,
-                      values: mInfoEx,
-                    }
-                    mArr.push(mObj)
-                    target.setValues(mArr)
-                    target.recalcAllStatisticsColumns()
-                    that.autoChangePrice(target)
-                    target.autoSelectBySpecialKey('operNumber', row.orderNum)
-                    //强制渲染
-                    target.$forceUpdate()
-                  }
-                })
-              }
-            }
-          })
-          break
+        //           this.materialTable.dataSource = mArr
+        //           if (this.prefixNo === 'LSCK' || this.prefixNo === 'LSTH') {
+        //             target.statisticsColumns.allPrice = allPriceTotal
+        //           } else {
+        //             target.statisticsColumns.taxLastMoney = taxLastMoneyTotal
+        //           }
+        //           that.autoChangePrice(target)
+        //           //强制渲染
+        //           target.$forceUpdate()
+        //         })
+        //       } else {
+        //         //单个条码
+        //         let depotIdSelected = row.depotId || ''
+        //         // findStockByDepotAndBarCode({ depotId: depotIdSelected, barCode: row.batchNumber }).then((res) => {
+        //         //   if (res && res.code === 200) {
+        //         //     let mArr = []
+        //         //     let mInfo = mList[0]
+        //         //     if (mInfo.unitId) {
+        //         //       mInfo.unitList = JSON.stringify(mInfo.unitList)
+        //         //     }
+        //         //     this.changeColumnShow(mInfo)
+        //         //     let mInfoEx = this.parseInfoToObj(mInfo)
+        //         //     mInfoEx.stock = res.data.stock
+        //         //     mInfoEx.inventory = mInfo.inventory
+        //         //     let mObj = {
+        //         //       rowKey: row.id,
+        //         //       values: mInfoEx,
+        //         //     }
+        //         //     mArr.push(mObj)
+        //         //     target.setValues(mArr)
+        //         //     target.recalcAllStatisticsColumns()
+        //         //     that.autoChangePrice(target)
+        //         //     target.autoSelectBySpecialKey('operNumber', row.orderNum)
+        //         //     //强制渲染
+        //         //     target.$forceUpdate()
+        //         //   }
+        //         // })
+        //       }
+        //     }
+        //   })
+        //   break
         case 'barCode':
           param = {
             barCode: value,
@@ -629,8 +611,9 @@ export const BillModalMixin = {
                   mObj.depotId = mInfo.depotId
                   mObj.stock = mInfo.stock
                   mObj.inventory = mInfo.inventory
-                  mObj.allPrice = mInfo.allPrice||0
-                  mObj.taxLastMoney = mInfo.taxLastMoney||0
+                  const unitPrice = (mObj.unitPrice||0)- 0
+                  mObj.allPrice = (unitPrice * mObj.operNumber).toFixed(2)
+                  // mObj.taxLastMoney = mInfo.taxLastMoney||0
                   mArr.push(mObj)
                 }
                 let allPriceTotal = 0
@@ -908,15 +891,6 @@ export const BillModalMixin = {
       target.recalcAllStatisticsColumns()
       this.autoChangePrice(target)
     },
-    //根据仓库和条码查询库存
-    getStockByDepotBarCode(row, target) {
-      findStockByDepotAndBarCode({ depotId: row.depotId, barCode: row.batchNumber }).then((res) => {
-        if (res && res.code === 200) {
-          target.setValues([{ rowKey: row.id, values: { stock: res.data.stock } }])
-          target.recalcAllStatisticsColumns()
-        }
-      })
-    },
     //改变优惠、本次付款、欠款的值
     autoChangePrice(target) {
       let allTaxLastMoney = target.statisticsColumns.taxLastMoney - 0

+ 1 - 1
jshERP-web/src/views/bill/modules/PurchaseInModal.vue

@@ -623,7 +623,7 @@ export default {
         }
         this.model.debt = (
           this.model.discountLastMoney +
-          this.model.otherMoney -
+          (this.model.otherMoney||0)-
           this.model.deposit -
           this.model.changeAmount
         ).toFixed(2)

+ 8 - 0
jshERP-web/src/views/material/modules/MaterialModal.vue

@@ -342,6 +342,9 @@
                 bordered
                 @change="handleMeTableChange"
               >
+                <template slot="supplierId" slot-scope="text, record">
+                  {{ formatSupplierName(record.supplierId) }}
+                </template>
                 <template slot="depotId" slot-scope="text, record">
                   {{ formatDepotName(record.depotId) }}
                 </template>
@@ -593,6 +596,7 @@ export default {
           {
             title: '供应商',
             dataIndex: 'supplierId',
+            scopedSlots: { customRender: 'supplierId' } 
           },
           {
             title: '库存(最小单位)',
@@ -735,6 +739,10 @@ export default {
       const target = this.depotList.find(item => item.value == id)
       return target ? target.title : ''
     },
+    formatSupplierName(id){
+      const target = this.supList.find(item => item.id == id)
+      return target ? target.supplier : ''
+    },
     // 快捷键
     handleOkKey(e) {
       const key = window.event.keyCode ? window.event.keyCode : window.event.which

+ 2 - 0
jshERP-web/src/views/stock/components/stockModal.vue

@@ -199,6 +199,7 @@ export default {
           positionRange,
           creator,
           id,
+          number
         } = res.data
         form.setFieldsValue({
           depotId,
@@ -211,6 +212,7 @@ export default {
           positionRange,
           creator,
           id,
+          number
         })
 
         postAction(url2, { taskStocktakingId: id }).then((res) => {