Browse Source

采购入库

15102826049 3 days ago
parent
commit
128b2add7c

+ 4 - 0
jshERP-web/src/api/api.js

@@ -99,6 +99,9 @@ const updateBtnStrByRoleId = (params) => postAction('/userBusiness/updateBtnStr'
 const addUnit = (params) => postAction('/unit/add', params)
 const editUnit = (params) => putAction('/unit/update', params)
 const checkUnit = (params) => getAction('/unit/checkIsNameExist', params)
+// 根据id获取信息
+const getUnitInfo = (params) => getAction('/unit/info', params)
+
 //供应商|客户|会员
 const addSupplier = (params) => postAction('/supplier/add', params)
 const editSupplier = (params) => putAction('/supplier/update', params)
@@ -208,4 +211,5 @@ export {
   getBatchNumberList,
   findFinancialDetailByNumber,
   getMaterialById,
+  getUnitInfo,
 }

+ 6 - 0
jshERP-web/src/components/jeecg/JEditableTable.vue

@@ -252,6 +252,7 @@
                             @change="(v) => handleChangeSelectCommon(v, id, row, col)"
                             @search="(v) => handleSearchSelect(v, id, row, col)"
                             @blur="(v) => handleBlurSearch(v, id, row, col)"
+                            @focus="(v) => handleFocusSearch(v, id, row, col)"
                             allowClear
                           >
                             <div slot="dropdownRender" slot-scope="menu">
@@ -2343,6 +2344,11 @@ export default {
         }
       }
     },
+    //获取焦点
+    handleFocusSearch(value, id, row, col) {
+      this.validateOneInput(value, row, col, this.notPassedIds, true, 'focus')
+      this.elemValueChange('unit', row, col, value)
+    },
     // blur 失去焦点
     handleBlurSearch(value, id, row, col) {
       if (col.allowInput === true) {

+ 42 - 7
jshERP-web/src/components/jeecg/JImageUpload.vue

@@ -82,14 +82,27 @@ export default {
       required: false,
       default: false,
     },
+    returnUrl: {
+      type: Boolean,
+      required: false,
+      default: true,
+    },
   },
   watch: {
-    value(val) {
-      if (val instanceof Array) {
-        this.initFileList(val.join(','))
-      } else {
-        this.initFileList(val)
-      }
+    value: {
+      immediate: true,
+      handler() {
+        let val = this.value
+        if (val instanceof Array) {
+          if (this.returnUrl) {
+            this.initFileList(val.join(','))
+          } else {
+            this.initFileListArr(val)
+          }
+        } else {
+          this.initFileList(val)
+        }
+      },
     },
   },
   created() {
@@ -105,6 +118,27 @@ export default {
         }
       })
     },
