Browse Source

Merge remote-tracking branch 'origin/xq'

13660505945 1 day ago
parent
commit
216c6b1675

+ 1 - 1
jshERP-web/src/api/api.js

@@ -100,7 +100,7 @@ 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 getUnitInfo = (params) => getAction('/unit/getUnitListByID', params)
 
 //供应商|客户|会员
 const addSupplier = (params) => postAction('/supplier/add', params)

+ 35 - 4
jshERP-web/src/components/jeecg/JEditableTable.vue

@@ -253,16 +253,15 @@
                             @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">
                               <v-nodes :vnodes="menu" />
                               <slot name="depotAdd" v-if="col.key === 'depotId'" :target="getVM()" />
                               <slot name="inOutItemAdd" v-if="col.key === 'inOutItemId'" :target="getVM()" />
                             </div>
-                            <!--<template v-for="(opt,optKey) in col.options">-->
-                            <!--<a-select-option :value="opt.value" :key="optKey">{{ opt.title }}</a-select-option>-->
-                            <!--</template>-->
+                            <!-- <template v-for="(opt, optKey) in col.options">
+                              <a-select-option :value="opt.value" :key="optKey">{{ opt.title }}</a-select-option>
+                            </template> -->
                           </a-select>
                         </span>
                       </a-tooltip>
@@ -878,6 +877,7 @@
                             :allValues="_getAllValuesForSlot()"
                             :target="getVM()"
                             :handleChange="(v) => handleChangeSlotCommon(v, id, row, col)"
+                            :handleFocus="(v) => handleFocusSlotCommon(v, id, row, col)"
                             :isNotPass="notPassedIds.includes(col.key + row.id)"
                           />
                         </span>
@@ -945,11 +945,13 @@ import { getFileAccessHttpUrl } from '@/api/manage'
 import JInputPop from '@/components/jeecg/minipop/JInputPop'
 import JFilePop from '@/components/jeecg/minipop/JFilePop'
 import JSelectList from '@/components/jeecgbiz/JSelectList'
