浏览代码

feat:3期修改

maliang 1 月之前
父节点
当前提交
197713af8c
共有 31 个文件被更改,包括 592 次插入1583 次删除
  1. 4 4
      jshERP-web/src/api/api.js
  2. 22 3
      jshERP-web/src/components/jeecg/JEditableTable.vue
  3. 2 44
      jshERP-web/src/components/jeecgbiz/JSelectList.vue
  4. 24 83
      jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal.vue
  5. 0 524
      jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal2.vue
  6. 7 7
      jshERP-web/src/views/bill/dialog/BillDetail.vue
  7. 10 156
      jshERP-web/src/views/bill/mixins/BillModalMixin.js
  8. 3 3
      jshERP-web/src/views/bill/modules/AllocationOutModal.vue
  9. 2 2
      jshERP-web/src/views/bill/modules/AssembleModal.vue
  10. 2 2
      jshERP-web/src/views/bill/modules/DisassembleModal.vue
  11. 5 5
      jshERP-web/src/views/bill/modules/OtherInModal.vue
  12. 4 27
      jshERP-web/src/views/bill/modules/OtherOutModal.vue
  13. 2 2
      jshERP-web/src/views/bill/modules/PurchaseApplyModal.vue
  14. 1 1
      jshERP-web/src/views/bill/modules/PurchaseBackModal.vue
  15. 5 6
      jshERP-web/src/views/bill/modules/PurchaseInModal.vue
  16. 5 13
      jshERP-web/src/views/bill/modules/PurchaseOrderModal.vue
  17. 2 2
      jshERP-web/src/views/bill/modules/RetailBackModal.vue
  18. 1 1
      jshERP-web/src/views/bill/modules/RetailOutModal.vue
  19. 2 2
      jshERP-web/src/views/bill/modules/SaleBackModal.vue
  20. 8 59
      jshERP-web/src/views/bill/modules/SaleOrderModal.vue
  21. 5 39
      jshERP-web/src/views/bill/modules/SaleOutModal.vue
  22. 7 31
      jshERP-web/src/views/material/MaterialList.vue
  23. 0 16
      jshERP-web/src/views/material/mixins/MaterialModalMixins.js
  24. 1 28
      jshERP-web/src/views/material/modules/BatchSetInfoModal.vue
  25. 210 378
      jshERP-web/src/views/material/modules/MaterialModal.vue
  26. 130 0
      jshERP-web/src/views/material/modules/MaterialUnitModal.vue
  27. 113 0
      jshERP-web/src/views/material/modules/MaterialUpcModal.vue
  28. 1 1
      jshERP-web/src/views/stock/components/stockModal.vue
  29. 2 2
      jshERP-web/src/views/stock/utils/table.js
  30. 1 39
      jshERP-web/src/views/system/UnitList.vue
  31. 11 103
      jshERP-web/src/views/system/modules/UnitModal.vue

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

@@ -60,7 +60,7 @@ const checkMaterial = (params) => getAction('/material/checkIsExist', params)
 const getMaterialBySelect = (params) => getAction('/material/findBySelect', params)
 const getSerialMaterialBySelect = (params) => getAction('/material/getMaterialEnableSerialNumberList', params)
 const getMaterialByParam = (params) => getAction('/material/getMaterialByParam', params)
-const getMaterialByBarCode = (params) => getAction('/material/getMaterialByBarCode', params)
+const getMaterialBySku = (params) => getAction('/material/getMaterialBySku', params)
 const getMaterialByBatchNumber = (params) => getAction('/material/getMaterialByBatchNumber', params)
 const getMaterialById = (params) => getAction('/material/getMaterialById', params)
 
@@ -116,7 +116,7 @@ const findBySelectOrgan = (params) => postAction('/supplier/findBySelect_organ',
 const findBillDetailByNumber = (params) => getAction('/depotHead/getDetailByNumber', params)
 const waitBillCount = (params) => getAction('/depotHead/waitBillCount', params)
 const batchAddDepotHeadAndDetail = (params) => postAction('/depotHead/batchAddDepotHeadAndDetail', params)
-const findStockByDepotAndBarCode = (params) => getAction('/depotItem/findStockByDepotAndBarCode', params)
+const findStockByDepotAndSku = (params) => getAction('/depotItem/findStockByDepotAndSku', params)
 const getBatchNumberList = (params) => getAction('/depotItem/getBatchNumberList', params)
 const findFinancialDetailByNumber = (params) => getAction('/accountHead/getDetailByNumber', params)
 
@@ -171,7 +171,7 @@ export {
   getMaterialBySelect,
   getSerialMaterialBySelect,
   getMaterialByParam,
-  getMaterialByBarCode,
+  getMaterialBySku,
   getMaterialByBatchNumber,
   getMaxBarCode,
   checkMaterialBarCode,
@@ -213,7 +213,7 @@ export {
   findBillDetailByNumber,
   waitBillCount,
   batchAddDepotHeadAndDetail,
-  findStockByDepotAndBarCode,
+  findStockByDepotAndSku,
   getBatchNumberList,
   findFinancialDetailByNumber,
   getMaterialById,

+ 22 - 3
jshERP-web/src/components/jeecg/JEditableTable.vue

@@ -31,7 +31,7 @@
 
     <slot name="actionButtonAfter" :target="getVM()" />
 
-    <div :id="`${caseId}inputTable`" class="input-table" :style="{ 'min-width': minWidth + 'px' }">
+    <div :id="`${caseId}inputTable`" class="input-table" :style="{ 'min-width': typeof minWidth === 'string'? minWidth : `${minWidth}px` }">
       <!-- 渲染表头 -->
       <div class="thead" ref="thead">
         <div class="tr" :style="{ width: this.realTrWidth }">
@@ -57,7 +57,7 @@
           <template v-for="col in columns" v-if="col.type !== formTypes.hidden">
             <div class="td" :key="col.key" :style="buildTdStyle(col)">
               <span style="padding: 0 5px">
-                {{ col.title }}
+                <span v-if="isRequried(col)" class="is-required">*</span>{{ col.title }}
                 <slot name="depotBatchSet" v-if="col.key === 'depotId'" :target="getVM()" />
               </span>
             </div>
@@ -1005,7 +1005,7 @@ export default {
     },
     // 页面是否在加载中
     minWidth: {
-      type: Number,
+      type: [Number, String],
       default: 1500,
     },
     maxHeight: {
@@ -3063,6 +3063,18 @@ export default {
         }
       })
     },
+    isRequried(column) {
+      let flag = false
+      if (column.validateRules && Array.isArray(column.validateRules)) {
+        for (let rule of column.validateRules) {
+          if (rule.required === true) {
+            flag = true
+            break
+          }
+        }
+      }
+      return flag
+    },
   },
   beforeDestroy() {
     this.destroyCleanGroupRequest = true
@@ -3379,4 +3391,11 @@ export default {
     -ms-scroll-snap-points-x: snapList(100%, 200%, 300%, 400%, 500%);
   }
 }
+
+.is-required {
+  color: #f5222d;
+  font-family: 'SimSun, sans-serif';
+  display: inline-block;
+  margin-right: 2px;
+}
 </style>

+ 2 - 44
jshERP-web/src/components/jeecgbiz/JSelectList.vue

@@ -2,38 +2,7 @@
   <div style="width: 100%">
     <a-input-group v-if="kind === 'material'" compact style="width: 100%; top: 0px">
       <a-select
-        placeholder="输入批次号或名称"
-        :dropdownMatchSelectWidth="false"
-        showSearch
-        :showArrow="false"
-        v-model="names"
-        optionFilterProp="children"
-        :style="searchWidth"
-        notFoundContent="需在商品管理先新增才能使用"
-        @search="handleSearch"
-        @change="handleChange"
-        style="width: 100%"
-      >
-        <div slot="dropdownRender" slot-scope="menu">
-          <v-nodes :vnodes="menu" />
-          <a-divider v-if="materialData.length === 20" style="margin: 4px 0" />
-          <div
-            v-if="materialData.length === 20"
-            style="padding: 4px 8px; cursor: pointer"
-            @mousedown="(e) => e.preventDefault()"
-          >
-            此处最多显示20条,如需更多请点击放大镜查询
-          </div>
-        </div>
-        <a-select-option v-for="item in materialData" :key="item.batchNumber">
-          {{ item.batchNumber }}
-        </a-select-option>
-      </a-select>
-      <a-button icon="search" @click="onSearch" />
-    </a-input-group>
-    <a-input-group v-if="kind === 'material2'" compact style="width: 100%; top: 0px">
-      <a-select
-        placeholder="输入商品条码"
+        placeholder="sku"
         :dropdownMatchSelectWidth="false"
         showSearch
         :showArrow="false"
@@ -74,16 +43,7 @@
       ref="selectModal"
       :rows="rows"
       :multi="multi"
-      :bar-code="value"
-      @ok="selectOK"
-      @initComp="initComp"
-    />
-    <j-select-material-modal2
-      v-if="kind === 'material2'"
-      ref="selectModal"
-      :rows="rows"
-      :multi="multi"
-      :bar-code="value"
+      :sku="value"
       @ok="selectOK"
       @initComp="initComp"
     />
@@ -119,7 +79,6 @@
 
 <script>
 import JSelectMaterialModal from './modal/JSelectMaterialModal'
-import JSelectMaterialModal2 from './modal/JSelectMaterialModal2'
 import JSelectBatchModal from './modal/JSelectBatchModal'
 import JSelectSnModal from './modal/JSelectSnModal'
 import JSelectSnAddModal from './modal/JSelectSnAddModal'