+    initFileListArr(val) {
+      if (!val || val.length == 0) {
+        this.fileList = []
+        return
+      }
+      let fileList = []
+      for (var a = 0; a < val.length; a++) {
+        let url = getFileAccessHttpUrl(val[a].filePath)
+        fileList.push({
+          uid: uidGenerator(),
+          name: val[a].fileName,
+          status: 'done',
+          url: url,
+          response: {
+            code: 'history',
+            data: val[a].filePath,
+          },
+        })
+      }
+      this.fileList = fileList
+    },
     initFileList(paths) {
       if (!paths || paths.length == 0) {
         this.fileList = []
@@ -115,7 +149,7 @@ export default {
       let fileList = []
       let arr = paths.split(',')
       for (var a = 0; a < arr.length; a++) {
-        let url = getFileAccessHttpUrl('systemConfig/static/' + arr[a])
+        let url = getFileAccessHttpUrl('' + arr[a])
         fileList.push({
           uid: uidGenerator(),
           name: getFileName(arr[a]),
@@ -128,6 +162,7 @@ export default {
         })
       }
       this.fileList = fileList
+      console.log('------------------21312', this.fileList)
     },
     beforeUpload: function (file) {
       this.uploadGoOn = true

+ 0 - 2
jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal.vue

@@ -280,8 +280,6 @@ export default {
       let params = this.getQueryParams() //查询条件
       getMaterialBySelect(params).then((res) => {
         if (res) {
-          console.log('----------------------', res.rows)
-
           this.dataSource = res.rows
           this.ipagination.total = res.total
           if (res.total === 1) {

+ 1 - 1
jshERP-web/src/views/bill/PurchaseInList.vue

@@ -1,7 +1,7 @@
 <template>
   <a-row :gutter="24">
     <a-col :md="24">
-      <a-card :style="cardStyle" :bordered="false">
+      <a-card :bordered="false">
         <!-- 查询区域 -->
         <div class="table-page-search-wrapper">
           <!-- 搜索区域 -->

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

@@ -1609,18 +1609,16 @@ export default {
         { title: '备注', dataIndex: 'remark' },
       ],
       purchaseInColumns: [
-        { title: '仓库名称', dataIndex: 'depotName', width: 90 },
-        { title: '条码', dataIndex: 'barCode', width: 90 },
+        { title: '批次号', dataIndex: 'batchNumber', width: 90 },
         { title: '名称', dataIndex: 'name', width: 90 },
         { title: '规格', dataIndex: 'standard', width: 90 },
 
-        { title: '生产日期', dataIndex: 'standard', width: 100 },
-        { title: '保质期', dataIndex: 'standard', width: 60 },
-        { title: '商品条码', dataIndex: 'standard', width: 90 },
-        { title: '批次号', dataIndex: 'standard', width: 90 },
-        { title: '仓库名', dataIndex: 'standard', width: 90 },
-        { title: '仓库货架', dataIndex: 'standard', width: 90 },
-        { title: '包装规格', dataIndex: 'standard', width: 90 },
+        { title: '生产日期', dataIndex: 'productionDate', width: 100 },
+        { title: '保质期', dataIndex: 'expiryNum', width: 60 },
+        { title: '商品条码', dataIndex: 'barCode', width: 90 },
+        { title: '仓库名称', dataIndex: 'depotName', width: 90 },
+        { title: '仓库货架', dataIndex: 'position', width: 90 },
+        { title: '包装规格', dataIndex: 'unitName', width: 90 },
 
         { title: '型号', dataIndex: 'model', width: 60 },
         { title: '颜色', dataIndex: 'color', width: 60 },
@@ -1630,7 +1628,6 @@ export default {
         { title: '库存', dataIndex: 'stock', width: 90 },
         { title: '单位', dataIndex: 'unit', width: 90 },
         { title: '序列号', dataIndex: 'snList', width: 300 },
-        { title: '批号', dataIndex: 'batchNumber', width: 90 },
         { title: '有效期', dataIndex: 'expirationDate', width: 90 },
         { title: '多属性', dataIndex: 'sku', width: 90 },
         { title: '数量', dataIndex: 'operNumber', width: 90 },
@@ -1641,11 +1638,11 @@ export default {
         { title: '税额', dataIndex: 'taxMoney', width: 90 },
         { title: '价税合计', dataIndex: 'taxLastMoney', width: 90 },
 
-        { title: '实际出库数量', dataIndex: 'taxLastMoney', width: 115 },
-        { title: '出库差异', dataIndex: 'taxLastMoney', width: 90 },
-        { title: '出库差异原因', dataIndex: 'taxLastMoney', width: 115 },
-        { title: '出库人', dataIndex: 'taxLastMoney', width: 90 },
-        { title: '出库时间', dataIndex: 'taxLastMoney', width: 90 },
+        { title: '实际入库数量', dataIndex: 'actualQuantityInStorage', width: 115 },
+        { title: '入库差异', dataIndex: 'warehousingVariance', width: 90 },
+        { title: '入库差异原因', dataIndex: 'reasonOfDifference', width: 115 },
+        { title: '入库人', dataIndex: 'warehousingUser', width: 90 },
+        { title: '入库时间', dataIndex: 'warehousingTime', width: 90 },
 
         { title: '重量', dataIndex: 'weight', width: 90 },
         { title: '仓位货架', dataIndex: 'position', width: 90 },

+ 1 - 1
jshERP-web/src/views/bill/mixins/BillListMixin.js

@@ -83,7 +83,7 @@ export const BillListMixin = {
       this.$refs.modalForm.disableSubmit = false
       //开启明细的编辑模式
       this.$refs.modalForm.rowCanEdit = true
-      let columnIndex = record.subType === '组装单' || record.subType === '拆卸单' ? 2 : 1
+      let columnIndex = record.subType === '组装单' || record.subType === '拆卸单' ? 2 : 0
       this.$refs.modalForm.materialTable.columns[columnIndex].type = FormTypes.popupJsh
     },
     myHandleEdit(record) {

+ 18 - 4
jshERP-web/src/views/bill/mixins/BillModalMixin.js

@@ -10,6 +10,7 @@ import {
   getMaterialByBatchNumber,
   getPersonByNumType,
   getPlatformConfigByKey,
+  getUnitInfo,
 } from '@/api/api'
 import { getAction } from '@/api/manage'
 import { getCheckFlag, getMpListShort, getNowFormatDateTime } from '@/utils/util'
@@ -344,8 +345,6 @@ export const BillModalMixin = {
       this.$refs.memberModalForm.disableSubmit = false
     },
     handleBatchSetDepot() {
-      console.log('11111111111111111111')
-
       this.$refs.batchSetDepotModalForm.add()
       this.$refs.batchSetDepotModalForm.title = '批量切换仓库'
       this.$refs.batchSetDepotModalForm.disableSubmit = false
@@ -456,6 +455,7 @@ export const BillModalMixin = {
         })
       }
     },
+
     //单元值改变一个字符就触发一次
     onValueChange(event) {
       let that = this
@@ -503,6 +503,7 @@ export const BillModalMixin = {
                       mArr[j].mType = '普通子件'
                     }
                   }
+
                   this.materialTable.dataSource = mArr
                   if (this.prefixNo === 'LSCK' || this.prefixNo === 'LSTH') {
                     target.statisticsColumns.allPrice = allPriceTotal
@@ -676,6 +677,11 @@ export const BillModalMixin = {
           target.recalcAllStatisticsColumns()
           that.autoChangePrice(target)
           break
+        case 'unit':
+          if (!row.unitId) return
+          getUnitInfo({ id: row.unitId }).then((res) => {
+            console.log('----------------sdsafds', res)
+          })
       }
     },
     //转为商品对象
@@ -698,6 +704,16 @@ export const BillModalMixin = {
         taxRate: 0,
         taxMoney: 0,
         taxLastMoney: mInfo.billPrice,
+
+        productionDate: mInfo.productionDate,
+        expiryNum: mInfo.expiryNum,
+        position: mInfo.position,
+        unitName: mInfo.unitName,
+        actualQuantityInStorage: mInfo.actualQuantityInStorage,
+        warehousingVariance: mInfo.warehousingVariance,
+        warehousingUser: mInfo.warehousingUser,
+        warehousingTime: mInfo.warehousingTime,
+        unitId: mInfo.unitId,
       }
     },
     //使得型号、颜色、扩展信息、sku等为隐藏
@@ -889,8 +905,6 @@ export const BillModalMixin = {
               batchNumberStr += detail.batchNumber + ','
             }
           }
-          console.log('=================', batchNumberStr)
-
           if (batchNumberStr) {
             let param = {
               batchNumber: batchNumberStr,

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

@@ -265,7 +265,7 @@ export default {
           { title: '生产日期', key: 'productionDate', width: '9%', type: FormTypes.normal },
           { title: '保质期', key: 'expiryNum', width: '6%', type: FormTypes.normal },
           { title: '商品条码', key: 'barCode', width: '9%', type: FormTypes.normal },
-          { title: '仓库名', key: 'depotName', width: '9%', type: FormTypes.normal },
+          { title: '仓库名', key: 'depotId', width: '9%', type: FormTypes.normal },
           { title: '仓库货架', key: 'position', width: '9%', type: FormTypes.normal },
           { title: '包装规格', key: 'unitName', width: '9%', type: FormTypes.input },
 
@@ -277,7 +277,6 @@ export default {
           { title: '库存', key: 'stock', width: '5%', type: FormTypes.normal },
           { title: '单位', key: 'unit', width: '4%', type: FormTypes.select },
           { title: '序列号', key: 'snList', width: '12%', type: FormTypes.popupJsh, kind: 'snAdd', multi: true },
-          { title: '批号', key: 'batchNumber', width: '7%', type: FormTypes.input },
           { title: '有效期', key: 'expirationDate', width: '7%', type: FormTypes.date },
           { title: '多属性', key: 'sku', width: '9%', type: FormTypes.normal },
           { title: '原数量', key: 'preNumber', width: '4%', type: FormTypes.normal },

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

@@ -430,7 +430,7 @@ export default {
           {
             title: '批次号',
             key: 'batchNumber',
-            width: '9%',
+            width: '12%',
             type: FormTypes.popupJsh,
             kind: 'material',
             multi: true,
@@ -441,10 +441,10 @@ export default {
           { title: '名称', key: 'name', width: '7%', type: FormTypes.normal },
           { title: '规格', key: 'standard', width: '6%', type: FormTypes.normal },
 
-          { title: '生产日期', key: 'productionDate', width: '9%', type: FormTypes.datetime, disabled: true },
+          { title: '生产日期', key: 'productionDate', width: '9%', type: FormTypes.normal, disabled: true },
           { title: '保质期', key: 'expiryNum', width: '6%', type: FormTypes.normal },
           { title: '商品条码', key: 'barCode', width: '6%', type: FormTypes.normal },
-          { title: '仓库名', key: 'depotName', width: '6%', type: FormTypes.normal },
+          { title: '仓库名', key: 'depotId', width: '6%', type: FormTypes.select, disabled: true },
           { title: '仓库货架', key: 'position', width: '6%', type: FormTypes.normal },
           { title: '包装规格', key: 'unitName', width: '6%', type: FormTypes.input },
 
@@ -455,6 +455,7 @@ export default {
           { title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
           { title: '库存', key: 'stock', width: '5%', type: FormTypes.normal },
           { title: '单位', key: 'unit', width: '4%', type: FormTypes.select, options: [] },
+          { title: '单位id', key: 'unitId', width: '4%', type: FormTypes.hidden },
           { title: '序列号', key: 'snList', width: '12%', type: FormTypes.popupJsh, kind: 'snAdd', multi: true },
           { title: '有效期', key: 'expirationDate', width: '7%', type: FormTypes.date },
           { title: '多属性', key: 'sku', width: '9%', type: FormTypes.normal },
@@ -553,7 +554,7 @@ export default {
       } else {
         if (this.model.linkNumber) {
           this.rowCanEdit = false
-          this.materialTable.columns[1].type = FormTypes.normal
+          this.materialTable.columns[0].type = FormTypes.normal
         }
         this.model.operTime = this.model.operTimeStr
         if (this.model.deposit) {
@@ -653,6 +654,7 @@ export default {
         billMain.id = this.model.id
       }
       billMain.status = this.billStatus
+
       return {
         info: JSON.stringify(billMain),
         rows: JSON.stringify(detailArr),
@@ -691,6 +693,7 @@ export default {
           this.changeColumnShow(info)
         }
         this.materialTable.dataSource = listEx
+
         ///给优惠后金额重新赋值
         allTaxLastMoney = allTaxLastMoney ? allTaxLastMoney : 0
         let discount = 0

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

@@ -478,7 +478,6 @@ export default {
           { title: '库存', key: 'stock', width: '5%', type: FormTypes.normal },
           { title: '单位', key: 'unit', width: '4%', type: FormTypes.normal },
           { title: '序列号', key: 'snList', width: '12%', type: FormTypes.popupJsh, kind: 'sn', multi: true },
-          { title: '批号', key: 'batchNumber', width: '7%', type: FormTypes.popupJsh, kind: 'batch', multi: false },
           { title: '有效期', key: 'expirationDate', width: '7%', type: FormTypes.input, readonly: true },
           { title: '多属性', key: 'sku', width: '9%', type: FormTypes.normal },
           { title: '原数量', key: 'preNumber', width: '4%', type: FormTypes.normal },
@@ -486,7 +485,7 @@ export default {
           {
             title: '出库数量',
             key: 'operNumber',
-            width: '4%',
+            width: '5%',
             type: FormTypes.inputNumber,
             statistics: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],