+import { BillModalMixin } from '../../../src/views/bill/mixins/BillModalMixin'
 
 // 行高,需要在实例加载完成前用到
 let rowHeight = 42
 
 export default {
+  mixins: [BillModalMixin],
   name: 'JEditableTable',
   components: {
     JDate,
@@ -2509,6 +2511,35 @@ export default {
       // 触发valueChange 事件
       this.elemValueChange(FormTypes.slot, row, column, value)
     },
+    handleFocusSlotCommon(value, id, row, column) {
+      // this.slotValues = this.bindValuesChange(value, id, 'slotValues')
+      // // 做单个表单验证
+      this.validateOneInput(value, row, column, this.notPassedIds, true, 'focus')
+      // // 触发valueChange 事件
+      this.elemFocusChange(FormTypes.slot, row, column, value)
+    },
+    //获取焦点时触发
+    elemFocusChange(type, rowSource, columnSource, value) {
+      let unitList = []
+      let column = Object.assign({}, columnSource)
+      // 将caseId去除
+      let row = Object.assign({}, rowSource)
+      row.id = this.getCleanId(row.id)
+      // 获取整行的数据
+      let { values } = this.getValuesSync({ validate: false, rowIds: [row.id] })
+      if (values.length > 0) {
+        Object.assign(row, values[0])
+      }
+      if (!row.unitId) {
+        unitList = []
+      }
+      let arr = row.unitList
+      if (arr && !Array.isArray(arr)) {
+        unitList = JSON.parse(arr)
+      }
+      column.options = unitList
+      this.$emit('focusChange', unitList)
+    },
     handleBlurCommono(target, index, row, column) {
       let { value, dataset } = target
       if (dataset && `${dataset.inputNumber}` === 'true') {

+ 1 - 1
jshERP-web/src/views/bill/OtherInList.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">
           <!-- 搜索区域 -->

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

@@ -1610,7 +1610,7 @@ export default {
       ],
       purchaseInColumns: [
         { title: '批次号', dataIndex: 'batchNumber', width: 90 },
-        { title: '名称', dataIndex: 'name', width: 90 },
+        { title: '名称', dataIndex: 'name', width: 115 },
         { title: '规格', dataIndex: 'standard', width: 90 },
 
         { title: '生产日期', dataIndex: 'productionDate', width: 100 },
@@ -1751,27 +1751,39 @@ export default {
         { title: '备注', dataIndex: 'remark' },
       ],
       otherInColumns: [
-        { title: '仓库名称', dataIndex: 'depotName' },
-        { title: '条码', dataIndex: 'barCode' },
-        { title: '名称', dataIndex: 'name' },
-        { title: '规格', dataIndex: 'standard' },
-        { title: '型号', dataIndex: 'model' },
-        { title: '颜色', dataIndex: 'color' },
-        { title: '品牌', dataIndex: 'brand' },
-        { title: '制造商', dataIndex: 'mfrs' },
-        { title: '扩展信息', dataIndex: 'materialOther' },
-        { title: '库存', dataIndex: 'stock' },
-        { title: '单位', dataIndex: 'unit' },
+        { title: '批次号', dataIndex: 'batchNumber', width: 90 },
+        { title: '名称', dataIndex: 'name', width: 115 },
+        { 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 },
+        { title: '品牌', dataIndex: 'brand', width: 90 },
+        { title: '制造商', dataIndex: 'mfrs', width: 90 },
+        { title: '扩展信息', dataIndex: 'materialOther', width: 90 },
+        { title: '库存', dataIndex: 'stock', width: 90 },
+        { title: '单位', dataIndex: 'unit', width: 90 },
         { title: '序列号', dataIndex: 'snList', width: 300 },
-        { title: '批号', dataIndex: 'batchNumber' },
-        { title: '有效期', dataIndex: 'expirationDate' },
-        { title: '多属性', dataIndex: 'sku' },
-        { title: '数量', dataIndex: 'operNumber' },
-        { title: '单价', dataIndex: 'unitPrice' },
-        { title: '金额', dataIndex: 'allPrice' },
-        { title: '重量', dataIndex: 'weight' },
-        { title: '仓位货架', dataIndex: 'position' },
-        { title: '备注', dataIndex: 'remark' },
+        { title: '有效期', dataIndex: 'expirationDate', width: 90 },
+        { title: '多属性', dataIndex: 'sku', width: 90 },
+        { title: '数量', dataIndex: 'operNumber', width: 90 },
+        { title: '单价', dataIndex: 'unitPrice', width: 90 },
+        { title: '金额', dataIndex: 'allPrice', 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 },
       ],
       otherOutColumns: [
         { title: '仓库名称', dataIndex: 'depotName' },

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

@@ -25,6 +25,7 @@ export const BillModalMixin = {
       supList: [],
       cusList: [],
       retailList: [],
+      // unitList: [],
       personList: {
         options: [],
         value: '',
@@ -151,6 +152,10 @@ export const BillModalMixin = {
             for (let i = 0; i < tab.dataSource.length; i++) {
               let info = tab.dataSource[i]
               info.isEdit = this.model.id ? 1 : 0
+              if (info.unitId) {
+                info.unitList = JSON.stringify(info.unitList)
+              }
+
               this.changeColumnShow(info)
             }
             typeof success === 'function' ? success(res) : ''
@@ -160,6 +165,7 @@ export const BillModalMixin = {
           tab.loading = false
         })
     },
+
     //改变字段的状态,1-显示 0-隐藏
     changeFormTypes(columns, key, type) {
       for (let i = 0; i < columns.length; i++) {
@@ -485,6 +491,9 @@ export const BillModalMixin = {
                   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
@@ -521,6 +530,9 @@ export const BillModalMixin = {
                   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
@@ -678,10 +690,20 @@ export const BillModalMixin = {
           that.autoChangePrice(target)
           break
         case 'unit':
-          if (!row.unitId) return
-          getUnitInfo({ id: row.unitId }).then((res) => {
-            console.log('----------------sdsafds', res)
-          })
+          // row.actualQuantityInStorage=
+          if (row.unitId) {
+            let arr = row.unitList
+            if (!Array.isArray(arr)) {
+              arr = JSON.parse(arr)
+            }
+            for (let i of arr) {
+              if (i.name === value) {
+                target.setValues([{ rowKey: row.id, values: { actualQuantityInStorage: i.ratio } }])
+              }
+            }
+          }
+
+          target.$forceUpdate()
       }
     },
     //转为商品对象
@@ -714,6 +736,7 @@ export const BillModalMixin = {
         warehousingUser: mInfo.warehousingUser,
         warehousingTime: mInfo.warehousingTime,
         unitId: mInfo.unitId,
+        unitList: mInfo.unitList,
       }
     },
     //使得型号、颜色、扩展信息、sku等为隐藏
@@ -727,6 +750,9 @@ export const BillModalMixin = {
     },
     //使得sku、序列号、批号、到期日等为显示
     changeColumnShow(info) {
+      // if (info.util) {
+      //   this.changeUnitType(this.materialTable.columns, info, 'unit')
+      // }
       if (info.model) {
         this.changeFormTypes(this.materialTable.columns, 'model', 1)
       }

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

@@ -93,6 +93,7 @@
           @valueChange="onValueChange"
           @added="onAdded"
           @deleted="onDeleted"
+          @focusChange="getUnitInfo"
         >
           <template #buttonAfter>
             <a-row
@@ -131,6 +132,23 @@
               <a-icon type="plus" /> 新增仓库
             </div>
           </template>
+          <template #unit="{ handleChange, handleFocus, value }">
+            <a-select
+              placeholder="请选择"
+              v-decorator="['unit']"
+              :dropdownMatchSelectWidth="false"
+              showSearch
+              :allowClear="false"
+              optionFilterProp="children"
+              :value="value"
+              @change="($event) => handleChange($event)"
+              @focus="($event) => handleFocus($event)"
+            >
+              <a-select-option v-for="(item, index) in unitList" :key="index" :value="item.name">
+                {{ item.name }}
+              </a-select-option>
+            </a-select>
+          </template>
         </j-editable-table>
         <a-row class="form-row" :gutter="24">
           <a-col :lg="24" :md="24" :sm="24">
@@ -275,7 +293,17 @@ export default {
           { title: '制造商', key: 'mfrs', width: '6%', type: FormTypes.normal },
           { title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
           { title: '库存', key: 'stock', width: '5%', type: FormTypes.normal },
-          { title: '单位', key: 'unit', width: '4%', type: FormTypes.select },
+          {
+            title: '单位',
+            key: 'unit',
+            width: '4%',
+            type: FormTypes.slot,
+            options: [],
+            allowClear: false,
+            slotName: 'unit',
+          },
+          { title: '单位id', key: 'unitId', width: '4%', type: FormTypes.hidden },
+          { title: '单位列表', key: 'unitList', width: '5%', 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 },
@@ -326,6 +354,7 @@ export default {
         edit: '/depotHead/updateDepotHeadAndDetail',
         detailList: '/depotItem/getDetailList',
       },
+      unitList: [],
     }
   },
   created() {},
@@ -455,6 +484,9 @@ export default {
         })
       }
     },
+    getUnitInfo(val) {
+      this.unitList = val
+    },
   },
 }
 </script>

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

@@ -111,6 +111,7 @@
           @valueChange="onValueChange"
           @added="onAdded"
           @deleted="onDeleted"
+          @focusChange="getUnitInfo"
         >
           <template #buttonAfter>
             <a-row
@@ -156,6 +157,23 @@
               <a-icon type="plus" /> 新增仓库
             </div>
           </template>
+          <template #unit="{ handleChange, handleFocus, value }">
+            <a-select
+              placeholder="请选择"
+              v-decorator="['unit']"
+              :dropdownMatchSelectWidth="false"
+              showSearch
+              :allowClear="false"
+              optionFilterProp="children"
+              :value="value"
+              @change="($event) => handleChange($event)"
+              @focus="($event) => handleFocus($event)"
+            >
+              <a-select-option v-for="(item, index) in unitList" :key="index" :value="item.name">
+                {{ item.name }}
+              </a-select-option>
+            </a-select>
+          </template>
         </j-editable-table>
         <a-row class="form-row" :gutter="24">
           <a-col :lg="24" :md="24" :sm="24">
@@ -454,8 +472,17 @@ export default {
           { title: '制造商', key: 'mfrs', width: '6%', type: FormTypes.normal },
           { 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: '单位',
+            key: 'unit',
+            width: '6%',
+            type: FormTypes.slot,
+            options: [],
+            allowClear: false,
+            slotName: 'unit',
+          },
           { title: '单位id', key: 'unitId', width: '4%', type: FormTypes.hidden },
+          { title: '单位列表', key: 'unitList', width: '5%', 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 },
@@ -527,8 +554,10 @@ export default {
         edit: '/depotHead/updateDepotHeadAndDetail',
         detailList: '/depotItem/getDetailList',
       },
+      unitList: [],
     }
   },
+
   created() {},
   methods: {
     //调用完edit()方法之后会自动调用此方法
@@ -631,6 +660,7 @@ export default {
       billMain.subType = '采购'
       for (let item of detailArr) {
         totalPrice += item.allPrice - 0
+        // delete item.unitList
       }
       billMain.totalPrice = 0 - totalPrice
       billMain.changeAmount = 0 - billMain.changeAmount
@@ -654,7 +684,6 @@ export default {
         billMain.id = this.model.id
       }
       billMain.status = this.billStatus
-
       return {
         info: JSON.stringify(billMain),
         rows: JSON.stringify(detailArr),
@@ -727,6 +756,9 @@ export default {
         }
       }
     },
+    getUnitInfo(val) {
+      this.unitList = val
+    },
   },
 }
 </script>

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

@@ -113,6 +113,7 @@
           @valueChange="onValueChange"
           @added="onAdded"
           @deleted="onDeleted"
+          @focusChange="getUnitInfo"
         >
           <template #buttonAfter>
             <a-row
@@ -158,6 +159,23 @@
               <a-icon type="plus" /> 新增仓库
             </div>
           </template>
+          <template #unit="{ handleChange, handleFocus, value }">
+            <a-select
+              placeholder="请选择"
+              v-decorator="['unit']"
+              :dropdownMatchSelectWidth="false"
+              showSearch
+              :allowClear="false"
+              optionFilterProp="children"
+              :value="value"
+              @change="($event) => handleChange($event)"
+              @focus="($event) => handleFocus($event)"
+            >
+              <a-select-option v-for="(item, index) in unitList" :key="index" :value="item.name">
+                {{ item.name }}
+              </a-select-option>
+            </a-select>
+          </template>
         </j-editable-table>
         <a-row class="form-row" :gutter="24">
           <a-col :lg="24" :md="24" :sm="24">
@@ -476,7 +494,17 @@ export default {
           { title: '制造商', key: 'mfrs', width: '6%', type: FormTypes.normal },
           { title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
           { title: '库存', key: 'stock', width: '5%', type: FormTypes.normal },
-          { title: '单位', key: 'unit', width: '4%', type: FormTypes.normal },
+          {
+            title: '单位',
+            key: 'unit',
+            width: '6%',
+            type: FormTypes.slot,
+            options: [],
+            allowClear: false,
+            slotName: 'unit',
+          },
+          { title: '单位id', key: 'unitId', width: '4%', type: FormTypes.hidden },
+          { title: '单位列表', key: 'unitList', width: '5%', type: FormTypes.hidden },
           { title: '序列号', key: 'snList', width: '12%', type: FormTypes.popupJsh, kind: 'sn', multi: true },
           { title: '有效期', key: 'expirationDate', width: '7%', type: FormTypes.input, readonly: true },
           { title: '多属性', key: 'sku', width: '9%', type: FormTypes.normal },
@@ -548,6 +576,7 @@ export default {
         edit: '/depotHead/updateDepotHeadAndDetail',
         detailList: '/depotItem/getDetailList',
       },
+      unitList: [],
     }
   },
   created() {},
@@ -761,6 +790,9 @@ export default {
         }
       }
     },
+    getUnitInfo(val) {
+      this.unitList = val
+    },
   },
 }
 </script>

+ 0 - 1
jshERP-web/src/views/material/mixins/MaterialModalMixins.js

@@ -16,7 +16,6 @@ export const MaterialModalMixins = {
     addVendor() {
       this.$refs.vendorModalForm.add()
       this.$refs.vendorModalForm.title = '新增供应商'
-      console.log('this.$refs.vendorModalForm------------', this.$refs.vendorModalForm)
       this.$refs.vendorModalForm.disableSubmit = false
     },
     addDepot() {

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

@@ -969,6 +969,7 @@ export default {
       getAction(url, params)
         .then((res) => {
           tab.dataSource = res.data || []
+          console.log('====================', res.data)
         })
         .finally(() => {
           tab.loading = false