@@ -129,7 +88,6 @@ export default {
   name: 'JSelectList',
   components: {
     JSelectMaterialModal,
-    JSelectMaterialModal2,
     JSelectBatchModal,
     JSelectSnModal,
     JSelectSnAddModal,

+ 24 - 83
jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal.vue

@@ -1,13 +1,13 @@
 <template>
   <a-modal
-    :width="modalWidth"
+    width="100%"
     :visible="visible"
     :title="title"
     :wrapClassName="wrapClassNameInfo()"
     @ok="handleSubmit"
     @cancel="close"
     cancelText="关闭(ESC)"
-    style="top: 20px; height: 95%"
+    style="top: 0; height: 100%"
   >
     <a-row :gutter="10" style="padding: 10px; margin: -10px">
       <a-col :md="24" :sm="24">
@@ -27,20 +27,8 @@
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="8">
-                <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="仓库">
-                  <a-select
-                    placeholder="选择仓库"
-                    v-model="queryParam.depotId"
-                    @change="onDepotChange"
-                    :dropdownMatchSelectWidth="false"
-                    showSearch
-                    optionFilterProp="children"
-                    allow-clear
-                  >
-                    <a-select-option v-for="(item, index) in depotList" :key="index" :value="item.id">
-                      {{ item.depotName }}
-                    </a-select-option>
-                  </a-select>
+                <a-form-item label="颜色" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
+                  <a-input placeholder="请输入颜色" v-model="queryParam.color"></a-input>
                 </a-form-item>
               </a-col>
               <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
@@ -57,11 +45,7 @@
                 </a-col>
               </span>
               <template v-if="toggleSearchStatus">
-                <a-col :md="6" :sm="8">
-                  <a-form-item label="颜色" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
-                    <a-input placeholder="请输入颜色" v-model="queryParam.color"></a-input>
-                  </a-form-item>
-                </a-col>
+          
                 <a-col :md="6" :sm="8">
                   <a-form-item label="品牌" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
                     <a-input placeholder="请输入品牌" v-model="queryParam.brand"></a-input>
@@ -80,11 +64,6 @@
                     </a-tree-select>
                   </a-form-item>
                 </a-col>
-                <a-col :md="6" :sm="8">
-                  <a-form-item label="制造商" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
-                    <a-input placeholder="请输入制造商" v-model="queryParam.mfrs"></a-input>
-                  </a-form-item>
-                </a-col>
                 <a-col :md="6" :sm="24">
                   <a-form-item label="序列号" :labelCol="labelCol" :wrapperCol="wrapperCol">
                     <a-select placeholder="有无序列号" v-model="queryParam.enableSerialNumber">
@@ -93,19 +72,6 @@
                     </a-select>
                   </a-form-item>
                 </a-col>
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="仓库货架" :labelCol="labelCol" :wrapperCol="wrapperCol">
-                    <a-input placeholder="请输入仓库货架" v-model="queryParam.position"></a-input>
-                  </a-form-item>
-                </a-col>
-                <!-- <a-col :md="6" :sm="24">
-                  <a-form-item label="批号" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
-                    <a-select placeholder="有无批号" v-model="queryParam.enableBatchNumber">
-                      <a-select-option value="1">有</a-select-option>
-                      <a-select-option value="0">无</a-select-option>
-                    </a-select>
-                  </a-form-item>
-                </a-col> -->
               </template>
             </a-row>
           </a-form>
@@ -169,14 +135,13 @@ export default {
   components: {
     MaterialModal: () => import('@/views/material/modules/MaterialModal'),
   },
-  props: ['rows', 'multi', 'barCode', 'isStock'],
+  props: ['rows', 'multi', 'sku', 'isStock'],
   data() {
     return {
       modalWidth: 1450,
       queryParam: {
         q: '',
         standardOrModel: '',
-        depotId: undefined,
         color: '',
         brand: '',
         categoryId: undefined,
@@ -202,24 +167,17 @@ export default {
           width: 60,
           scopedSlots: { customRender: 'action' },
         },
-        // { dataIndex: 'mBarCode', title: '条码', scopedSlots: { customRender: 'customBarCode' } },
-        { dataIndex: 'batchNumber', title: '批次号' },
+        { dataIndex: 'sku', title: 'SKU' },
         { dataIndex: 'name', title: '名称', scopedSlots: { customRender: 'customName' } },
         { dataIndex: 'categoryName', title: '类别' },
         // { dataIndex: 'standard', title: '规格' },
         { dataIndex: 'model', title: '型号' },
         { dataIndex: 'color', title: '颜色' },
         { dataIndex: 'brand', title: '品牌' },
-        { dataIndex: 'supplierName', title: '供应商' },
         { dataIndex: 'unit', title: '单位' },
-        { dataIndex: 'sku', title: '多属性' },
         { dataIndex: 'inventory', title: '库存' },
-        { dataIndex: 'productionDate', title: '生产日期' },
-        { dataIndex: 'expiryNum', title: '保质期' },
-        { dataIndex: 'barCode', title: '商品条码' },
-        { dataIndex: 'depotName', title: '仓库名称' },
-        { dataIndex: 'position', title: '仓库货架' },
-
+        // { dataIndex: 'depotName', title: '仓库名称' },
+        // { dataIndex: 'position', title: '仓库货架' },
         // { dataIndex: 'expand', title: '扩展信息' },
       ],
       scrollTrigger: {},
@@ -244,7 +202,6 @@ export default {
         order: 'desc',
       },
       departTree: [],
-      depotList: [],
       visible: false,
       form: this.$form.createForm(this),
       loading: false,
@@ -259,7 +216,7 @@ export default {
     },
   },
   watch: {
-    barCode: {
+    sku: {
       immediate: true,
       handler() {
         this.initBarCode()
@@ -272,8 +229,8 @@ export default {
   },
   methods: {
     initBarCode() {
-      if (this.barCode) {
-        this.$emit('initComp', this.barCode)
+      if (this.sku) {
+        this.$emit('initComp', this.sku)
       } else {
         // JSelectUserByDep组件bug issues/I16634
         this.$emit('initComp', '')
@@ -291,7 +248,7 @@ export default {
           this.ipagination.total = res.total
           if (res.total === 1) {
             if (
-              this.queryParam.q === this.dataSource[0].batchNumber ||
+              this.queryParam.q === this.dataSource[0].sku ||
               this.queryParam.q === this.dataSource[0].name ||
               this.queryParam.q === this.dataSource[0].mnemonic
             ) {
@@ -325,22 +282,22 @@ export default {
     // 触发屏幕自适应
     resetScreenSize() {
       let realScreenWidth = window.screen.width
-      this.modalWidth = realScreenWidth < 1600 ? '1300px' : '1550px'
+      this.modalWidth = realScreenWidth < 1600 ? '100%' : '1550px'
       let screenWidth = document.body.clientWidth
       if (screenWidth < 500) {
         this.scrollTrigger = { x: 800 }
       } else {
-        this.scrollTrigger = {}
+        this.scrollTrigger = {
+          x: 'max-content',
+        }
       }
     },
-    showModal(barCode) {
+    showModal(sku) {
       this.visible = true
       this.title = '选择商品'
-      this.queryParam.q = barCode
+      this.queryParam.q = sku
       this.$nextTick(() => this.$refs.material.focus())
       this.loadTreeData()
-      this.getDepotList()
-      this.initDepotSelect()
       this.loadMaterialData()
       this.form.resetFields()
     },
@@ -411,41 +368,25 @@ export default {
       let dataSource = this.dataSource
       let materialIds = ''
       this.selectMaterialRows = []
+      console.log('getSelectMaterialRows', this.selectedRowKeys)
       for (let i = 0, len = dataSource.length; i < len; i++) {
         if (this.selectedRowKeys.includes(dataSource[i].id)) {
           this.selectMaterialRows.push(dataSource[i])
-          materialIds = materialIds + ',' + dataSource[i].batchNumber
+          materialIds = materialIds + ',' + dataSource[i].sku
         }
       }
+      console.log('materialIds=====',materialIds)
       this.selectMaterialIds = materialIds.substring(1)
     },
-    getDepotList() {
-      let that = this
-      getAction('/depot/findDepotByCurrentUser').then((res) => {
-        if (res.code === 200) {
-          that.depotList = res.data
-        }
-      })
-    },
-    initDepotSelect() {
-      if (this.rows) {
-        if (JSON.parse(this.rows).depotId) {
-          const id = JSON.parse(this.rows).depotId - 0
-          this.queryParam.depotId = id + ''
-        }
-      }
-    },
-    onDepotChange(value) {
-      this.queryParam.depotId = value
-    },
     onSelectChange(selectedRowKeys, selectionRows) {
       this.selectedRowKeys = selectedRowKeys
       this.selectionRows = selectionRows
+      console.log('onSelectChange', selectedRowKeys, selectionRows)
     },
     onSearch() {
       if (this.dataSource && this.dataSource.length === 1) {
         if (
-          this.queryParam.q === this.dataSource[0].mBarCode ||
+          this.queryParam.q === this.dataSource[0].sku ||
           this.queryParam.q === this.dataSource[0].name ||
           this.queryParam.q === this.dataSource[0].mnemonic
         ) {

+ 0 - 524
jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal2.vue

@@ -1,524 +0,0 @@
-<template>
-  <a-modal
-    width="100%"
-    :visible="visible"
-    :title="title"
-    :wrapClassName="wrapClassNameInfo()"
-    @ok="handleSubmit"
-    @cancel="close"
-    cancelText="关闭(ESC)"
-    style="top: 0; height: 100%"
-  >
-    <a-row :gutter="10" style="padding: 10px; margin: -10px">
-      <a-col :md="24" :sm="24">
-        <!-- 查询区域 -->
-        <div class="table-page-search-wrapper">
-          <!-- 搜索区域 -->
-          <a-form layout="inline" @keyup.enter.native="onSearch">
-            <a-row :gutter="24">
-              <a-col :md="6" :sm="8">
-                <a-form-item label="关键词" :labelCol="labelCol" :wrapperCol="wrapperCol">
-                  <a-input ref="material" placeholder="请输入条码、名称、助记码等查询" v-model="queryParam.q"></a-input>
-                </a-form-item>
-              </a-col>
-              <a-col :md="6" :sm="8">
-                <a-form-item label="规格型号" :labelCol="labelCol" :wrapperCol="wrapperCol">
-                  <a-input placeholder="请输入规格、型号" v-model="queryParam.standardOrModel"></a-input>
-                </a-form-item>
-              </a-col>
-              <a-col :md="6" :sm="8">
-                <a-form-item label="颜色" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
-                  <a-input placeholder="请输入颜色" v-model="queryParam.color"></a-input>
-                </a-form-item>
-              </a-col>
-              <!-- <a-col :md="6" :sm="8">
-                <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="仓库">
-                  <a-select
-                    placeholder="选择仓库"
-                    v-model="queryParam.depotId"
-                    @change="onDepotChange"
-                    :dropdownMatchSelectWidth="false"
-                    showSearch
-                    optionFilterProp="children"
-                    allow-clear
-                  >
-                    <a-select-option v-for="(item, index) in depotList" :key="index" :value="item.id">
-                      {{ item.depotName }}
-                    </a-select-option>
-                  </a-select>
-                </a-form-item>
-              </a-col> -->
-              <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
-                <a-col :md="6" :sm="8">
-                  <a-button type="primary" @click="loadMaterialData(1)">查询</a-button>
-                  <a-button style="margin-left: 8px" @click="searchReset(1)">重置</a-button>
-                  <a-tooltip title="没查询到,决定新增商品!">
-                    <a-button style="margin-left: 8px" @click="addMaterial">新增</a-button>
-                  </a-tooltip>
-                  <a @click="handleToggleSearch" style="margin-left: 8px">
-                    {{ toggleSearchStatus ? '收起' : '展开' }}
-                    <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
-                  </a>
-                </a-col>
-              </span>
-              <template v-if="toggleSearchStatus">
-          
-                <a-col :md="6" :sm="8">
-                  <a-form-item label="品牌" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
-                    <a-input placeholder="请输入品牌" v-model="queryParam.brand"></a-input>
-                  </a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="8">
-                  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="类别">
-                    <a-tree-select
-                      style="width: 100%"
-                      :dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }"
-                      allow-clear
-                      :treeData="categoryTree"
-                      v-model="queryParam.categoryId"
-                      placeholder="请选择类别"
-                    >
-                    </a-tree-select>
-                  </a-form-item>
-                </a-col>
-                <!-- <a-col :md="6" :sm="8">
-                  <a-form-item label="制造商" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
-                    <a-input placeholder="请输入制造商" v-model="queryParam.mfrs"></a-input>
-                  </a-form-item>
-                </a-col> -->
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="序列号" :labelCol="labelCol" :wrapperCol="wrapperCol">
-                    <a-select placeholder="有无序列号" v-model="queryParam.enableSerialNumber">
-                      <a-select-option value="1">有</a-select-option>
-                      <a-select-option value="0">无</a-select-option>
-                    </a-select>
-                  </a-form-item>
-                </a-col>
-                <!-- <a-col :md="6" :sm="24">
-                  <a-form-item label="仓库货架" :labelCol="labelCol" :wrapperCol="wrapperCol">
-                    <a-input placeholder="请输入仓库货架" v-model="queryParam.position"></a-input>
-                  </a-form-item>
-                </a-col> -->
-                <!-- <a-col :md="6" :sm="24">
-                  <a-form-item label="批号" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
-                    <a-select placeholder="有无批号" v-model="queryParam.enableBatchNumber">
-                      <a-select-option value="1">有</a-select-option>
-                      <a-select-option value="0">无</a-select-option>
-                    </a-select>
-                  </a-form-item>
-                </a-col> -->
-              </template>
-            </a-row>
-          </a-form>
-          <a-button v-if="isStock" type="primary" @click="findAllSelect">一键全选</a-button>
-          <a-table
-            ref="table"
-            :scroll="scrollTrigger"
-            size="middle"
-            rowKey="id"
-            :columns="columns"
-            :dataSource="dataSource"
-            :pagination="ipagination"
-            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: getType }"
-            :loading="loading"
-            :customRow="rowAction"
-            @change="handleTableChange"
-          >
-            <template slot="customBarCode" slot-scope="text, record">
-              <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">{{ record.mBarCode }}</div>
-              <a-popover placement="right" trigger="click">
-                <template slot="content">
-                  <img :src="getImgUrl(record.imgName, record.imgLarge)" width="500px" />
-                </template>
-                <div class="item-info" v-if="record.imgName">
-                  <img
-                    v-if="record.imgName"
-                    :src="getImgUrl(record.imgName, record.imgSmall)"
-                    class="item-img"
-                    title="查看大图"
-                  />
-                </div>
-              </a-popover>
-            </template>
-            <template slot="customName" slot-scope="text, record">
-              {{ record.name }}
-              <a-tag v-if="record.enableSerialNumber == 1" color="orange">序</a-tag>
-              <a-tag v-if="record.enableBatchNumber == 1" color="orange">批</a-tag>
-            </template>
-            <span slot="action" slot-scope="text, record">
-              <a @click.stop="handleEdit(record)">编辑</a>
-            </span>
-          </a-table>
-        </div>
-      </a-col>
-    </a-row>
-    <material-modal ref="modalForm" @ok="modalFormOk"></material-modal>
-  </a-modal>
-</template>
-
-<script>
-import { getAction, getFileAccessHttpUrl } from '@/api/manage'
-import { filterObj, getMpListShort } from '@/utils/util'
-import { getMaterialBySelect, queryMaterialCategoryTreeList, getMaterialById } from '@/api/api'
-import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-import { mixinDevice } from '@/utils/mixin'
-import Vue from 'vue'
-
-export default {
-  name: 'JSelectMaterialModal',
-  mixins: [JeecgListMixin, mixinDevice],
-  components: {
-    MaterialModal: () => import('@/views/material/modules/MaterialModal'),
-  },
-  props: ['rows', 'multi', 'barCode', 'isStock'],
-  data() {
-    return {
-      modalWidth: 1450,
-      queryParam: {
-        q: '',
-        standardOrModel: '',
-        color: '',
-        brand: '',
-        categoryId: undefined,
-        mfrs: '',
-        enableSerialNumber: undefined,
-        enableBatchNumber: undefined,
-        position: '',
-      },
-      labelCol: {
-        xs: { span: 24 },
-        sm: { span: 5 },
-      },
-      wrapperCol: {
-        xs: { span: 24 },
-        sm: { span: 16 },
-      },
-      categoryTree: [],
-      columns: [
-        {
-          title: '操作',
-          dataIndex: 'action',
-          align: 'center',
-          width: 60,
-          scopedSlots: { customRender: 'action' },
-        },
-        // { dataIndex: 'mBarCode', title: '条码', scopedSlots: { customRender: 'customBarCode' } },
-        // { dataIndex: 'batchNumber', title: '批次号' },
-        { dataIndex: 'barCode', title: '商品条码' },
-        { dataIndex: 'name', title: '名称', scopedSlots: { customRender: 'customName' } },
-        { dataIndex: 'categoryName', title: '类别' },
-        // { dataIndex: 'standard', title: '规格' },
-        { dataIndex: 'model', title: '型号' },
-        { dataIndex: 'color', title: '颜色' },
-        { dataIndex: 'brand', title: '品牌' },
-        // { dataIndex: 'supplierName', title: '供应商' },
-        { dataIndex: 'unit', title: '单位' },
-        { dataIndex: 'sku', title: '多属性' },
-        { dataIndex: 'inventory', title: '库存' },
-        // { dataIndex: 'productionDate', title: '生产日期' },
-        // { dataIndex: 'expiryNum', title: '保质期' },
-        // { dataIndex: 'barCode', title: '商品条码' },
-        // { dataIndex: 'depotName', title: '仓库名称' },
-        // { dataIndex: 'position', title: '仓库货架' },
-
-        // { dataIndex: 'expand', title: '扩展信息' },
-      ],
-      scrollTrigger: {},
-      dataSource: [],
-      selectedRowKeys: [],
-      selectMaterialRows: [],
-      selectMaterialIds: [],
-      title: '选择商品',
-      ipagination: {
-        current: 1,
-        pageSize: 10,
-        pageSizeOptions: ['10', '20', '30'],
-        showTotal: (total, range) => {
-          return range[0] + '-' + range[1] + ' 共' + total + '条'
-        },
-        showQuickJumper: true,
-        showSizeChanger: true,
-        total: 0,
-      },
-      isorter: {
-        column: 'createTime',
-        order: 'desc',
-      },
-      departTree: [],
-      depotList: [],
-      visible: false,
-      form: this.$form.createForm(this),
-      loading: false,
-      expandedKeys: [],
-      disableMixinCreated: true,
-    }
-  },
-  computed: {
-    // 计算属性的 getter
-    getType: function () {
-      return this.multi == true ? 'checkbox' : 'radio'
-    },
-  },
-  watch: {
-    barCode: {
-      immediate: true,
-      handler() {
-        this.initBarCode()
-      },
-    },
-  },
-  created() {
-    // 该方法触发屏幕自适应
-    this.resetScreenSize()
-  },
-  methods: {
-    initBarCode() {
-      if (this.barCode) {
-        this.$emit('initComp', this.barCode)
-      } else {
-        // JSelectUserByDep组件bug issues/I16634
-        this.$emit('initComp', '')
-      }
-    },
-    loadMaterialData(arg) {
-      if (arg === 1) {
-        this.ipagination.current = 1
-      }
-      this.loading = true
-      let params = this.getQueryParams() //查询条件
-      getMaterialBySelect(params).then((res) => {
-        if (res) {
-          this.dataSource = res.rows
-          this.ipagination.total = res.total
-          if (res.total === 1) {
-            if (
-              this.queryParam.q === this.dataSource[0].barCode ||
-              this.queryParam.q === this.dataSource[0].name ||
-              this.queryParam.q === this.dataSource[0].mnemonic
-            ) {
-              this.title = '选择商品【再次回车可以直接选中】'
-              this.$nextTick(() => this.$refs.material.focus())
-            } else {
-              this.title = '选择商品'
-            }
-          } else {
-            this.title = '选择商品'
-          }
-        }
-        this.loading = false
-        this.onClearSelected()
-      })
-    },
-    loadTreeData() {
-      let that = this
-      let params = {}
-      params.id = ''
-      queryMaterialCategoryTreeList(params).then((res) => {
-        if (res) {
-          that.categoryTree = []
-          for (let i = 0; i < res.length; i++) {
-            let temp = res[i]
-            that.categoryTree.push(temp)
-          }
-        }
-      })
-    },
-    // 触发屏幕自适应
-    resetScreenSize() {
-      let realScreenWidth = window.screen.width
-      this.modalWidth = realScreenWidth < 1600 ? '100%' : '1550px'
-      let screenWidth = document.body.clientWidth
-      if (screenWidth < 500) {
-        this.scrollTrigger = { x: 800 }
-      } else {
-        this.scrollTrigger = {
-          x: 'max-content',
-        }
-      }
-    },
-    showModal(barCode) {
-      this.visible = true
-      this.title = '选择商品'
-      this.queryParam.q = barCode
-      this.$nextTick(() => this.$refs.material.focus())
-      this.loadTreeData()
-      // this.getDepotList()
-      // this.initDepotSelect()
-      this.loadMaterialData()
-      this.form.resetFields()
-    },
-    getQueryParams() {
-      let param = Object.assign({}, this.queryParam, this.isorter)
-      param.mpList = getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
-      param.page = this.ipagination.current
-      param.rows = this.ipagination.pageSize
-      return filterObj(param)
-    },
-    getQueryField() {
-      let str = 'id,'
-      for (let a = 0; a < this.columns.length; a++) {
-        str += ',' + this.columns[a].dataIndex
-      }
-      return str
-    },
-    searchReset(num) {
-      let that = this
-      if (num !== 0) {
-        that.queryParam = {}
-        that.loadMaterialData(1)
-      }
-      that.selectedRowKeys = []
-      that.selectMaterialIds = []
-    },
-    addMaterial() {
-      this.$refs.modalForm.add()
-      this.$refs.modalForm.title = '新增商品'
-    },
-    handleEdit(record) {
-      getMaterialById({ mid: record.mid }).then((res) => {
-        this.$refs.modalForm.edit(res.data)
-        this.$refs.modalForm.title = '编辑'
-        this.$refs.modalForm.disableSubmit = false
-        this.$refs.modalForm.showOkFlag = true
-      })
-    },
-    getImgUrl(imgName, type) {
-      if (imgName && imgName.split(',')) {
-        type = type ? type + '/' : ''
-        return getFileAccessHttpUrl('systemConfig/static/' + type + imgName.split(',')[0])
-      } else {
-        return ''
-      }
-    },
-    close() {
-      this.searchReset(0)
-      this.visible = false
-    },
-    handleTableChange(pagination, filters, sorter) {
-      if (Object.keys(sorter).length > 0) {
-        this.isorter.column = sorter.field
-        this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc'
-      }
-      this.ipagination = pagination
-      this.loadMaterialData()
-    },
-    handleSubmit() {
-      let that = this
-      this.getSelectMaterialRows()
-      that.$emit('ok', that.selectMaterialRows, that.selectMaterialIds)
-      that.searchReset(0)
-      that.close()
-    },
-    //获取选择信息
-    getSelectMaterialRows(rowId) {
-      let dataSource = this.dataSource
-      let materialIds = ''
-      this.selectMaterialRows = []
-      console.log('getSelectMaterialRows', this.selectedRowKeys)
-      for (let i = 0, len = dataSource.length; i < len; i++) {
-        if (this.selectedRowKeys.includes(dataSource[i].id)) {
-          this.selectMaterialRows.push(dataSource[i])
-          materialIds = materialIds + ',' + dataSource[i].barCode
-        }
-      }
-      console.log('materialIds=====',materialIds)
-      this.selectMaterialIds = materialIds.substring(1)
-    },
-    getDepotList() {
-      let that = this
-      getAction('/depot/findDepotByCurrentUser').then((res) => {
-        if (res.code === 200) {
-          that.depotList = res.data
-        }
-      })
-    },
-    // initDepotSelect() {
-    //   if (this.rows) {
-    //     if (JSON.parse(this.rows).depotId) {
-    //       const id = JSON.parse(this.rows).depotId - 0
-    //       this.queryParam.depotId = id + ''
-    //     }
-    //   }
-    // },
-    // onDepotChange(value) {
-    //   this.queryParam.depotId = value
-    // },
-    onSelectChange(selectedRowKeys, selectionRows) {
-      this.selectedRowKeys = selectedRowKeys
-      this.selectionRows = selectionRows
-      console.log('onSelectChange', selectedRowKeys, selectionRows)
-    },
-    onSearch() {
-      if (this.dataSource && this.dataSource.length === 1) {
-        if (
-          this.queryParam.q === this.dataSource[0].mBarCode ||
-          this.queryParam.q === this.dataSource[0].name ||
-          this.queryParam.q === this.dataSource[0].mnemonic
-        ) {
-          let arr = []
-          arr.push(this.dataSource[0].id)
-          this.selectedRowKeys = arr
-          this.handleSubmit()
-        } else {
-          this.loadMaterialData(1)
-        }
-      } else {
-        this.loadMaterialData(1)
-      }
-    },
-    modalFormOk() {
-      this.loadMaterialData()
-    },
-    rowAction(record, index) {
-      return {
-        on: {
-          click: () => {
-            let arr = []
-            arr.push(record.id)
-            this.selectedRowKeys = arr
-          },
-          dblclick: () => {
-            let arr = []
-            arr.push(record.id)
-            this.selectedRowKeys = arr
-            this.handleSubmit()
-          },
-        },
-      }
-    },
-    findAllSelect() {
-      this.$emit('all', this.queryParam)
-    },
-  },
-}
-</script>
-
-<style scoped>
-.ant-table-tbody .ant-table-row td {
-  padding-top: 10px;
-  padding-bottom: 10px;
-}
-
-#components-layout-demo-custom-trigger .trigger {
-  font-size: 18px;
-  line-height: 64px;
-  padding: 0 24px;
-  cursor: pointer;
-  transition: color 0.3s;
-}
-
-.item-info {
-  float: left;
-  width: 30px;
-  height: 30px;
-  margin-left: 8px;
-}
-.item-img {
-  cursor: pointer;
-  position: static;
-  display: block;
-  width: 100%;
-  height: 100%;
-  object-fit: cover;
-}
-</style>

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

@@ -2066,7 +2066,7 @@ export default {
         // { title: '规格', dataIndex: 'standard', width: 90 },
         { title: '生产日期', dataIndex: 'productionDate', width: 100 },
         { title: '保质期', dataIndex: 'expiryNum', width: 60 },
-        { title: '商品条码', dataIndex: 'barCode', width: 90 },
+        { title: 'SKU', dataIndex: 'sku', width: 90 },
         { title: '仓库名称', dataIndex: 'depotName', width: 90 },
         { title: '仓库货架', dataIndex: 'position', width: 90 },
         { title: '包装规格', dataIndex: 'unitName', width: 90 },
@@ -2100,7 +2100,7 @@ export default {
 
         { title: '生产日期', dataIndex: 'productionDate', width: 100 },
         { title: '保质期', dataIndex: 'expiryNum', width: 60 },
-        { title: '商品条码', dataIndex: 'barCode', width: 90 },
+        { title: 'SKU', dataIndex: 'sku', width: 90 },
         { title: '仓库名称', dataIndex: 'depotName', width: 90 },
         { title: '仓库货架', dataIndex: 'position', width: 90 },
         { title: '包装规格', dataIndex: 'unitName', width: 90 },
@@ -2159,7 +2159,7 @@ export default {
         { title: '名称', dataIndex: 'name', width: 115 },
         // { title: '规格', dataIndex: 'standard', width: 90 },
 
-        { title: '商品条码', dataIndex: 'barCode', width: 90 },
+        { title: 'SKU', dataIndex: 'sku', width: 90 },
         { title: '仓库名称', dataIndex: 'depotName', width: 90 },
         { title: '仓库货架', dataIndex: 'position', width: 90 },
         { title: '包装规格', dataIndex: 'unitName', width: 90 },
@@ -2193,7 +2193,7 @@ export default {
         { title: '名称', dataIndex: 'name', width: 115 },
         // { title: '规格', dataIndex: 'standard', width: 90 },
 
-        { title: '商品条码', dataIndex: 'barCode', width: 90 },
+        { title: 'SKU', dataIndex: 'sku', width: 90 },
         { title: '仓库名称', dataIndex: 'depotName', width: 90 },
         { title: '仓库货架', dataIndex: 'position', width: 90 },
         { title: '包装规格', dataIndex: 'unitName', width: 90 },
@@ -2255,7 +2255,7 @@ export default {
 
         { title: '生产日期', dataIndex: 'productionDate', width: 100 },
         { title: '保质期', dataIndex: 'expiryNum', width: 60 },
-        { title: '商品条码', dataIndex: 'barCode', width: 90 },
+        { title: 'SKU', dataIndex: 'sku', width: 90 },
         { title: '仓库名称', dataIndex: 'depotName', width: 90 },
         { title: '仓库货架', dataIndex: 'position', width: 90 },
         { title: '包装规格', dataIndex: 'unitName', width: 90 },
@@ -2281,7 +2281,7 @@ export default {
         { title: '批次号', dataIndex: 'batchNumber', width: 90 },
         { title: '名称', dataIndex: 'name', width: 115 },
         // { title: '规格', dataIndex: 'standard', width: 90 },
-        { title: '商品条码', dataIndex: 'barCode', width: 90 },
+        { title: 'SKU', dataIndex: 'sku', width: 90 },
         { title: '仓库名称', dataIndex: 'depotName', width: 90 },
         { title: '仓库货架', dataIndex: 'position', width: 90 },
         { title: '包装规格', dataIndex: 'unitName', width: 90 },
@@ -2312,7 +2312,7 @@ export default {
 
         { title: '生产日期', dataIndex: 'productionDate', width: 100 },
         { title: '保质期', dataIndex: 'expiryNum', width: 60 },
-        { title: '商品条码', dataIndex: 'barCode', width: 90 },
+        { title: 'SKU', dataIndex: 'sku', width: 90 },
         { title: '仓库名称', dataIndex: 'depotName', width: 90 },
         { title: '仓库货架', dataIndex: 'position', width: 90 },
         { title: '包装规格', dataIndex: 'unitName', width: 90 },

+ 10 - 156
jshERP-web/src/views/bill/mixins/BillModalMixin.js

@@ -3,16 +3,13 @@ import {
   findBySelectCus,
   findBySelectRetail,
   findBySelectSup,
-  findStockByDepotAndBarCode,
+  findStockByDepotAndSku,
   getAccount,
-  getBatchNumberList,
   getCurrentSystemConfig,
   getMaterialByBatchNumber,
-  getMaterialByBarCode,
-  getMaterialBySelect,
+  getMaterialBySku,
   getPersonByNumType,
   getPlatformConfigByKey,
-  getUnitInfo,
   creatorSpinnerList,
 } from '@/api/api'
 import { getAction } from '@/api/manage'
@@ -281,10 +278,8 @@ export const BillModalMixin = {
       })
     },
     initDepot() {
-      let that = this
       getAction('/depot/findDepotByCurrentUser').then((res) => {
         if (res.code === 200) {
-          let arr = res.data
           this.depotList = res.data.map(item => {
             return {
               ...item,
@@ -292,18 +287,6 @@ export const BillModalMixin = {
               label: item.depotName,
             }
           })
-          for (let item of that.materialTable.columns) {
-            if (item.key == 'depotId' || item.key == 'anotherDepotId') {
-              item.options = []
-              for (let i = 0; i < arr.length; i++) {
-                let depotInfo = {}
-                depotInfo.value = arr[i].id + '' //注意-此处value必须为字符串格式
-                depotInfo.text = arr[i].depotName
-                depotInfo.title = arr[i].depotName
-                item.options.push(depotInfo)
-              }
-            }
-          }
         }
       })
     },
@@ -402,46 +385,6 @@ export const BillModalMixin = {
           //获取单据明细列表信息
           let detailArr = allValues.tablesValue[0].values
           console.log('detailArr=======',detailArr)
-          // let batchNumbers = ''
-          // for (let detail of detailArr) {
-          //   batchNumbers += detail.batchNumber + ','
-          // }
-          // if (batchNumbers) {
-          //   batchNumbers = batchNumbers.substring(0, batchNumbers.length - 1)
-          // }
-          // let param = {
-          //   batchNumber: batchNumbers,
-          //   organId: this.form.getFieldValue('organId'),
-          //   depotId: depotId,
-          //   mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
-          //   prefixNo: this.prefixNo,
-          // }
-          // getMaterialByBatchNumber(param).then((res) => {
-          //   if (res && res.code === 200) {
-          //     let mList = res.data
-          //     //构造新的列表数组,用于存放单据明细信息
-          //     let newDetailArr = []
-          //     if (mList && mList.length) {
-          //       for (let i = 0; i < detailArr.length; i++) {
-          //         let item = detailArr[i]
-          //         item.depotId = depotId
-          //         for (let j = 0; j < mList.length; j++) {
-          //           if (mList[j].batchNumber === item.batchNumber) {
-          //             item.stock = mList[j].stock
-          //           }
-          //         }
-          //         newDetailArr.push(item)
-          //       }
-          //     } else {
-          //       for (let i = 0; i < detailArr.length; i++) {
-          //         let item = detailArr[i]
-          //         item.depotId = depotId
-          //         newDetailArr.push(item)
-          //       }
-          //     }
-          //     this.materialTable.dataSource = newDetailArr
-          //   }
-          // })
         })
     },
     depotModalFormOk() {
@@ -462,20 +405,6 @@ export const BillModalMixin = {
         that.$refs.materialDataTable.resetScrollTop((target.rows.length + 1) * that.$refs.materialDataTable.rowHeight)
       }, 1000)
     },
-    //根据仓库名、商品条码带出对应的仓位货架、库存数量
-    // async setProPosition(barCode, depotId, event){
-    //   const { row, column, value, target } = event
-    //   findStockByDepotAndBarCode({ depotId: depotId, barCode: barCode }).then(res => {
-    //     const {position='',stock} = res.data
-    //     target.setValues([
-    //       {
-    //         rowKey: row.id,
-    //         values: { position:position,inventory: stock },
-    //       },
-    //     ])
-    //     target.$forceUpdate()
-    //   })
-    // },
     // 选择供应商、客户带出税率
     getTatRate(id){
       getAction('/supplier/info', { id }).then((res) => {
@@ -535,9 +464,9 @@ export const BillModalMixin = {
         const rows = values
         const updateRows = []
         for (let row of rows) {
-          const barCode = row.barCode
-          if(depotId&&barCode){
-            const res = await findStockByDepotAndBarCode({ depotId: depotId, barCode: barCode })
+          const sku = row.sku
+          if(depotId&&sku){
+            const res = await findStockByDepotAndSku({ depotId: depotId, sku: sku })
             const {position='',stock=0} = res.data
             updateRows.push({
               rowKey: row.id,
@@ -555,24 +484,15 @@ export const BillModalMixin = {
       const { type, row, column, value, target } = event
       let param, snList, batchNumber, operNumber, unitPrice, allPrice, taxRate, taxMoney, taxLastMoney,ratio
       switch (column.key) {
-        // case 'depotId':
-        //   console.log('row========', row)
-        //   // // 选择商品自动带出barCode、商品ID
-        //   if(row.depotId&&row.barCode&&type=='select'){
-        //     // // 根据仓库id自动带出仓位货架(若有)参数:商品id、仓库id
-        //     this.setProPosition(row.barCode, row.depotId, event)
-        //   }
-        //   break
-        case 'barCode':
+        case 'sku':
           param = {
-            barCode: value,
+            sku: value,
             organId: this.form.getFieldValue('organId'),
-            mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
             prefixNo: this.prefixNo,
           }
           const formDepotId = that.form.getFieldValue('depotId')
           const formTaxRate = that.form.getFieldValue('taxRate')
-          getMaterialByBarCode(param).then(async (res) => {
+          getMaterialBySku(param).then(async (res) => {
             if (res && res.code === 200) {
               let mList = res.data
               let mArr = await target.getValuesPromise(false)
@@ -588,7 +508,7 @@ export const BillModalMixin = {
                 mObj.depotId = formDepotId
                 mObj.position = ''
                 if(formDepotId){
-                  const res = await findStockByDepotAndBarCode({ depotId: formDepotId, barCode: mObj.barCode })
+                  const res = await findStockByDepotAndSku({ depotId: formDepotId, sku: mObj.sku })
                   const {position='',stock=0} = res.data
                   mObj.stock = stock
                   mObj.inventory = stock
@@ -656,72 +576,12 @@ export const BillModalMixin = {
           target.recalcAllStatisticsColumns()
           that.autoChangePrice(target)
           break
-        // case 'allPrice':
-        //   operNumber = row.operNumber - 0 //数量
-        //   taxRate = row.taxRate - 0 //税率
-        //   allPrice = value - 0
-        //   unitPrice = (allPrice / operNumber).toFixed(2) - 0 //单价
-        //   taxMoney = (taxRate * 0.01 * allPrice).toFixed(2) - 0
-        //   taxLastMoney = (allPrice + taxMoney).toFixed(2) - 0
-        //   target.setValues([
-        //     { rowKey: row.id, values: { unitPrice: unitPrice, taxMoney: taxMoney, taxLastMoney: taxLastMoney } },
-        //   ])
-        //   target.recalcAllStatisticsColumns()
-        //   that.autoChangePrice(target)
-        //   break
-        // case 'taxRate':
-        //   operNumber = row.operNumber - 0 //数量
-        //   allPrice = row.allPrice - 0
-        //   unitPrice = row.unitPrice - 0
-        //   taxRate = value - 0 //税率
-        //   taxMoney = (taxRate * 0.01 * allPrice).toFixed(2) - 0
-        //   taxLastMoney = (allPrice + taxMoney).toFixed(2) - 0
-        //   target.setValues([{ rowKey: row.id, values: { taxMoney: taxMoney, taxLastMoney: taxLastMoney } }])
-        //   target.recalcAllStatisticsColumns()
-        //   that.autoChangePrice(target)
-        //   break
-        // case 'taxLastMoney':
-        //   console.log('taxLastMoney---------')
-        //   operNumber = row.operNumber - 0 //数量
-        //   taxLastMoney = value - 0
-        //   taxRate = row.taxRate - 0 //税率
-        //   if (taxRate) {
-        //     unitPrice = (taxLastMoney / operNumber / (1 + taxRate * 0.01)).toFixed(2) - 0
-        //     allPrice = (unitPrice * operNumber).toFixed(2) - 0
-        //     taxMoney = (taxLastMoney - allPrice).toFixed(2) - 0
-        //   } else {
-        //     //税率为0的情况,特殊处理
-        //     allPrice = taxLastMoney
-        //     unitPrice = (allPrice / operNumber).toFixed(2) - 0 //单价
-        //     taxMoney = 0
-        //   }
-        //   target.setValues([
-        //     { rowKey: row.id, values: { unitPrice: unitPrice, allPrice: allPrice, taxMoney: taxMoney } },
-        //   ])
-        //   target.recalcAllStatisticsColumns()
-        //   that.autoChangePrice(target)
-        //   break
-        // case 'unit':
-        //   // 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: { unitName: i.name } }])
-        //     //   }
-        //     // }
-        //   }
-
-        //   target.$forceUpdate()
       }
     },
     //转为商品对象
     parseInfoToObj(mInfo) {
       return {
-        barCode: mInfo.barCode,
+        sku: mInfo.sku,
         name: mInfo.name,
         standard: mInfo.standard,
         model: mInfo.model,
@@ -729,7 +589,6 @@ export const BillModalMixin = {
         brand: mInfo.brand,
         materialOther: mInfo.materialOther,
         unit: mInfo.commodityUnit,
-        sku: mInfo.sku,
         operNumber: 1,
         unitPrice: mInfo.billPrice, //单价
         wholesaleDecimal:mInfo.defaultWholesaleDecimal, //销售价
@@ -756,9 +615,7 @@ export const BillModalMixin = {
       this.changeFormTypes(this.materialTable.columns, 'model', 0)
       this.changeFormTypes(this.materialTable.columns, 'color', 0)
       this.changeFormTypes(this.materialTable.columns, 'brand', 0)
-      this.changeFormTypes(this.materialTable.columns, 'mfrs', 0)
       this.changeFormTypes(this.materialTable.columns, 'materialOther', 0)
-      this.changeFormTypes(this.materialTable.columns, 'sku', 0)
     },
     //使得sku、序列号、批号、到期日等为显示
     changeColumnShow(info) {
@@ -774,9 +631,6 @@ export const BillModalMixin = {
       if (info.brand) {
         this.changeFormTypes(this.materialTable.columns, 'brand', 1)
       }
-      if (info.mfrs) {
-        this.changeFormTypes(this.materialTable.columns, 'mfrs', 1)
-      }
       if (info.materialOther) {
         this.changeFormTypes(this.materialTable.columns, 'materialOther', 1)
       }

+ 3 - 3
jshERP-web/src/views/bill/modules/AllocationOutModal.vue

@@ -60,14 +60,14 @@
               style="float: left"
               data-step="4"
               data-title="扫码录入"
-              data-intro="此功能支持扫码枪扫描商品条码进行录入"
+              data-intro="此功能支持扫码枪扫描SKU进行录入"
             >
               <a-col v-if="scanStatus" :md="6" :sm="24">
                 <a-button @click="scanEnter">扫码录入</a-button>
               </a-col>
               <a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 6px 0 12px">
                 <a-input
-                  placeholder="请扫描商品条码并回车"
+                  placeholder="请扫描SKU并回车"
                   v-model="scanBarCode"
                   @pressEnter="scanPressEnter"
                   ref="scanBarCode"
@@ -223,7 +223,7 @@ export default {
 
           { title: '生产日期', key: 'productionDate', width: '9%', type: FormTypes.normal, disabled: true },
           { title: '保质期', key: 'expiryNum', width: '6%', type: FormTypes.normal },
-          { title: '商品条码', key: 'barCode', width: '9%', type: FormTypes.normal },
+          { title: 'SKU', key: 'barCode', width: '9%', type: FormTypes.normal },
           { title: '仓库名', key: 'depotId', width: '9%', type: FormTypes.select, disabled: true },
           { title: '仓库货架', key: 'position', width: '6%', type: FormTypes.normal },
           { title: '包装规格', key: 'unitName', width: '7%', type: FormTypes.normal },

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

@@ -58,14 +58,14 @@
               style="float: left"
               data-step="4"
               data-title="扫码录入"
-              data-intro="此功能支持扫码枪扫描商品条码进行录入"
+              data-intro="此功能支持扫码枪扫描SKU进行录入"
             >
               <a-col v-if="scanStatus" :md="6" :sm="24">
                 <a-button @click="scanEnter">扫码录入</a-button>
               </a-col>
               <a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 6px 0 12px">
                 <a-input
-                  placeholder="请扫描商品条码并回车"
+                  placeholder="请扫描SKU并回车"
                   v-model="scanBarCode"
                   @pressEnter="scanPressEnter"
                   ref="scanBarCode"

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

@@ -58,14 +58,14 @@
               style="float: left"
               data-step="4"
               data-title="扫码录入"
-              data-intro="此功能支持扫码枪扫描商品条码进行录入"
+              data-intro="此功能支持扫码枪扫描SKU进行录入"
             >
               <a-col v-if="scanStatus" :md="6" :sm="24">
                 <a-button @click="scanEnter">扫码录入</a-button>
               </a-col>
               <a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 6px 0 12px">
                 <a-input
-                  placeholder="请扫描商品条码并回车"
+                  placeholder="请扫描SKU并回车"
                   v-model="scanBarCode"
                   @pressEnter="scanPressEnter"
                   ref="scanBarCode"

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

@@ -125,14 +125,14 @@
               style="float: left"
               data-step="4"
               data-title="扫码录入"
-              data-intro="此功能支持扫码枪扫描商品条码进行录入"
+              data-intro="此功能支持扫码枪扫描SKU进行录入"
             >
               <a-col v-if="scanStatus" :md="6" :sm="24">
                 <a-button @click="scanEnter">扫码录入</a-button>
               </a-col>
               <a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 8px 0 12px">
                 <a-input
-                  placeholder="请扫描商品条码并回车"
+                  placeholder="请扫描SKU并回车"
                   v-model="scanBarCode"
                   @pressEnter="scanPressEnter"
                   ref="scanBarCode"
@@ -310,11 +310,11 @@ export default {
         dataSource: [],
         columns: [
           {
-            title: '商品条码',
-            key: 'barCode',
+            title: 'SKU',
+            key: 'sku',
             width: '200px',
             type: FormTypes.popupJsh,
-            kind: 'material2',
+            kind: 'material',
             multi: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },

+ 4 - 27
jshERP-web/src/views/bill/modules/OtherOutModal.vue

@@ -125,7 +125,7 @@
               style="float: left"
               data-step="4"
               data-title="扫码录入"
-              data-intro="此功能支持扫码枪扫描商品条码进行录入"
+              data-intro="此功能支持扫码枪扫描SKU进行录入"
             >
               <a-col v-if="scanStatus" :md="6" :sm="24">
                 <a-button @click="scanEnter">扫码录入</a-button>
@@ -315,33 +315,18 @@ export default {
         loading: false,
         dataSource: [],
         columns: [
-          // {
-          //   title: '仓库名称',
-          //   key: 'depotId',
-          //   width: '8%',
-          //   type: FormTypes.select,
-          //   placeholder: '请选择${title}',
-          //   options: [],
-          //   allowSearch: true,
-          //   validateRules: [{ required: true, message: '${title}不能为空' }],
-          // },
           {
-            title: '商品条码',
-            key: 'barCode',
+            title: 'SKU',
+            key: 'sku',
             width: '200px',
             type: FormTypes.popupJsh,
-            kind: 'material2',
+            kind: 'material',
             multi: true,
             newBatch: true,
-
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
           { title: '名称', key: 'name', width: '120px', type: FormTypes.normal },
           // { title: '规格', key: 'standard', width: '9%', type: FormTypes.normal },
-
-          // { title: '生产日期', key: 'productionDate', width: '200px', type: FormTypes.normal, disabled: true },
-          // { title: '保质期', key: 'expiryNum', width: '120px', type: FormTypes.normal },
-          // { title: '商品条码', key: 'barCode', width: '9%', type: FormTypes.normal },
           { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' }], },
           { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
           { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
@@ -365,7 +350,6 @@ export default {
           { title: '单位id', key: 'unitId', width: '120px', type: FormTypes.hidden },
           { title: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
           { title: '序列号', key: 'snList', width: '120px', type: FormTypes.popupJsh, kind: 'sn', multi: true },
-          // { title: '有效期', key: 'expirationDate', width: '120px', type: FormTypes.date, readonly: true },
           { title: '多属性', key: 'sku', width: '120px', type: FormTypes.normal },
           { title: '原数量', key: 'preNumber', width: '120px', type: FormTypes.normal },
           { title: '已入库', key: 'finishNumber', width: '120px', type: FormTypes.normal },
@@ -379,13 +363,6 @@ export default {
           },
           { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }], },
           { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber, disabled: true, statistics: true },
-          // {
-          //   title: '实际出库数量',
-          //   key: 'actualQuantityInStorage',
-          //   width: '120px',
-          //   type: FormTypes.inputNumber,
-          //   validateRules: [{ required: true, message: '实际入库数量不能为空' }],
-          // },
           { title: '出库差异', key: 'warehousingVariance', width: '120px', type: FormTypes.hidden },
           { title: '出库差异原因', key: 'reasonOfDifference', width: '120px', type: FormTypes.hidden },
           {

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

@@ -68,14 +68,14 @@
               style="float: left; padding-bottom: 5px"
               data-step="4"
               data-title="扫码录入"
-              data-intro="此功能支持扫码枪扫描商品条码进行录入"
+              data-intro="此功能支持扫码枪扫描SKU进行录入"
             >
               <a-col v-if="scanStatus" :md="6" :sm="24">
                 <a-button @click="scanEnter">扫码录入</a-button>
               </a-col>
               <a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 8px 0 12px">
                 <a-input
-                  placeholder="请扫描商品条码并回车"
+                  placeholder="请扫描SKU并回车"
                   v-model="scanBarCode"
                   @pressEnter="scanPressEnter"
                   ref="scanBarCode"

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

@@ -96,7 +96,7 @@
               style="float: left; padding-bottom: 5px"
               data-step="4"
               data-title="扫码录入"
-              data-intro="此功能支持扫码枪扫描商品条码进行录入"
+              data-intro="此功能支持扫码枪扫描SKU进行录入"
             >
               <a-col v-if="scanStatus" :md="6" :sm="24">
                 <a-button @click="scanEnter" style="margin-right: 8px">扫码录入</a-button>

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

@@ -149,14 +149,14 @@
               style="float: left; padding-bottom: 5px"
               data-step="4"
               data-title="扫码录入"
-              data-intro="此功能支持扫码枪扫描商品条码进行录入"
+              data-intro="此功能支持扫码枪扫描SKU进行录入"
             >
               <a-col v-if="scanStatus" :md="6" :sm="24">
                 <a-button @click="scanEnter">扫码录入</a-button>
               </a-col>
               <a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 8px 0 12px">
                 <a-input
-                  placeholder="请扫描商品条码并回车"
+                  placeholder="请扫描SKU并回车"
                   v-model="scanBarCode"
                   @pressEnter="scanPressEnter"
                   ref="scanBarCode"
@@ -501,14 +501,13 @@ export default {
         dataSource: [],
         columns: [
           {
-            title: '商品条码',
-            key: 'barCode',
+            title: 'SKU',
+            key: 'sku',
             width: '200px',
             type: FormTypes.popupJsh,
-            kind: 'material2',
+            kind: 'material',
             multi: true,
             newBatch: true,
-
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
           { title: '名称', key: 'name', width: '120px', type: FormTypes.normal },

+ 5 - 13
jshERP-web/src/views/bill/modules/PurchaseOrderModal.vue

@@ -166,14 +166,14 @@
               style="float: left; padding-bottom: 5px"
               data-step="4"
               data-title="扫码录入"
-              data-intro="此功能支持扫码枪扫描商品条码进行录入"
+              data-intro="此功能支持扫码枪扫描SKU进行录入"
             >
               <a-col v-if="scanStatus" :md="6" :sm="24">
                 <a-button @click="scanEnter">扫码录入</a-button>
               </a-col>
               <a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 8px 0 12px">
                 <a-input
-                  placeholder="请扫描商品条码并回车"
+                  placeholder="请扫描SKU并回车"
                   v-model="scanBarCode"
                   @pressEnter="scanPressEnter"
                   ref="scanBarCode"
@@ -470,11 +470,11 @@ export default {
         dataSource: [],
         columns: [
           {
-            title: '商品条码',
-            key: 'barCode',
+            title: 'SKU',
+            key: 'sku',
             width: '200px',
             type: FormTypes.popupJsh,
-            kind: 'material2',
+            kind: 'material',
             multi: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
@@ -514,9 +514,6 @@ export default {
           },
           { title: '单位id', key: 'unitId', width: '120px', type: FormTypes.hidden },
           { title: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
-          { title: '多属性', key: 'sku', width: '120px', type: FormTypes.normal },
-          { title: '原数量', key: 'preNumber', width: '120px', type: FormTypes.normal },
-          { title: '已采购', key: 'finishNumber', width: '120px', type: FormTypes.normal },
           {
             title: '入库数量',
             key: 'operNumber',
@@ -572,10 +569,7 @@ export default {
       console.log('this.model======',this.model)
       this.billStatus = '0'
       this.rowCanEdit = true
-      // this.materialTable.columns[1].type = FormTypes.popupJsh
       this.changeColumnHide()
-      this.changeFormTypes(this.materialTable.columns, 'preNumber', 0)
-      this.changeFormTypes(this.materialTable.columns, 'finishNumber', 0)
       if (this.action === 'add') {
         this.addInit(this.prefixNo)
         this.fileList = []
@@ -697,8 +691,6 @@ export default {
     linkBillListOk(selectBillDetailRows, linkNumber, organId) {
       this.rowCanEdit = false
       this.materialTable.columns[1].type = FormTypes.normal
-      this.changeFormTypes(this.materialTable.columns, 'preNumber', 1)
-      this.changeFormTypes(this.materialTable.columns, 'finishNumber', 1)
       if (selectBillDetailRows && selectBillDetailRows.length > 0) {
         let discountLastMoney = 0
         for (let j = 0; j < selectBillDetailRows.length; j++) {

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

@@ -98,14 +98,14 @@
                   style="float: left; padding-bottom: 5px"
                   data-step="4"
                   data-title="扫码录入"
-                  data-intro="此功能支持扫码枪扫描商品条码进行录入"
+                  data-intro="此功能支持扫码枪扫描SKU进行录入"
                 >
                   <a-col v-if="scanStatus" :md="6" :sm="24">
                     <a-button @click="scanEnter" style="margin-right: 8px">扫码录入</a-button>
                   </a-col>
                   <a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 6px 0 12px">
                     <a-input
-                      placeholder="请扫描商品条码并回车"
+                      placeholder="请扫描SKU并回车"
                       v-model="scanBarCode"
                       @pressEnter="scanPressEnter"
                       ref="scanBarCode"

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

@@ -118,7 +118,7 @@
                   style="float: left"
                   data-step="4"
                   data-title="扫码录入"
-                  data-intro="此功能支持扫码枪扫描商品条码进行录入"
+                  data-intro="此功能支持扫码枪扫描SKU进行录入"
                 >
                   <a-col v-if="scanStatus" :md="6" :sm="24">
                     <a-button @click="scanEnter">扫码录入</a-button>

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

@@ -97,14 +97,14 @@
               style="float: left; padding-bottom: 5px"
               data-step="4"
               data-title="扫码录入"
-              data-intro="此功能支持扫码枪扫描商品条码进行录入"
+              data-intro="此功能支持扫码枪扫描SKU进行录入"
             >
               <a-col v-if="scanStatus" :md="6" :sm="24">
                 <a-button @click="scanEnter" style="margin-right: 8px">扫码录入</a-button>
               </a-col>
               <a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 8px 0 12px">
                 <a-input
-                  placeholder="请扫描商品条码并回车"
+                  placeholder="请扫描SKU并回车"
                   v-model="scanBarCode"
                   @pressEnter="scanPressEnter"
                   ref="scanBarCode"

+ 8 - 59
jshERP-web/src/views/bill/modules/SaleOrderModal.vue

@@ -146,14 +146,14 @@
               style="float: left; padding-bottom: 5px"
               data-step="4"
               data-title="扫码录入"
-              data-intro="此功能支持扫码枪扫描商品条码进行录入"
+              data-intro="此功能支持扫码枪扫描SKU进行录入"
             >
               <a-col v-if="scanStatus" :md="6" :sm="24">
                 <a-button @click="scanEnter">扫码录入</a-button>
               </a-col>
               <a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 8px 0 12px">
                 <a-input
-                  placeholder="请扫描商品条码并回车"
+                  placeholder="请扫描SKU并回车"
                   v-model="scanBarCode"
                   @pressEnter="scanPressEnter"
                   ref="scanBarCode"
@@ -189,23 +189,6 @@
               </a-tooltip>
             </a-input>
           </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">
@@ -428,22 +411,16 @@ export default {
         loading: false,
         dataSource: [],
         columns: [
-          // { title: '', key: 'hiddenKey', width: '1%', type: FormTypes.hidden },
           {
-            title: '商品条码',
-            key: 'barCode',
+            title: 'SKU',
+            key: 'sku',
             width: '200px',
             type: FormTypes.popupJsh,
-            kind: 'material2',
+            kind: 'material',
             multi: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
           { title: '名称', key: 'name', width: '120px', type: FormTypes.normal },
-          // { title: '规格', key: 'standard', width: '9%', type: FormTypes.normal },
-
-          // { title: '生产日期', key: 'productionDate', width: '6%', type: FormTypes.normal },
-          // { title: '保质期', key: 'expiryNum', width: '6%', type: FormTypes.normal },
-          // { title: '商品条码', key: 'barCode', width: '6%', type: FormTypes.normal },
           { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.slot },
           { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
           { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
@@ -451,7 +428,6 @@ export default {
           { title: '型号', key: 'model', width: '120px', type: FormTypes.normal },
           { title: '颜色', key: 'color', width: '120px', type: FormTypes.normal },
           { title: '品牌', key: 'brand', width: '120px', type: FormTypes.normal },
-          { title: '制造商', key: 'mfrs', width: '120px', type: FormTypes.normal },
           { title: '扩展信息', key: 'materialOther', width: '120px', type: FormTypes.normal },
           { title: '库存', key: 'stock', width: '120px', type: FormTypes.normal },
           {
@@ -463,24 +439,16 @@ export default {
             // allowClear: false,
             // slotName: 'unit',
           },
-          // { title: '单位id', key: 'unitId', width: '120px', type: FormTypes.hidden },
-          // { title: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
-          // { title: '序列号', key: 'snList', width: '120px', type: FormTypes.popupJsh, kind: 'sn', multi: true },
-          // { title: '有效期', key: 'expirationDate', width: '7%', type: FormTypes.input, readonly: true },
-          // { title: '多属性', key: 'sku', width: '120px', type: FormTypes.normal },
-          // { title: '原数量', key: 'preNumber', width: '4%', type: FormTypes.normal },
-          // { title: '已出库', key: 'finishNumber', width: '4%', type: FormTypes.normal },
           {
             title: '出库数量',
             key: 'operNumber',
             width: '120px',
             type: FormTypes.inputNumber,
-            statistics: true,
+            // statistics: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
           { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }], },
           { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber, disabled: true, statistics: true },
-          { title: '税率', key: 'taxRate', width: '120px', type: FormTypes.hidden, placeholder: '%' },
           {
             title: '税额',
             key: 'taxMoney',
@@ -490,26 +458,9 @@ export default {
             statistics: true,
           },
           { title: '价税合计', key: 'taxLastMoney', width: '120px', type: FormTypes.inputNumber, disabled: true, statistics: true },
-
-          // {
-          //   title: '实际出库数量',
-          //   key: 'actualQuantityInStorage',
-          //   width: '9%',
-          //   type: FormTypes.inputNumber,
-          //   validateRules: [{ required: true, message: '实际入库数量不能为空' }],
-          // },
-          // { title: '出库差异', key: 'warehousingVariance', width: '9%', type: FormTypes.input },
-          // { title: '出库差异原因', key: 'reasonOfDifference', width: '9%', type: FormTypes.input },
-          // {
-          //   title: '出库人',
-          //   key: 'warehousingUser',
-          //   width: '9%',
-          //   type: FormTypes.input,
-          //   validateRules: [{ required: true, message: '出库人不能为空' }],
-          // },
-          // { title: '出库时间', key: 'warehousingTime', width: '9%', type: FormTypes.date },
-
           { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
+          // 下方hidden的列配置不要去掉,后续取数据需要用到
+          { title: '税率', key: 'taxRate', width: '120px', type: FormTypes.hidden, placeholder: '%' },
           { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
           { title: '默认销售价', key: 'defaultWholesaleDecimal', width: '120px', type: FormTypes.hidden },
           { title: '默认采购价', key: 'defaultPurchaseDecimal', width: '120px', type: FormTypes.hidden },
@@ -541,8 +492,6 @@ export default {
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
       this.billStatus = '0'
-      
-      this.changeColumnHide()
       if (this.action === 'add') {
         this.addInit(this.prefixNo)
         this.personList.value = ''

+ 5 - 39
jshERP-web/src/views/bill/modules/SaleOutModal.vue

@@ -150,7 +150,7 @@
               style="float: left; padding-bottom: 5px"
               data-step="4"
               data-title="扫码录入"
-              data-intro="此功能支持扫码枪扫描商品条码进行录入"
+              data-intro="此功能支持扫码枪扫描SKU进行录入"
             >
               <a-col v-if="scanStatus" :md="6" :sm="24">
                 <a-button @click="scanEnter">扫码录入</a-button>
@@ -178,15 +178,6 @@
               <a-button icon="import" @click="onImport(prefixNo)">导入明细</a-button>
             </a-row>
           </template>
-          <!-- <template #depotBatchSet>
-            <a-icon type="down" @click="handleBatchSetDepot" />
-          </template> -->
-          <!-- <template #depotAdd>
-            <a-divider v-if="quickBtn.depot" style="margin: 4px 0" />
-            <div v-if="quickBtn.depot" style="padding: 4px 8px; cursor: pointer" @click="addDepot">
-              <a-icon type="plus" /> 新增仓库
-            </div>
-          </template> -->
           <template #unit="{ handleChange, handleFocus, value }">
             <a-select
               placeholder="请选择"
@@ -536,22 +527,17 @@ export default {
         dataSource: [],
         columns: [
           {
-            title: '商品条码',
-            key: 'barCode',
+            title: 'SKU',
+            key: 'sku',
             width: '200px',
             type: FormTypes.popupJsh,
-            kind: 'material2',
+            kind: 'material',
             multi: true,
             newBatch: true,
-
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
           { title: '名称', key: 'name', width: '120px', type: FormTypes.normal },
           // { title: '规格', key: 'standard', width: '9%', type: FormTypes.normal },
-
-          // { title: '生产日期', key: 'productionDate', width: '9%', type: FormTypes.normal, disabled: true },
-          // { title: '保质期', key: 'expiryNum', width: '6%', type: FormTypes.normal },
-          // { title: '商品条码', key: 'barCode', width: '9%', type: FormTypes.normal },
           { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.slot },
           { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
           { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
@@ -573,17 +559,12 @@ export default {
           },
           { title: '单位id', key: 'unitId', width: '120px', type: FormTypes.hidden },
           { title: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
-          { title: '序列号', key: 'snList', width: '120px', type: FormTypes.popupJsh, kind: 'sn', multi: true },
-          // { title: '有效期', key: 'expirationDate', width: '7%', type: FormTypes.input, readonly: true },
-          { title: '多属性', key: 'sku', width: '120px', type: FormTypes.normal },
-          { title: '原数量', key: 'preNumber', width: '120px', type: FormTypes.normal },
-          { title: '已出库', key: 'finishNumber', width: '120px', type: FormTypes.normal },
           {
             title: '出库数量',
             key: 'operNumber',
             width: '120px',
             type: FormTypes.inputNumber,
-            statistics: true,
+            // statistics: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
           { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }], },
@@ -598,14 +579,6 @@ export default {
             statistics: true,
           },
           { title: '价税合计', key: 'taxLastMoney', width: '120px', type: FormTypes.inputNumber, disabled: true, statistics: true },
-
-          // {
-          //   title: '实际出库数量',
-          //   key: 'actualQuantityInStorage',
-          //   width: '120px',
-          //   type: FormTypes.inputNumber,
-          //   validateRules: [{ required: true, message: '实际入库数量不能为空' }],
-          // },
           { title: '出库差异', key: 'warehousingVariance', width: '120px', type: FormTypes.hidden },
           { title: '出库差异原因', key: 'reasonOfDifference', width: '120px', type: FormTypes.hidden },
           {
@@ -662,11 +635,6 @@ export default {
       this.rowCanEdit = true
       this.materialTable.columns[0].type = FormTypes.popupJsh
       this.changeColumnHide()
-      this.changeFormTypes(this.materialTable.columns, 'snList', 0)
-      // this.changeFormTypes(this.materialTable.columns, 'batchNumber', 0)
-      this.changeFormTypes(this.materialTable.columns, 'expirationDate', 0)
-      this.changeFormTypes(this.materialTable.columns, 'preNumber', 0)
-      this.changeFormTypes(this.materialTable.columns, 'finishNumber', 0)
       if (this.action === 'add') {
         this.depositStatus = false
         this.addInit(this.prefixNo)
@@ -818,8 +786,6 @@ export default {
       let that = this
       this.rowCanEdit = false
       // this.materialTable.columns[1].type = FormTypes.normal
-      // this.changeFormTypes(this.materialTable.columns, 'preNumber', 1)
-      // this.changeFormTypes(this.materialTable.columns, 'finishNumber', 1)
       if (selectBillDetailRows && selectBillDetailRows.length > 0) {
         let listEx = []
         let allTaxLastMoney = 0

+ 7 - 31
jshERP-web/src/views/material/MaterialList.vue

@@ -293,19 +293,15 @@ export default {
       // 默认索引
       defDataIndex: [
         'action',
-        'barCode',
         'name',
-        'standard',
-        'model',
-        'color',
+        'brand',
+        'systemSpu',
+        'mnemonic',
         'categoryName',
         'materialOther',
-        'unit',
         'stock',
         'defaultPurchaseDecimal',
-        'commodityDecimal',
         'defaultWholesaleDecimal',
-        'lowDecimal',
         'enabled',
         'reminder'
       ],
@@ -318,34 +314,14 @@ export default {
           width: 100,
           scopedSlots: { customRender: 'action' },
         },
-        { title: '图片', dataIndex: 'pic', width: 60, scopedSlots: { customRender: 'customPic' } },
-        { title: '条码', dataIndex: 'barCode', width: 120 },
+        { title: '图片', dataIndex: 'pic', width: 80, scopedSlots: { customRender: 'customPic' } },
         { title: '名称', dataIndex: 'name', width: 160, scopedSlots: { customRender: 'customName' } },
-        { title: '系统SKU', dataIndex: 'systemSku', width: 120 },
-        { title: '规格', dataIndex: 'standard', width: 120 },
-        { title: '型号', dataIndex: 'model', width: 120 },
-        { title: '颜色', dataIndex: 'color', width: 70, ellipsis: true },
-        { title: '品牌', dataIndex: 'brand', width: 100, ellipsis: true },
+        { title: '品牌', dataIndex: 'brand', width: 120, ellipsis: true},
+        { title: '系统SPU', dataIndex: 'systemSpu', width: 120 },
         { title: '助记码', dataIndex: 'mnemonic', width: 80, ellipsis: true },
         { title: '类别', dataIndex: 'categoryName', width: 100, ellipsis: true },
         { title: '扩展信息', dataIndex: 'materialOther', width: 100, ellipsis: true },
-        {
-          title: '单位',
-          dataIndex: 'unit',
-          width: 100,
-          ellipsis: true,
-          customRender: function (t, r, index) {
-            if (r) {
-              let name = t ? t : r.unitName
-              if (r.sku) {
-                return name + '[SKU]'
-              } else {
-                return name
-              }
-            }
-          },
-        },
-        { title: '基础重量', dataIndex: 'weight', width: 80 },
+        { title: '重量(kg)', dataIndex: 'weight', width: 80 },
         {
           title: '初始库存',
           dataIndex: 'initialStock',

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

@@ -13,22 +13,6 @@ export const MaterialModalMixins = {
     }
   },
   methods: {
-    addVendor() {
-      this.$refs.vendorModalForm.add()
-      this.$refs.vendorModalForm.title = '新增供应商'
-      this.$refs.vendorModalForm.disableSubmit = false
-    },
-    addDepot() {
-      this.$refs.depotModalForm.add()
-      this.$refs.depotModalForm.title = '新增仓库'
-      this.$refs.depotModalForm.disableSubmit = false
-    },
-    vendorModalFormOk() {
-      this.initSupplier(1)
-    },
-    depotModalFormOk() {
-      this.initDepot()
-    },
     initSupplier() {
       let that = this
       findBySelectSup({}).then((res) => {

+ 1 - 28
jshERP-web/src/views/material/modules/BatchSetInfoModal.vue

@@ -20,21 +20,6 @@
         <a-form :form="form">
           <a-row class="form-row" :gutter="24">
             <a-col :md="8" :sm="24">
-              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="颜色">
-                <a-input placeholder="请输入颜色" v-decorator.trim="['color']" />
-              </a-form-item>
-            </a-col>
-            <a-col :md="8" :sm="24">
-              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="基础重量">
-                <a-input-number style="width: 100%" placeholder="请输入基础重量(kg)" v-decorator.trim="['weight']" />
-              </a-form-item>
-            </a-col>
-            <a-col :md="8" :sm="24">
-              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="保质期">
-                <a-input-number style="width: 100%" placeholder="请输入保质期(天)" v-decorator.trim="['expiryNum']" />
-              </a-form-item>
-            </a-col>
-            <a-col :md="8" :sm="24">
               <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="类别">
                 <a-tree-select
                   style="width: 100%"
@@ -56,16 +41,8 @@
               </a-form-item>
             </a-col>
             <a-col :md="8" :sm="24">
-              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="批号">
-                <a-select placeholder="有无批号" v-decorator="['enableBatchNumber']">
-                  <a-select-option value="1">有</a-select-option>
-                  <a-select-option value="0">无</a-select-option>
-                </a-select>
-              </a-form-item>
-            </a-col>
-            <a-col :md="8" :sm="24">
               <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
-                <a-textarea :rows="1" placeholder="请输入备注" v-decorator="['remark']" style="margin-top: 8px" />
+                <a-textarea :rows="1" placeholder="请输入备注" v-decorator="['remark']" />
               </a-form-item>
             </a-col>
           </a-row>
@@ -137,10 +114,6 @@ export default {
             that.$message.warning('抱歉,请输入要批量编辑的内容!')
             return
           }
-          if (formData.enableSerialNumber === '1' && formData.enableBatchNumber === '1') {
-            that.$message.warning('抱歉,序列号和批号只能选择一项!')
-            return
-          }
           let idList = that.materialIds ? that.materialIds.split(',') : []
           that.$confirm({
             title: '确认操作',

+ 210 - 378
jshERP-web/src/views/material/modules/MaterialModal.vue

@@ -18,7 +18,7 @@
     </template>
     <a-spin :spinning="confirmLoading">
       <a-form :form="form">
-        <a-tabs default-active-key="1" size="small">
+        <a-tabs default-active-key="1" size="small" v-model="activeKey">
           <a-tab-pane key="1" tab="基本信息" id="materialHeadModal" forceRender>
             <a-row class="form-row" :gutter="24">
               <a-col :xl="6" :lg="8" :md="12" :sm="24">
@@ -41,94 +41,8 @@
                 <a-form-item
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
-                  label="规格"
-                  data-step="2"
-                  data-title="规格"
-                  data-intro="规格不必填,比如:10克"
-                >
-                  <a-input placeholder="请输入规格" v-decorator.trim="['standard', validatorRules.standard]" />
-                </a-form-item>
-              </a-col>
-              <a-col :xl="6" :lg="8" :md="12" :sm="24">
-                <a-form-item
-                  :labelCol="labelCol"
-                  :wrapperCol="wrapperCol"
-                  label="型号"
-                  data-step="3"
-                  data-title="型号"
-                  data-intro="型号是比规格更小的属性,比如:RX-01"
-                >
-                  <a-input placeholder="请输入型号" v-decorator.trim="['model', validatorRules.model]" />
-                </a-form-item>
-              </a-col>
-              <a-col :xl="6" :lg="8" :md="12" :sm="24">
-                <a-form-item
-                  :labelCol="labelCol"
-                  :wrapperCol="wrapperCol"
-                  label="单位"
-                  data-step="4"
-                  data-title="单位"
-                  data-intro="此处支持单个单位和多单位,勾选多单位就可以切换到多单位的下拉框,多单位需要先在【多单位】页面进行录入。
-                  比如牛奶有瓶和箱两种单位,12瓶=1箱,这就构成了多单位,多单位中有个换算比例"
-                >
-                  <a-row class="form-row" :gutter="24">
-                    <a-col :lg="15" :md="15" :sm="24" style="padding: 0px 0px 0px 12px">
-                      <a-input
-                        placeholder="输入单位"
-                        v-if="!unitChecked"
-                        v-decorator.trim="['unit', validatorRules.unit]"
-                        @change="onlyUnitOnChange"
-                      />
-                      <a-select
-                        :value="unitList"
-                        placeholder="选择多单位"
-                        v-decorator="['unitId', validatorRules.unitId]"
-                        @change="manyUnitOnChange"
-                        showSearch
-                        optionFilterProp="children"
-                        v-if="unitChecked"
-                        :dropdownMatchSelectWidth="false"
-                      >
-                        <div slot="dropdownRender" slot-scope="menu">
-                          <v-nodes :vnodes="menu" />
-                          <a-divider style="margin: 4px 0" />
-                          <div
-                            style="padding: 4px 8px; cursor: pointer"
-                            @mousedown="(e) => e.preventDefault()"
-                            @click="addUnit"
-                          >
-                            <a-icon type="plus" /> 新增多单位
-                          </div>
-                        </div>
-                        <a-select-option v-for="(item, index) in unitList" :key="index" :value="item.id">
-                          {{ item.name }}
-                        </a-select-option>
-                      </a-select>
-                    </a-col>
-                    <a-col :lg="9" :md="9" :sm="24" style="padding: 0px; text-align: center">
-                      <a-checkbox :checked="unitChecked" @change="unitOnChange">多单位</a-checkbox>
-                    </a-col>
-                  </a-row>
-                </a-form-item>
-              </a-col>
-              <a-col :xl="6" :lg="8" :md="12" :sm="24">
-                <a-form-item
-                  :labelCol="labelCol"
-                  :wrapperCol="wrapperCol"
-                  label="颜色"
-                  data-step="6"
-                  data-title="颜色"
-                  data-intro="请填写商品的颜色,如果是多属性商品可以不填(下面有多属性开关)"
-                >
-                  <a-input placeholder="请输入颜色" v-decorator.trim="['color']" />
-                </a-form-item>
-              </a-col>
-              <a-col :xl="6" :lg="8" :md="12" :sm="24">
-                <a-form-item
-                  :labelCol="labelCol"
-                  :wrapperCol="wrapperCol"
                   label="品牌"
-                  data-step="7"
+                  data-step="2"
                   data-title="品牌"
                   data-intro="请填写商品的品牌,方便区别不同品牌的商品"
                 >
@@ -140,7 +54,7 @@
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
                   label="助记码"
-                  data-step="8"
+                  data-step="3"
                   data-title="助记码"
                   data-intro="助记码自动生成,助记码是商品名称的首字母缩写"
                 >
@@ -152,7 +66,7 @@
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
                   label="类别"
-                  data-step="9"
+                  data-step="4"
                   data-title="类别"
                   data-intro="类别需要在【商品类别】页面进行录入,录入之后在此处进行调用"
                 >
@@ -171,20 +85,8 @@
                 <a-form-item
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
-                  label="基础重量"
-                  data-step="10"
-                  data-title="基础重量"
-                  data-intro="请填写基本单位对应的重量,用于计算按重量分摊费用时单据中各行商品分摊的费用成本"
-                >
-                  <a-input-number style="width: 100%" placeholder="请输入基础重量(kg)" v-decorator.trim="['weight']" />
-                </a-form-item>
-              </a-col>
-              <a-col :xl="6" :lg="8" :md="12" :sm="24">
-                <a-form-item
-                  :labelCol="labelCol"
-                  :wrapperCol="wrapperCol"
                   label="序列号"
-                  data-step="11"
+                  data-step="5"
                   data-title="序列号"
                   data-intro="此处是商品的序列号开关,如果选择了有,则在采购入库单据需要录入该商品的序列号,在销售出库单据需要选择该商品的序列号进行出库"
                 >
@@ -200,20 +102,26 @@
                 <a-form-item
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
-                  label="系统SKU"
-                  data-step="12"
-                  data-title="系统SKU"
-                  data-intro="系统SKU"
+                  label="系统SPU"
+                  data-step="6"
+                  data-title="系统SPU"
+                  data-intro="系统SPU"
                 >
-                  <a-input placeholder="提交后自动生成" disabled v-decorator="['systemSku']" />
+                  <a-input placeholder="提交后自动生成" disabled v-decorator="['systemSpu']" />
                 </a-form-item>
               </a-col>
               <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
-                  :labelCol="labelCol"
-                  :wrapperCol="wrapperCol"
+                  :labelCol="{
+                    xs: { span: 24 },
+                    sm: { span: 10 },
+                  }"
+                  :wrapperCol="{
+                    xs: { span: 24 },
+                    sm: { span: 14 },
+                  }"
                   label="无动销提醒周期"
-                  data-step="13"
+                  data-step="7"
                   data-title="无动销提醒周期"
                   data-intro="无动销提醒周期"
                 >
@@ -232,7 +140,7 @@
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
                   label="保质期(天)"
-                  data-step="14"
+                  data-step="8"
                   data-title="保质期(天)"
                   data-intro="保质期(天)"
                 >
@@ -244,7 +152,7 @@
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
                   label="默认采购价"
-                  data-step="15"
+                  data-step="9"
                   data-title="默认采购价"
                   data-intro="默认采购价"
                 > 
@@ -256,7 +164,7 @@
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
                   label="默认销售价"
-                  data-step="16"
+                  data-step="10"
                   data-title="默认销售价"
                   data-intro="默认销售价"
                 >
@@ -312,28 +220,29 @@
               :columns="mbTable.columns"
               :dataSource="mbTable.dataSource"
               :height="300"
-              :minWidth="1000"
+              minWidth="100%"
               :maxHeight="300"
               :rowNumber="false"
               :rowSelection="true"
               :actionButton="true"
-              @added="onAdded"
-              @deleted="onDeleted"
+              @added="handleMbTableAdded"
             >
-            <template #ratio="{ handleChange, value }">
-              <a-select
-                  v-if="unitChecked"
-                  placeholder="请选择"
-                  :dropdownMatchSelectWidth="false"
-                  showSearch
-                  :value="value"
-                  @change="($event) => handleChange($event)"
-                >
-                <a-select-option v-for="(item, index) in barCodeUnitList" :key="index" :value="item.ratio">
-                  {{ item.name }}
-                </a-select-option>
-              </a-select>
-              <a-input v-else :value="value" disabled @change="($event) => handleChange($event)"></a-input>
+            <template #commodityUnit="{value,index,allValues,rowId}">
+              <div style="display: flex;align-items: center;">
+                <a-input disabled :value="value" placeholder="自动带出">
+                </a-input>
+                <span class="sp-btn" @click="editMaterialUnitModal({value,index,allValues,rowId})">+管理</span>
+              </div>
+            </template>
+            <template #upcList="{value,rowId}">
+              <div style="display: flex;align-items: center;">
+                <a-input disabled :value="value[0]&&value[0].upc?value[0].upc:''" placeholder="自动带出">
+                </a-input>
+                <span class="sp-btn" @click="editMaterialUpcModal({value,rowId})">+管理</span>
+              </div>
+            </template>
+            <template #enabled="{value,handleChange}">
+              <a-switch :checked="value" @change="(v) => handleChange(v)" checkedChildren="启用" unCheckedChildren="禁用" />
             </template>
             </j-editable-table>
           </a-tab-pane>
@@ -366,7 +275,7 @@
               :loading="depotTable.loading"
               :columns="depotTable.columns"
               :dataSource="depotTable.dataSource"
-              :minWidth="1000"
+              minWidth="100%"
               :maxHeight="300"
               :rowNumber="true"
               :rowSelection="false"
@@ -409,20 +318,17 @@
         </a-tabs>
       </a-form>
     </a-spin>
-    <!-- 供应商modal -->
-    <vendor-modal ref="vendorModalForm" @ok="vendorModalFormOk"></vendor-modal>
-    <!-- 仓库modal -->
-    <depot-modal ref="depotModalForm" @ok="depotModalFormOk"></depot-modal>
-    <unit-modal ref="unitModalForm" @ok="unitModalFormOk"></unit-modal>
+    <!-- 货品单位管理 -->
+    <material-unit-modal ref="materialUnitModal" @ok="unitOk"></material-unit-modal>
+    <material-upc-modal ref="materialUpcModal" @ok="upcOk"></material-upc-modal>
   </j-modal>
 </template>
 <script>
 import pick from 'lodash.pick'
 import BatchSetPriceModal from './BatchSetPriceModal'
 import BatchSetStockModal from './BatchSetStockModal'
-import UnitModal from '../../system/modules/UnitModal'
-import VendorModal from '@/views//system/modules/VendorModal'
-import DepotModal from '@/views//system/modules/DepotModal'
+import MaterialUnitModal from './MaterialUnitModal'
+import MaterialUpcModal from './MaterialUpcModal'
 import JEditableTable from '@/components/jeecg/JEditableTable'
 import { FormTypes, getRefPromise, VALIDATE_NO_PASSED, validateFormAndTables } from '@/utils/JEditableTableUtil'
 import {
@@ -445,9 +351,8 @@ export default {
   components: {
     BatchSetPriceModal,
     BatchSetStockModal,
-    UnitModal,
-    VendorModal,
-    DepotModal,
+    MaterialUnitModal,
+    MaterialUpcModal,
     JImageUpload,
     JDate,
     JEditableTable,
@@ -461,12 +366,12 @@ export default {
       title: '操作',
       width: '1300px',
       visible: false,
+      activeKey: '1',
       modalStyle: '',
       categoryTree: [],
       unitList: [],
       depotList: [],
       fileList: [],
-      unitChecked: false,
       meDeleteIdList: [], //删除条码信息的id数组
       prefixNo: 'material',
       model: {},
@@ -557,19 +462,71 @@ export default {
         dataSource: [],
         columns: [
           {
-            title: '商品条码',
-            key: 'barCode',
-            width: '15%',
+            title: 'SKU',
+            key: 'sku',
+            width: '250px',
+            disabled: true,
             type: FormTypes.input,
-            placeholder: '请输入${title}',
+            placeholder: '自动生成',
           },
           {
             title: '单位',
-            key: 'ratio',
-            width: '15%',
+            key: 'commodityUnit',
+            width: '140px',
             type: FormTypes.slot,
+            disabled: true,
+            placeholder: '请输入${title}',
+            validateRules: [{ required: true, message: '单位不能为空' }],
+          },
+          {
+            title: '规格',
+            key: 'standard',
+            width: '100px',
+            type: FormTypes.input,
+            placeholder: '请输入${title}',
+            validateRules: [{ required: true, message: '规格不能为空' }],
+          },
+          {
+            title: '颜色',
+            key: 'color',
+            width: '100px',
+            type: FormTypes.input,
             placeholder: '请输入${title}',
           },
+          {
+            title: '重量(kg)',
+            key: 'weight',
+            width: '100px',
+            type: FormTypes.inputNumber,
+            placeholder: '请输入重量',
+          },
+          {
+            title: '型号',
+            key: 'model',
+            width: '100px',
+            type: FormTypes.input,
+            placeholder: '请输入${title}',
+          },
+          {
+            title: 'UPC',
+            key: 'upcList',
+            width: '180px',
+            type: FormTypes.slot,
+            placeholder: '请输入${title}',
+          },
+          {
+            title: '是否启用',
+            key: 'enabled',
+            width: '100px',
+            type: FormTypes.slot,
+            placeholder: '请输入${title}',
+          },
+          {
+            title: '单位集合',
+            key: 'unitList',
+            width: '100px',
+            type: FormTypes.hidden,
+          },
         ]
       },
       depotTable: {
@@ -634,21 +591,9 @@ export default {
             { max: 100, message: '长度请小于100个字符', trigger: 'blur' },
           ],
         },
-        standard: {
-          rules: [{ max: 100, message: '长度请小于100个字符', trigger: 'blur' }],
-        },
         categoryId: {
           rules: [{ required: true, message: '请选择类别!' }],
         },
-        model: {
-          rules: [{ max: 100, message: '长度请小于100个字符', trigger: 'blur' }],
-        },
-        unit: {
-          rules: [{ required: true, message: '请输入单位!' }],
-        },
-        unitId: {
-          rules: [{ required: true, message: '请选择多单位!' }],
-        },
         defaultWholesaleDecimal: {
           rules: [{ required: true, message: '请输入默认销售价!' }],
         },
@@ -700,6 +645,10 @@ export default {
     getAllTable() {
       return Promise.all([getRefPromise(this, 'editableProBarCodeTable'),getRefPromise(this, 'editableDepotTable')])
     },
+    handleMbTableAdded(e){
+      const { row, target } = e
+      target.setValues([{ rowKey: row.id, values: { enabled: true } }])
+    },
     add() {
       // 默认新增一条数据
       this.getAllTable().then((editableTables) => {
@@ -729,11 +678,6 @@ export default {
           pick(
             this.model,
             'name',
-            'standard',
-            'unit',
-            'unitId',
-            'model',
-            'color',
             'brand',
             'mnemonic',
             'categoryId',
@@ -742,8 +686,7 @@ export default {
             'expiryNum',
             'defaultPurchaseDecimal',
             'defaultWholesaleDecimal',
-            'systemSku',
-            'weight',
+            'systemSpu',
             'remark',
             'otherField1',
             'otherField2',
@@ -751,20 +694,11 @@ export default {
           )
         )
         autoJumpNextInput('materialHeadModal')
-        autoJumpNextInput('materialDetailModal')
       })
       this.loadTreeData()
       this.loadUnitListData()
       // 加载子表数据
       if (this.model.id) {
-        // 判断是否是多单位
-        if (this.model.unit) {
-          this.unitChecked = false
-        } else {
-          this.unitChecked = true
-          console.log('多单位-----', record)
-          await this.getUnitListByID(record.unitId)
-        }
         let params = { materialId: this.model.id }
         this.requestProMbTableData(this.url.materialsExtendList, params, this.mbTable)
         this.requestMeTableData()
@@ -794,18 +728,7 @@ export default {
       tab.loading = true
       getAction(url, params)
         .then((res) => {
-          const rows = (res.data.rows || []).map(item => {
-            if(this.unitChecked){
-              if(item.ratio){
-                const target = this.barCodeUnitList.find(unit => unit.ratio == item.ratio)
-                item.commodityUnit = target?target.name : ''
-              }
-            }else{
-              item.ratio = item.commodityUnit // 回显单位
-            }
-            return item
-          })
-          tab.dataSource = rows
+          tab.dataSource = res.data
           console.log('tab.dataSource-----', tab.dataSource)
         })
         .finally(() => {
@@ -831,7 +754,6 @@ export default {
       this.$emit('close')
       this.visible = false
       this.modalStyle = ''
-      this.unitChecked = false
       this.meTable.dataSource = []
       this.meTable.pagination.current = 1
       this.getAllTable().then((editableTables) => {
@@ -856,25 +778,14 @@ export default {
         .then((allValues) => {
           console.log('allValues========',allValues)
           let formData = this.classifyIntoFormData(allValues)
-          formData.sortList = []
-          if (formData.unit === undefined) {
-            formData.unit = ''
-          }
-          if (formData.unitId === undefined) {
-            formData.unitId = ''
-          }
-          if (this.unitChecked) {
-            formData.unit = ''
-          } else {
-            formData.unitId = ''
-          }
           // 发起请求
           return this.requestAddOrEdit(formData)
         })
         .catch((e) => {
+          this.$message.warning('请完善必填项!')
           if (e.error === VALIDATE_NO_PASSED) {
             // 如果有未通过表单验证的子表,就自动跳转到它所在的tab
-            this.activeKey = e.index == null ? this.activeKey : (e.index + 1).toString()
+            this.activeKey = e.index == null ? this.activeKey : (e.index + 2).toString()
           } else {
             console.error(e)
           }
@@ -887,28 +798,14 @@ export default {
     },
     /** 整理成formData */
     classifyIntoFormData(allValues) {
-      
-      const that = this
       let materialMain = Object.assign(this.model, allValues.formValue)
-      console.log('materialMain------mbList------', allValues.tablesValue[0].values)
       return {
         ...materialMain, // 展开
-        meList:[],
         stock: allValues.tablesValue[1].values,
-        mbList: allValues.tablesValue[0].values.map(item => {
-          let commodityUnit = ''
-          // 多单位
-          if(that.unitChecked){
-            const target = that.barCodeUnitList.find(unit => unit.ratio == item.ratio)
-            commodityUnit = target?target.name : ''
-          }else{
-            commodityUnit = item.ratio
-            item.ratio = null
-          }
+        meList: allValues.tablesValue[0].values.map(item => {
           return {
-            barCode: item.barCode,
-            ratio: item.ratio,
-            commodityUnit: commodityUnit,
+            ...item,
+            upcList: item.upcList?item.upcList:[],
             id: item.id.length > 19 ? null : item.id, // 后端接收不了大于19位id
           }
         }),
@@ -917,118 +814,61 @@ export default {
     /** 发起新增或修改的请求 */
     requestAddOrEdit(formData) {
       console.log('formData------------', formData)
-      if (formData.mbList.length === 0) {
+      if (formData.meList.length === 0) {
         this.$message.warning('抱歉,请输入条码信息!')
         return
       }
-      for (const item of formData.mbList){
-        if(item.barCode === ''){
-          this.$message.warning('抱歉,请输入条码信息!')
+      //对最低和最高安全库存进行校验
+      for (let i = 0; i < formData.stock.length; i++) {
+        let depotStockObj = formData.stock[i]
+        if (formData.enableSerialNumber === '1' && depotStockObj.initStock && depotStockObj.initStock - 0) {
+          this.$message.warning('抱歉,序列号商品不能录入期初库存,建议进行入库单据录入!')
           return
         }
-        if(item.ratio === ''){
-          this.$message.warning('抱歉,条码信息中列表单位不能为空!')
+        if (formData.enableBatchNumber === '1' && depotStockObj.initStock && depotStockObj.initStock - 0) {
+          this.$message.warning('抱歉,批号商品不能录入期初库存,建议进行入库单据录入!')
           return
         }
+        if (depotStockObj.lowSafeStock && depotStockObj.highSafeStock) {
+          if (depotStockObj.lowSafeStock - 0 > depotStockObj.highSafeStock - 0) {
+            this.$message.warning('抱歉,' + depotStockObj.name + '的最低安全库存大于最高安全库存!')
+            return
+          }
+        }
       }
-      if (formData.enableSerialNumber === '1' && formData.enableBatchNumber === '1') {
-        this.$message.warning('抱歉,序列号和批号只能选择一项!')
-        return
+      //图片校验
+      if (this.fileList && this.fileList.length > 0) {
+        formData.imgName = this.fileList
+        let fileArr = this.fileList.split(',')
+        if (fileArr.length > 4) {
+          this.$message.warning('抱歉,商品图片不能超过4张!')
+          return
+        }
+      } else {
+        formData.imgName = ''
       }
-      //校验商品是否存在,通过校验商品的名称、型号、规格、颜色、单位、制造商等
-      let param = {
-        id: this.model.id ? this.model.id : 0,
-        name: this.model.name,
-        model: this.parseParam(this.model.model),
-        color: this.parseParam(this.model.color),
-        standard: this.parseParam(this.model.standard),
-        mfrs: this.parseParam(this.model.mfrs),
-        otherField1: this.parseParam(this.model.otherField1),
-        otherField2: this.parseParam(this.model.otherField2),
-        otherField3: this.parseParam(this.model.otherField3),
-        unit: this.parseParam(this.model.unit),
-        unitId: this.parseParam(this.model.unitId),
+      formData.meDeleteIdList = this.meDeleteIdList
+      //接口调用
+      let url = this.url.add,
+        method = 'post'
+      if (this.model.id) {
+        url = this.url.edit
+        method = 'put'
       }
-      checkMaterial(param).then((res) => {
-        if (res && res.code === 200) {
-          if (res.data.status) {
-            this.$message.warning('抱歉,该商品已存在!')
-            return
+      const that = this
+      this.confirmLoading = true
+      httpAction(url, formData, method)
+        .then((res) => {
+          if (res.code === 200) {
+            that.$emit('ok')
+            that.confirmLoading = false
+            that.close()
           } else {
-            //进一步校验单位
-            let basicUnit = '',
-              otherUnit = '',
-              otherUnitTwo = '',
-              otherUnitThree = ''
-            if (formData.unitId) {
-              let unitArr = this.unitList
-              for (let i = 0; i < unitArr.length; i++) {
-                if (unitArr[i].id == formData.unitId) {
-                  basicUnit = unitArr[i].basicUnit
-                  otherUnit = unitArr[i].otherUnit
-                  if (unitArr[i].otherUnitTwo) {
-                    otherUnitTwo = unitArr[i].otherUnitTwo
-                  }
-                  if (unitArr[i].otherUnitThree) {
-                    otherUnitThree = unitArr[i].otherUnitThree
-                  }
-                }
-              }
-            }
-            //对最低和最高安全库存进行校验
-            for (let i = 0; i < formData.stock.length; i++) {
-              let depotStockObj = formData.stock[i]
-              if (formData.enableSerialNumber === '1' && depotStockObj.initStock && depotStockObj.initStock - 0) {
-                this.$message.warning('抱歉,序列号商品不能录入期初库存,建议进行入库单据录入!')
-                return
-              }
-              if (formData.enableBatchNumber === '1' && depotStockObj.initStock && depotStockObj.initStock - 0) {
-                this.$message.warning('抱歉,批号商品不能录入期初库存,建议进行入库单据录入!')
-                return
-              }
-              if (depotStockObj.lowSafeStock && depotStockObj.highSafeStock) {
-                if (depotStockObj.lowSafeStock - 0 > depotStockObj.highSafeStock - 0) {
-                  this.$message.warning('抱歉,' + depotStockObj.name + '的最低安全库存大于最高安全库存!')
-                  return
-                }
-              }
-            }
-            //图片校验
-            if (this.fileList && this.fileList.length > 0) {
-              formData.imgName = this.fileList
-              let fileArr = this.fileList.split(',')
-              if (fileArr.length > 4) {
-                this.$message.warning('抱歉,商品图片不能超过4张!')
-                return
-              }
-            } else {
-              formData.imgName = ''
-            }
-            formData.meDeleteIdList = this.meDeleteIdList
-            //接口调用
-            let url = this.url.add,
-              method = 'post'
-            if (this.model.id) {
-              url = this.url.edit
-              method = 'put'
-            }
-            const that = this
-            this.confirmLoading = true
-            httpAction(url, formData, method)
-              .then((res) => {
-                if (res.code === 200) {
-                  that.$emit('ok')
-                  that.confirmLoading = false
-                  that.close()
-                } else {
-                  that.$message.warning(res.data.message)
-                  that.confirmLoading = false
-                }
-              })
-              .finally(() => {})
+            that.$message.warning(res.data.message)
+            that.confirmLoading = false
           }
-        }
-      })
+        })
+        .finally(() => {})
     },
     parseParam(param) {
       return param ? param : ''
@@ -1067,28 +907,12 @@ export default {
     loadUnitListData() {
       let that = this
       let params = {}
-      params.currentPage = 1
-      params.pageSize = 100
       getAction('/unit/getAllList', params).then((res) => {
         if (res) {
           that.unitList = res.data
         }
       })
     },
-    onAdded(event) {
-      const { row, target } = event
-      // 不勾选多单位
-      if(!this.unitChecked){
-        let formUnit = this.form.getFieldValue('unit')||''
-        console.log('formUnit', formUnit)
-        target.setValues([{rowKey:row.id, values:{barCode: '', commodityUnit: formUnit, ratio: formUnit}}])
-      }
-      console.log('onAdded', event)
-    },
-    onDeleted(value) {
-      // this.meDeleteIdList = value
-      console.log('onDeleted', value)
-    },
     batchSetStock(type) {
       this.$refs.stockModalForm.add(type)
       this.$refs.stockModalForm.disableSubmit = false
@@ -1157,54 +981,53 @@ export default {
         that.form.setFieldsValue({ mnemonic: '' })
       }
     },
-    onlyUnitOnChange(e) {
-      console.log('onlyUnitOnChange=======',e.target.value)
-      this.$refs.editableProBarCodeTable.getValues((error, values) => {
-        let mArr = values
-        for (let i = 0; i < mArr.length; i++) {
-          let mInfo = mArr[i]
-          mInfo.commodityUnit = e.target.value
-          mInfo.ratio = e.target.value
+    handleMeTableChange(pagination) {
+      if (pagination && pagination.current) {
+        this.meTable.pagination = pagination
+      }
+      this.requestMeTableData()
+    },
+    editMaterialUnitModal({value,index,allValues,rowId}){
+      console.log('allValues====',allValues)
+      console.log('value====',value)
+      const obj = allValues.inputValues[index]
+      let unitList = [
+        {
+          name: value,
+          ratio: 1,
         }
-        this.mbTable.dataSource = mArr
+      ]
+      if(obj.unitList&& obj.unitList.length > 0){
+        unitList = obj.unitList
+      }
+      this.$refs.materialUnitModal.edit({
+        unitList,
+        rowId: rowId,
       })
+      this.$refs.materialUnitModal.unitOpts = this.unitList
     },
-    manyUnitOnChange(value) {
-      console.log('manyUnitOnChange', value)
-      this.getUnitListByID(value)
-    },
-    unitOnChange(e) {
-      let isChecked = e.target.checked
-      if (isChecked) {
-        this.unitChecked = true
-      } else {
-        this.unitChecked = false
-      }
-
-      this.barCodeUnitList = []
-      this.$refs.editableProBarCodeTable.getValues((error, values) => {
-        let mArr = values
-        for (let i = 0; i < mArr.length; i++) {
-          let mInfo = mArr[i]
-          mInfo.commodityUnit = undefined
-          mInfo.ratio = undefined
+    editMaterialUpcModal({value,rowId}) {
+      console.log('value====',value)
+      let upcList = [
+        {
+          upc: ''
         }
-        this.mbTable.dataSource = mArr
+      ]
+      if (value&&value.length > 0) {
+        upcList = value
+      }
+      this.$refs.materialUpcModal.edit({
+        upcList: upcList,
+        rowId: rowId,
       })
     },
-    addUnit() {
-      this.$refs.unitModalForm.add()
-      this.$refs.unitModalForm.title = '新增多单位'
-      this.$refs.unitModalForm.disableSubmit = false
+    upcOk({upcList,rowId}) {
+      const target = this.$refs.editableProBarCodeTable
+      target.setValues([{ rowKey: rowId, values: { upcList: upcList } }])
     },
-    unitModalFormOk() {
-      this.loadUnitListData()
-    },
-    handleMeTableChange(pagination) {
-      if (pagination && pagination.current) {
-        this.meTable.pagination = pagination
-      }
-      this.requestMeTableData()
+    unitOk({unitList,rowId}) {
+      const target = this.$refs.editableProBarCodeTable
+      target.setValues([{ rowKey: rowId, values: { commodityUnit: unitList[0].name, unitList: unitList } }])
     },
   },
 }
@@ -1224,4 +1047,13 @@ export default {
   background-color: #ffffff;
 }
 /deep/ .ant-table td { white-space: nowrap; }
+.sp-btn{
+  display: inline-block;
+  white-space: nowrap;
+  box-sizing: border-box;
+  padding: 0 5px;
+  font-size: 12px;
+  cursor: pointer;
+  color: #1890FF;
+}
 </style>

+ 130 - 0
jshERP-web/src/views/material/modules/MaterialUnitModal.vue

@@ -0,0 +1,130 @@
+<template>
+  <div ref="container">
+    <a-modal
+      :title="title"
+      :width="700"
+      :visible="visible"
+      :confirm-loading="confirmLoading"
+      :getContainer="() => $refs.container"
+      :wrapClassName="wrapClassNameInfo()"
+      :mask="isDesktop()"
+      :maskClosable="false"
+      @ok="handleOk"
+      @cancel="handleCancel"
+      cancelText="取消"
+      okText="保存"
+      style="top: 0; height: 80%"
+    >
+      <a-spin :spinning="confirmLoading">
+        <a-form-model :model="model" :label-col="labelCol" :wrapper-col="wrapperCol" ref="form">
+          <a-row :gutter="24">
+            <a-col :span="24" v-for="(item, index) in model.unitList" :key="index">
+              <a-form-model-item :label="`货品单位${index + 1}`">
+                <a-select placeholder="请选择" style="width: 150px" v-model="item.name" :options="unitSelectOpts"></a-select>
+                <span class="base-unit" v-if="index===0">最小货品单位,不支持删除</span>
+                <span v-else>
+                  =
+                  <a-input-number placeholder="请输入" :min="1" v-model="item.ratio" style="width: 150px" />
+                  {{ model.unitList[0]?model.unitList[0].name:'' }}
+                  <a-icon type="delete" @click="unitDel(index)" style="margin-left: 10px;color:#f5222d"></a-icon>
+                </span>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-model-item :colon="false">
+                <span slot="label"></span>
+                <a-button @click="unitAdd" type="primary" icon="plus">新增</a-button>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </a-spin>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import { mixinDevice } from '@/utils/mixin'
+
+export default {
+  name: 'UnitModal',
+  mixins: [mixinDevice],
+  data() {
+    return {
+      title: '货品单位管理',
+      visible: false,
+      model: {
+        unitList: []
+      },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 6 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 18 },
+      },
+      confirmLoading: false,
+      validatorRules: {},
+      unitOpts: [],
+      rowId: null,
+    }
+  },
+  computed:{
+    unitSelectOpts() {
+      const names = this.model.unitList.map(item => item.name)
+      return this.unitOpts.map(item => ({
+        title: item.name,
+        value: item.name,
+        disabled: names.includes(item.name)
+      }))
+    },
+  },
+  created() {},
+  methods: {
+    edit({unitList=[], rowId}) {
+      this.rowId = rowId
+      this.visible = true
+      this.$nextTick(() => {
+        this.$refs.form.resetFields()
+      })
+      this.model = Object.assign({}, {unitList})
+    },
+    close() {
+      this.$emit('close')
+      this.model = {
+        unitList: []
+      }
+      this.visible = false
+    },
+    handleOk() {
+      this.$emit('ok',{
+        unitList: this.model.unitList,
+        rowId: this.rowId
+      })
+      this.visible = false
+    },
+    handleCancel() {
+      this.close()
+    },
+    unitDel(index) {
+      this.model.unitList.splice(index, 1)
+    },
+    unitAdd() {
+      this.model.unitList.push({
+        ratio: undefined,
+        name: ''
+      })
+    },
+  },
+}
+</script>
+
+<style scoped>
+.base-unit {
+  display: inline-block;
+  color: #999;
+  font-size: 12px;
+  margin-left: 10px;
+}
+</style>

+ 113 - 0
jshERP-web/src/views/material/modules/MaterialUpcModal.vue

@@ -0,0 +1,113 @@
+<template>
+  <div ref="container">
+    <a-modal
+      :title="title"
+      :width="700"
+      :visible="visible"
+      :confirm-loading="confirmLoading"
+      :getContainer="() => $refs.container"
+      :wrapClassName="wrapClassNameInfo()"
+      :mask="isDesktop()"
+      :maskClosable="false"
+      @ok="handleOk"
+      @cancel="handleCancel"
+      cancelText="取消"
+      okText="保存"
+      style="top: 0; height: 80%"
+    >
+      <a-spin :spinning="confirmLoading">
+        <a-form-model :model="model" :label-col="labelCol" :wrapper-col="wrapperCol" ref="form" :rules="rules">
+          <a-row :gutter="24">
+            <a-col :span="24" v-for="(item, index) in model.upcList" :key="index">
+              <a-form-model-item :label="`UPC${index + 1}`">
+                <a-input placeholder="请输入" v-model="item.upc" style="width: 200px" />
+                <a-icon type="delete" @click="upcDel(index)" style="margin-left: 10px;color:#f5222d"></a-icon>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-model-item :colon="false">
+                <span slot="label"></span>
+                <a-button @click="upcAdd" type="primary" icon="plus">新增</a-button>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </a-spin>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import { mixinDevice } from '@/utils/mixin'
+
+export default {
+  name: 'MaterialUpcModal',
+  mixins: [mixinDevice],
+  data() {
+    const that = this
+    return {
+      title: '管理UPC',
+      visible: false,
+      model: {
+        upcList: []
+      },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 6 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 18 },
+      },
+      confirmLoading: false,
+      rules: {},
+      rowId: null,
+    }
+  },
+  created() {},
+  methods: {
+    edit({upcList=[],rowId}) {
+      this.visible = true
+      this.rowId = rowId
+      this.$nextTick(() => {
+        this.$refs.form.resetFields()
+      })
+      this.model = Object.assign({}, {upcList})
+    },
+    close() {
+      this.$emit('close')
+      this.model = {
+        upcList: []
+      }
+      this.visible = false
+    },
+    handleOk() {
+      this.$emit('ok', {
+        upcList: this.model.upcList,
+        rowId: this.rowId
+      })
+      this.visible = false
+    },
+    handleCancel() {
+      this.close()
+    },
+    upcDel(index) {
+      this.model.upcList.splice(index, 1)
+    },
+    upcAdd() {
+      this.model.upcList.push({
+        upc: ''
+      })
+    },
+  },
+}
+</script>
+
+<style scoped>
+.base-unit {
+  display: inline-block;
+  color: #999;
+  font-size: 12px;
+  margin-left: 10px;
+}
+</style>

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

@@ -77,7 +77,7 @@
 <script>
 import editForm from './editForm.vue'
 import table from '../utils/table'
-import JSelectMaterialModal from '../../../components/jeecgbiz/modal/JSelectMaterialModal2.vue'
+import JSelectMaterialModal from '../../../components/jeecgbiz/modal/JSelectMaterialModal.vue'
 import { getAction, postAction } from '@/api/manage'
 import { newTableMixin } from '@/mixins/newTableMixin'
 import { mixinDevice } from '@/utils/mixin'

+ 2 - 2
jshERP-web/src/views/stock/utils/table.js

@@ -77,7 +77,7 @@ const table = {
     { dataIndex: 'inventory', title: '库存', scopedSlots: { customRender: 'inventory' } },
     { dataIndex: 'productionDate', title: '生产日期' },
     { dataIndex: 'expiryNum', title: '保质期' },
-    { dataIndex: 'barCode', title: '商品条码' },
+    { dataIndex: 'barCode', title: 'SKU' },
     { dataIndex: 'depotName', title: '仓库名称' },
     { dataIndex: 'position', title: '仓库货架' },
   ],
@@ -89,7 +89,7 @@ const table = {
     { dataIndex: 'commodityUnit', title: '单位' },
     { dataIndex: 'productionDate', title: '生产日期' },
     { dataIndex: 'supplierName', title: '供应商' },
-    { dataIndex: 'barCode', title: '商品条码' },
+    { dataIndex: 'barCode', title: 'SKU' },
     { dataIndex: 'inventory', title: '库存(最小单位)', scopedSlots: { customRender: 'inventory' } },
     { dataIndex: 'depotName', title: '仓库名称' },
     { dataIndex: 'position', title: '仓库货架' },

+ 1 - 39
jshERP-web/src/views/system/UnitList.vue

@@ -114,45 +114,7 @@ export default {
           align: 'center',
           scopedSlots: { customRender: 'action' },
         },
-        { title: '单位名称', align: 'left', dataIndex: 'name', width: 200 },
-        { title: '基本单位', align: 'left', dataIndex: 'basicUnit', width: 80 },
-        {
-          title: '副单位',
-          align: 'left',
-          dataIndex: 'otherUnit',
-          width: 100,
-          customRender: function (t, r, index) {
-            if (r) {
-              return r.otherUnit + '=' + r.ratio + r.basicUnit
-            }
-          },
-        },
-        {
-          title: '副单位2',
-          align: 'left',
-          dataIndex: 'otherUnitTwo',
-          width: 100,
-          customRender: function (t, r, index) {
-            if (r) {
-              if (r.otherUnitTwo) {
-                return r.otherUnitTwo + '=' + r.ratioTwo + r.basicUnit
-              }
-            }
-          },
-        },
-        {
-          title: '副单位3',
-          align: 'left',
-          dataIndex: 'otherUnitThree',
-          width: 100,
-          customRender: function (t, r, index) {
-            if (r) {
-              if (r.otherUnitThree) {
-                return r.otherUnitThree + '=' + r.ratioThree + r.basicUnit
-              }
-            }
-          },
-        },
+        { title: '单位名称', align: 'left', dataIndex: 'name', width: 80 },
         {
           title: '状态',
           dataIndex: 'enabled',

+ 11 - 103
jshERP-web/src/views/system/modules/UnitModal.vue

@@ -14,36 +14,15 @@
       @cancel="handleCancel"
       cancelText="取消"
       okText="保存"
-      style="top: 100px; height: 55%"
+      style="top: 100px; height: 50%"
     >
       <template slot="footer">
         <a-button key="back" v-if="isReadOnly" @click="handleCancel"> 取消 </a-button>
       </template>
       <a-spin :spinning="confirmLoading">
         <a-form :form="form" id="unitModal">
-          <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="基本单位">
-            <a-input placeholder="请输入基本单位(小单位)" v-decorator.trim="['basicUnit', validatorRules.basicUnit]" />
-          </a-form-item>
-        </a-form>
-        <a-form :form="form">
-          <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="副单位">
-            <a-input placeholder="请输入副单位(大单位)" style="width: 48%" v-decorator.trim="['otherUnit']" />
-            =
-            <a-input suffix="基本单位" placeholder="请输入比例" style="width: 48%" v-decorator.trim="['ratio']" />
-          </a-form-item>
-        </a-form>
-        <a-form :form="form">
-          <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="副单位2">
-            <a-input placeholder="请输入副单位2(大单位)" style="width: 48%" v-decorator.trim="['otherUnitTwo']" />
-            =
-            <a-input suffix="基本单位" placeholder="请输入比例2" style="width: 48%" v-decorator.trim="['ratioTwo']" />
-          </a-form-item>
-        </a-form>
-        <a-form :form="form">
-          <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="副单位3">
-            <a-input placeholder="请输入副单位3(大单位)" style="width: 48%" v-decorator.trim="['otherUnitThree']" />
-            =
-            <a-input suffix="基本单位" placeholder="请输入比例3" style="width: 48%" v-decorator.trim="['ratioThree']" />
+          <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单位名称">
+            <a-input placeholder="请输入单位名称" v-decorator.trim="['name', validatorRules.name]" />
           </a-form-item>
         </a-form>
       </a-spin>
@@ -54,7 +33,6 @@
 import pick from 'lodash.pick'
 import { addUnit, editUnit, checkUnit } from '@/api/api'
 import { autoJumpNextInput } from '@/utils/util'
-import { isDecimalThree } from '@/utils/validate'
 import { mixinDevice } from '@/utils/mixin'
 export default {
   name: 'UnitModal',
@@ -76,21 +54,12 @@ export default {
       confirmLoading: false,
       form: this.$form.createForm(this),
       validatorRules: {
-        basicUnit: {
+        name: {
           rules: [
-            { required: true, message: '请输入基本单位!' },
+            { required: true, message: '请输入单位名称!' },
             { min: 1, max: 10, message: '长度在 1 到 10 个字符', trigger: 'blur' },
           ],
         },
-        otherUnit: {
-          rules: [
-            { required: true, message: '请输入副单位!' },
-            { min: 1, max: 10, message: '长度在 1 到 10 个字符', trigger: 'blur' },
-          ],
-        },
-        ratio: {
-          rules: [{ required: true, message: '请输入比例!' }, { validator: this.validateRatio }],
-        },
       },
     }
   },
@@ -107,13 +76,7 @@ export default {
         this.form.setFieldsValue(
           pick(
             this.model,
-            'basicUnit',
-            'otherUnit',
-            'ratio',
-            'otherUnitTwo',
-            'ratioTwo',
-            'otherUnitThree',
-            'ratioThree'
+            'name',
           )
         )
         autoJumpNextInput('unitModal')
@@ -126,71 +89,16 @@ export default {
     handleOk() {
       const that = this
       // 触发表单验证
-      this.form.validateFields((err, values) => {
+      this.form.validateFields(async (err, values) => {
         if (!err) {
           that.confirmLoading = true
-          let formData = Object.assign(this.model, values)
-          if (!formData.otherUnit) {
-            that.$message.warning('抱歉,副单位不能为空!')
-            that.confirmLoading = false
-            return
-          }
-          if (formData.otherUnit) {
-            if (!formData.ratio) {
-              that.$message.warning('抱歉,比例不能为空!')
-              that.confirmLoading = false
-              return
-            }
-            if (!isDecimalThree(formData.ratio)) {
-              that.$message.warning('抱歉,比例只能为数字,最多三位小数!')
-              that.confirmLoading = false
-              return
-            }
-          }
-          if (formData.otherUnitTwo) {
-            if (!formData.ratioTwo) {
-              that.$message.warning('抱歉,比例2不能为空!')
-              that.confirmLoading = false
-              return
-            }
-            if (!isDecimalThree(formData.ratioTwo)) {
-              that.$message.warning('抱歉,比例2只能为数字,最多三位小数!')
-              that.confirmLoading = false
-              return
-            }
-          }
-          if (formData.otherUnitThree) {
-            if (!formData.ratioThree) {
-              that.$message.warning('抱歉,比例3不能为空!')
-              that.confirmLoading = false
-              return
-            }
-            if (!isDecimalThree(formData.ratioThree)) {
-              that.$message.warning('抱歉,比例3只能为数字,最多三位小数!')
-              that.confirmLoading = false
-              return
-            }
-          }
-          if (!formData.otherUnitTwo && formData.otherUnitThree) {
-            that.$message.warning('抱歉,需要先输入副单位2再输入副单位3!')
-            that.confirmLoading = false
-            return
-          }
-          if (formData.basicUnit === formData.otherUnit) {
-            that.$message.warning('抱歉,基本单位与副单位不能相同!')
-            that.confirmLoading = false
-            return
-          }
-          if (formData.basicUnit === formData.otherUnitTwo) {
-            that.$message.warning('抱歉,基本单位与副单位2不能相同!')
-            that.confirmLoading = false
-            return
-          }
-          if (formData.basicUnit === formData.otherUnitThree) {
-            that.$message.warning('抱歉,基本单位与副单位3不能相同!')
+          const checkRes = await checkUnit({name: values.name.replace(/\s+/g, '')})
+          if(checkRes.code !== 200) {
+            that.$message.warning(checkRes.msg)
             that.confirmLoading = false
             return
           }
+          let formData = Object.assign(this.model, values)
           let obj
           if (!this.model.id) {
             obj = addUnit(formData)