Преглед на файлове

Merge remote-tracking branch 'origin/dev_ml_522'

yangzhi преди 3 седмици
родител
ревизия
86520b7dae
променени са 77 файла, в които са добавени 3420 реда и са изтрити 3177 реда
  1. 1 0
      jshERP-web/package.json
  2. BIN
      jshERP-web/public/doc/goods_template.xls
  3. BIN
      jshERP-web/public/doc/goods_template.xlsx
  4. 4 4
      jshERP-web/src/api/api.js
  5. 22 3
      jshERP-web/src/components/jeecg/JEditableTable.vue
  6. 0 1
      jshERP-web/src/components/jeecg/JModal/index.vue
  7. 2 44
      jshERP-web/src/components/jeecgbiz/JSelectList.vue
  8. 45 0
      jshERP-web/src/components/jeecgbiz/JSelectMaterial/index.vue
  9. 52 101
      jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal.vue
  10. 0 524
      jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal2.vue
  11. 7 3
      jshERP-web/src/components/menu/index.js
  12. 1 1
      jshERP-web/src/components/tools/ImportFileModal.vue
  13. 0 3
      jshERP-web/src/mixins/JEditableTableMixin.js
  14. 1 0
      jshERP-web/src/permission.js
  15. 2 0
      jshERP-web/src/store/index.js
  16. 26 0
      jshERP-web/src/store/modules/approval.js
  17. 2 2
      jshERP-web/src/views/bill/AllocationOutList.vue
  18. 2 2
      jshERP-web/src/views/bill/AssembleList.vue
  19. 2 2
      jshERP-web/src/views/bill/DisassembleList.vue
  20. 3 7
      jshERP-web/src/views/bill/OtherInList.vue
  21. 3 7
      jshERP-web/src/views/bill/OtherOutList.vue
  22. 3 3
      jshERP-web/src/views/bill/PurchaseApplyList.vue
  23. 2 2
      jshERP-web/src/views/bill/PurchaseBackList.vue
  24. 10 10
      jshERP-web/src/views/bill/PurchaseInList.vue
  25. 12 11
      jshERP-web/src/views/bill/PurchaseOrderList.vue
  26. 2 2
      jshERP-web/src/views/bill/RetailBackList.vue
  27. 2 2
      jshERP-web/src/views/bill/RetailOutList.vue
  28. 2 2
      jshERP-web/src/views/bill/SaleBackList.vue
  29. 9 9
      jshERP-web/src/views/bill/SaleOrderList.vue
  30. 9 9
      jshERP-web/src/views/bill/SaleOutList.vue
  31. 130 44
      jshERP-web/src/views/bill/dialog/BillDetail.vue
  32. 1 1
      jshERP-web/src/views/bill/dialog/HistoryBillList.vue
  33. 3 2
      jshERP-web/src/views/bill/dialog/LinkBillList.vue
  34. 2 3
      jshERP-web/src/views/bill/mixins/BillListMixin.js
  35. 63 219
      jshERP-web/src/views/bill/mixins/BillModalMixin.js
  36. 3 3
      jshERP-web/src/views/bill/modules/AllocationOutModal.vue
  37. 2 2
      jshERP-web/src/views/bill/modules/AssembleModal.vue
  38. 2 2
      jshERP-web/src/views/bill/modules/DisassembleModal.vue
  39. 35 80
      jshERP-web/src/views/bill/modules/OtherInModal.vue
  40. 26 106
      jshERP-web/src/views/bill/modules/OtherOutModal.vue
  41. 2 2
      jshERP-web/src/views/bill/modules/PurchaseApplyModal.vue
  42. 1 1
      jshERP-web/src/views/bill/modules/PurchaseBackModal.vue
  43. 68 146
      jshERP-web/src/views/bill/modules/PurchaseInModal.vue
  44. 56 97
      jshERP-web/src/views/bill/modules/PurchaseOrderModal.vue
  45. 2 2
      jshERP-web/src/views/bill/modules/RetailBackModal.vue
  46. 1 1
      jshERP-web/src/views/bill/modules/RetailOutModal.vue
  47. 2 2
      jshERP-web/src/views/bill/modules/SaleBackModal.vue
  48. 43 104
      jshERP-web/src/views/bill/modules/SaleOrderModal.vue
  49. 42 131
      jshERP-web/src/views/bill/modules/SaleOutModal.vue
  50. 15 28
      jshERP-web/src/views/material/MaterialList.vue
  51. 8 20
      jshERP-web/src/views/material/mixins/MaterialModalMixins.js
  52. 2 24
      jshERP-web/src/views/material/modules/BatchSetInfoModal.vue
  53. 213 425
      jshERP-web/src/views/material/modules/MaterialModal.vue
  54. 130 0
      jshERP-web/src/views/material/modules/MaterialUnitModal.vue
  55. 146 0
      jshERP-web/src/views/material/modules/MaterialUpcModal.vue
  56. 5 7
      jshERP-web/src/views/report/InDetail.vue
  57. 5 7
      jshERP-web/src/views/report/OutDetail.vue
  58. 176 62
      jshERP-web/src/views/stock/CheckList.vue
  59. 228 134
      jshERP-web/src/views/stock/TaskList.vue
  60. 0 99
      jshERP-web/src/views/stock/components/FilterForm.vue
  61. 13 5
      jshERP-web/src/views/stock/components/checkModal.vue
  62. 8 4
      jshERP-web/src/views/stock/components/editForm.vue
  63. 0 343
      jshERP-web/src/views/stock/components/stockModal.vue
  64. 525 0
      jshERP-web/src/views/stock/modules/InventoryCheckModal.vue
  65. 16 8
      jshERP-web/src/views/stock/utils/table.js
  66. 1 1
      jshERP-web/src/views/system/MsgList.vue
  67. 1 39
      jshERP-web/src/views/system/UnitList.vue
  68. 11 103
      jshERP-web/src/views/system/modules/UnitModal.vue
  69. 0 1
      jshERP-web/src/views/system/modules/VendorModal.vue
  70. 73 34
      jshERP-web/src/views/task/ApprovalList.vue
  71. 75 24
      jshERP-web/src/views/task/FlowList.vue
  72. 97 57
      jshERP-web/src/views/task/HandledList.vue
  73. 168 50
      jshERP-web/src/views/task/InitiateList.vue
  74. 46 0
      jshERP-web/src/views/task/mixin/approvalMixin.js
  75. 296 0
      jshERP-web/src/views/task/modules/FlowModal.vue
  76. 310 0
      jshERP-web/src/views/task/modules/PdaFlowModal.vue
  77. 142 0
      jshERP-web/src/views/task/utils/flow.js

+ 1 - 0
jshERP-web/package.json

@@ -25,6 +25,7 @@
     "lodash.get": "^4.4.2",
     "lodash.pick": "^4.4.0",
     "md5": "^2.2.1",
+    "moment": "^2.30.1",
     "nprogress": "^0.2.0",
     "tailwindcss": "^4.0.17",
     "viser-vue": "^2.4.4",

BIN
jshERP-web/public/doc/goods_template.xls


BIN
jshERP-web/public/doc/goods_template.xlsx


+ 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>

+ 0 - 1
jshERP-web/src/components/jeecg/JModal/index.vue

@@ -6,7 +6,6 @@
       :style="getStyle(modalStyle)"
       :visible="visible"
       :getContainer="() => $refs.container"
-      :maskStyle="{ top: '93px', left: '154px' }"
       :wrapClassName="wrapClassNameInfo()"
       :mask="isDesktop()"
       :maskClosable="false"

+ 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,

+ 45 - 0
jshERP-web/src/components/jeecgbiz/JSelectMaterial/index.vue

@@ -0,0 +1,45 @@
+<template>
+  <div style="width: 100%">
+    <a-input-search
+      :value="value"
+      :title="value"
+      placeholder="请点击搜索按钮"
+      readOnly
+      :disabled="disabled"
+      @search="openModal"
+    ></a-input-search>
+    <JSelectMaterialModal ref="selectModal" :multi="true" @ok="selectOK" />
+  </div>
+</template>
+
+<script>
+import JSelectMaterialModal from '../modal/JSelectMaterialModal.vue';
+export default {
+  name: 'JSelectMaterial',
+  components: {
+    JSelectMaterialModal
+  },
+  props: {
+    value: {
+      type: String,
+      default: '',
+    },
+    disabled: {
+      type: Boolean,
+      default: false,
+    },
+  },
+  methods: {
+    openModal() {
+      this.$refs.selectModal.showModal()
+    },
+    selectOK(rows, ids) {
+      this.$emit('change', {rows, ids})
+    },
+  },
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 52 - 101
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">
@@ -18,7 +18,7 @@
             <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-input ref="material" placeholder="请输入SKU、名称等查询" v-model="queryParam.q"></a-input>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="8">
@@ -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>
@@ -114,7 +80,7 @@
             ref="table"
             :scroll="scrollTrigger"
             size="middle"
-            rowKey="id"
+            rowKey="meId"
             :columns="columns"
             :dataSource="dataSource"
             :pagination="ipagination"
@@ -123,7 +89,7 @@
             :customRow="rowAction"
             @change="handleTableChange"
           >
-            <template slot="customBarCode" slot-scope="text, record">
+            <!-- <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">
@@ -138,7 +104,7 @@
                   />
                 </div>
               </a-popover>
-            </template>
+            </template> -->
             <template slot="customName" slot-scope="text, record">
               {{ record.name }}
               <a-tag v-if="record.enableSerialNumber == 1" color="orange">序</a-tag>
@@ -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,25 +167,18 @@ export default {
           width: 60,
           scopedSlots: { customRender: 'action' },
         },
-        // { dataIndex: 'mBarCode', title: '条码', scopedSlots: { customRender: 'customBarCode' } },
-        { dataIndex: 'batchNumber', title: '批次号' },
+        { dataIndex: 'sku', title: 'SKU', width: 250 },
         { 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: '扩展信息' },
+        { dataIndex: 'standard', title: '规格' },
+        { dataIndex: 'color', title: '颜色' },
+        { dataIndex: 'weight', title: '重量(kg)' },
+        { dataIndex: 'model', title: '型号' },
+        { dataIndex: 'stock', title: '库存' },
+        // { dataIndex: 'depotName', title: '仓库名称' },
+        // { dataIndex: 'position', title: '仓库货架' },
       ],
       scrollTrigger: {},
       dataSource: [],
@@ -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,17 +248,17 @@ 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
             ) {
-              this.title = '选择商品【再次回车可以直接选中】'
+              // this.title = '选择商品【再次回车可以直接选中】'
               this.$nextTick(() => this.$refs.material.focus())
             } else {
-              this.title = '选择商品'
+              // this.title = '选择商品'
             }
           } else {
-            this.title = '选择商品'
+            // this.title = '选择商品'
           }
         }
         this.loading = false
@@ -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()
     },
@@ -372,7 +329,7 @@ export default {
       this.$refs.modalForm.title = '新增商品'
     },
     handleEdit(record) {
-      getMaterialById({ mid: record.mid }).then((res) => {
+      getMaterialById({ mid: record.id }).then((res) => {
         this.$refs.modalForm.edit(res.data)
         this.$refs.modalForm.title = '编辑'
         this.$refs.modalForm.disableSubmit = false
@@ -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)) {
+        if (this.selectedRowKeys.includes(dataSource[i].meId)) {
           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
         ) {
@@ -453,6 +394,7 @@ export default {
           arr.push(this.dataSource[0].id)
           this.selectedRowKeys = arr
           this.handleSubmit()
+          console.log(this.selectedRowKeys,this.selectMaterialIds)
         } else {
           this.loadMaterialData(1)
         }
@@ -467,13 +409,22 @@ export default {
       return {
         on: {
           click: () => {
-            let arr = []
-            arr.push(record.id)
-            this.selectedRowKeys = arr
+            if(this.multi){
+              const i = this.selectedRowKeys.findIndex(key=> key === record.meId)
+              if(i===-1){
+                this.selectedRowKeys.push(record.meId)
+              }else{
+                this.selectedRowKeys.splice(i,1)
+              }
+            }else{
+              let arr = []
+              arr.push(record.meId)
+              this.selectedRowKeys = arr
+            }
           },
           dblclick: () => {
             let arr = []
-            arr.push(record.id)
+            arr.push(record.meId)
             this.selectedRowKeys = arr
             this.handleSubmit()
           },

+ 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 - 3
jshERP-web/src/components/menu/index.js

@@ -1,6 +1,5 @@
-import Menu from 'ant-design-vue/es/menu'
-import Icon from 'ant-design-vue/es/icon'
-
+import { Menu, Icon, Badge} from 'ant-design-vue'
+import { mapState } from 'vuex'
 const { Item, SubMenu } = Menu
 
 export default {
@@ -39,6 +38,9 @@ export default {
       vm.menu.forEach((item) => keys.push(item.url))
       return keys
     },
+    ...mapState({
+      approvalCount: state => state.approval.approvalCount,
+    })
   },
   mounted() {
     this.updateMenu()
@@ -102,6 +104,7 @@ export default {
       return null
     },
     renderMenuItem(menu) {
+      const approvalCount = this.approvalCount
       const target = null
       const tag = (target && 'a') || 'router-link'
       let props = { to: { name: menu.name } }
@@ -124,6 +127,7 @@ export default {
           <tag {...{ props, attrs }} title={menu.text}>
             {this.renderIcon(menu.icon)}
             <span>{menu.text}</span>
+            {menu.text=='待我审批'?(<Badge count={approvalCount} offset={[5,-5]}></Badge>):''}
           </tag>
         </Item>
       )

+ 1 - 1
jshERP-web/src/components/tools/ImportFileModal.vue

@@ -93,7 +93,7 @@ export default {
     },
     importTemplate() {
       let link = this.$refs.myLink
-      link.setAttribute('download', this.templateDownloadName + '.xls')
+      link.setAttribute('download', this.templateDownloadName + '.xlsx')
     },
     close() {
       this.$emit('close')

+ 0 - 3
jshERP-web/src/mixins/JEditableTableMixin.js

@@ -77,9 +77,6 @@ export const JEditableTableMixin = {
       this.eachAllTable((item) => {
         item.initialize()
       })
-      if(this.materialTable && this.materialTable.dataSource) {
-        this.materialTable.dataSource = []
-      }
       this.$emit('close')
     },
 

+ 1 - 0
jshERP-web/src/permission.js

@@ -32,6 +32,7 @@ router.beforeEach((to, from, next) => {
             })
             let constRoutes = []
             constRoutes = generateIndexRouter(menuData)
+            store.dispatch('updateApprovalStat')
             // 添加主界面路由
             store.dispatch('UpdateAppRouter', { constRoutes }).then(() => {
               // 根据roles权限生成可访问的路由表

+ 2 - 0
jshERP-web/src/store/index.js

@@ -5,6 +5,7 @@ import app from './modules/app'
 import user from './modules/user'
 import permission from './modules/permission'
 import enhance from './modules/enhance'
+import approval from './modules/approval'
 import getters from './getters'
 
 Vue.use(Vuex)
@@ -15,6 +16,7 @@ export default new Vuex.Store({
     user,
     permission,
     enhance,
+    approval
   },
   state: {},
   mutations: {},

+ 26 - 0
jshERP-web/src/store/modules/approval.js

@@ -0,0 +1,26 @@
+import { getAction } from '@/api/manage'
+
+const approval = {
+  state: {
+    approvalCount: 0, // 待我审批数量
+  },
+  mutations: {
+    SET_APPROVAL_COUNT: (state, count) => {
+      state.approvalCount = count
+    },
+  },
+  actions: {
+    async updateApprovalStat({ commit }, record) {
+      try {
+        const res = await getAction('/audit/pendingApprovalCount')
+        console.log('res-----',res)
+        if(res.code===200){
+          commit('SET_APPROVAL_COUNT',res.data)
+        }
+      } catch (error) {
+        
+      }
+    },
+  },
+}
+export default approval

+ 2 - 2
jshERP-web/src/views/bill/AllocationOutList.vue

@@ -95,12 +95,12 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          >
+          > -->
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

+ 2 - 2
jshERP-web/src/views/bill/AssembleList.vue

@@ -95,12 +95,12 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          >
+          > -->
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

+ 2 - 2
jshERP-web/src/views/bill/DisassembleList.vue

@@ -95,12 +95,12 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          >
+          > -->
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

+ 3 - 7
jshERP-web/src/views/bill/OtherInList.vue

@@ -15,7 +15,7 @@
               <a-col :md="6" :sm="24">
                 <a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
                   <a-input
-                    placeholder="请输入条码、名称、助记码、规格、型号等信息"
+                    placeholder="请输入SKU、名称、助记码、规格、型号等信息"
                     v-model="queryParam.materialParam"
                   ></a-input>
                 </a-form-item>
@@ -97,6 +97,7 @@
                     <a-select placeholder="请选择单据状态" v-model="queryParam.status">
                       <a-select-option value="0">未审核</a-select-option>
                       <a-select-option value="9" v-if="!checkFlag">审核中</a-select-option>
+                      <a-select-option value="8">审核不通过</a-select-option>
                       <a-select-option value="1">已审核</a-select-option>
                     </a-select>
                   </a-form-item>
@@ -117,12 +118,6 @@
             >待入库({{ waitTotal }})</a-button
           >
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
-            >审核</a-button
-          >
-          <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
-            >反审核</a-button
-          >
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >
@@ -187,6 +182,7 @@
             <template slot="customRenderStatus" slot-scope="status">
               <a-tag v-if="status == '0'" color="red">未审核</a-tag>
               <a-tag v-if="status == '1'" color="green">已审核</a-tag>
+              <a-tag v-if="status == '8'" color="red">审核不通过</a-tag>
               <a-tag v-if="status == '9'" color="orange">审核中</a-tag>
             </template>
           </a-table>

+ 3 - 7
jshERP-web/src/views/bill/OtherOutList.vue

@@ -15,7 +15,7 @@
               <a-col :md="6" :sm="24">
                 <a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
                   <a-input
-                    placeholder="请输入条码、名称、助记码、规格、型号等信息"
+                    placeholder="请输入SKU、名称、助记码、规格、型号等信息"
                     v-model="queryParam.materialParam"
                   ></a-input>
                 </a-form-item>
@@ -97,6 +97,7 @@
                     <a-select placeholder="请选择单据状态" v-model="queryParam.status">
                       <a-select-option value="0">未审核</a-select-option>
                       <a-select-option value="9" v-if="!checkFlag">审核中</a-select-option>
+                      <a-select-option value="8">审核不通过</a-select-option>
                       <a-select-option value="1">已审核</a-select-option>
                     </a-select>
                   </a-form-item>
@@ -117,12 +118,6 @@
             >待出库({{ waitTotal }})</a-button
           >
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
-            >审核</a-button
-          >
-          <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
-            >反审核</a-button
-          >
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >
@@ -187,6 +182,7 @@
             <template slot="customRenderStatus" slot-scope="status">
               <a-tag v-if="status == '0'" color="red">未审核</a-tag>
               <a-tag v-if="status == '1'" color="green">已审核</a-tag>
+              <a-tag v-if="status == '8'" color="red">审核不通过</a-tag>
               <a-tag v-if="status == '9'" color="orange">审核中</a-tag>
             </template>
           </a-table>

+ 3 - 3
jshERP-web/src/views/bill/PurchaseApplyList.vue

@@ -83,12 +83,12 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          >
+          > -->
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >
@@ -118,7 +118,7 @@
           <a-tooltip
             placement="left"
             title="请购单只涉及数量,请购单可以转采购订单,但需要先对请购单进行审核。
-          勾选单据之后可以进行批量操作(删除、审核、反审核)"
+          勾选单据之后可以进行批量操作(删除)"
             slot="action"
           >
             <a-icon v-if="btnEnableList.indexOf(1) > -1" type="question-circle" style="font-size: 20px; float: right" />

+ 2 - 2
jshERP-web/src/views/bill/PurchaseBackList.vue

@@ -130,12 +130,12 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          >
+          > -->
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

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

@@ -15,7 +15,7 @@
               <a-col :md="6" :sm="24">
                 <a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
                   <a-input
-                    placeholder="请输入条码、名称、助记码、规格、型号等信息"
+                    placeholder="请输入SKU、名称、助记码、规格、型号等信息"
                     v-model="queryParam.materialParam"
                   ></a-input>
                 </a-form-item>
@@ -119,6 +119,9 @@
                     <a-select placeholder="请选择单据状态" v-model="queryParam.status">
                       <a-select-option value="0">未审核</a-select-option>
                       <a-select-option value="9" v-if="!checkFlag">审核中</a-select-option>
+                      <a-select-option value="6">待复核</a-select-option>
+                      <a-select-option value="7">复核驳回</a-select-option>
+                      <a-select-option value="8">审核不通过</a-select-option>
                       <a-select-option value="1">已审核</a-select-option>
                       <a-select-option value="3">部分入库</a-select-option>
                       <a-select-option value="2">完成入库</a-select-option>
@@ -138,12 +141,6 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
-            >审核</a-button
-          >
-          <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
-            >反审核</a-button
-          >
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >
@@ -174,7 +171,7 @@
             placement="left"
             title="采购入库单可以由采购订单转过来,也可以单独创建。
           采购入库单据中的仓库列表只显示当前用户有权限的仓库。采购入库单可以使用多账户付款。
-          勾选单据之后可以进行批量操作(删除、审核、反审核)"
+          勾选单据之后可以进行批量操作(删除)"
             slot="action"
           >
             <a-icon v-if="btnEnableList.indexOf(1) > -1" type="question-circle" style="font-size: 20px; float: right" />
@@ -225,6 +222,9 @@
               <a-tag v-if="status == '1'" color="green">已审核</a-tag>
               <a-tag v-if="status == '2'" color="cyan">完成入库</a-tag>
               <a-tag v-if="status == '3'" color="blue">部分入库</a-tag>
+              <a-tag v-if="status == '6'" color="purple">待复核</a-tag>
+              <a-tag v-if="status == '7'" color="purple">复核驳回</a-tag>
+              <a-tag v-if="status == '8'" color="red">审核不通过</a-tag>
               <a-tag v-if="status == '9'" color="orange">审核中</a-tag>
             </template>
           </a-table>
@@ -324,7 +324,7 @@ export default {
         { title: '商品信息', dataIndex: 'materialsList', width: 220, ellipsis: true },
         { title: '单据日期', dataIndex: 'operTimeStr', width: 145 },
         { title: '操作员', dataIndex: 'userName', width: 80, ellipsis: true },
-        { title: '复核人员', dataIndex: 'auditorName;', width: 80, ellipsis: true },
+        { title: '复核人员', dataIndex: 'auditorName;', width: 80 },
         { title: '数量', dataIndex: 'materialCount', width: 60 },
         { title: '金额合计', dataIndex: 'totalPrice', width: 80 },
         {
@@ -362,7 +362,7 @@ export default {
         {
           title: '状态',
           dataIndex: 'status',
-          width: 80,
+          width: 100,
           align: 'center',
           scopedSlots: { customRender: 'customRenderStatus' },
         },

+ 12 - 11
jshERP-web/src/views/bill/PurchaseOrderList.vue

@@ -15,7 +15,7 @@
               <a-col :md="6" :sm="24">
                 <a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
                   <a-input
-                    placeholder="请输入条码、名称、助记码、规格、型号等信息"
+                    placeholder="请输入SKU、名称、助记码、规格、型号等信息"
                     v-model="queryParam.materialParam"
                   ></a-input>
                 </a-form-item>
@@ -87,10 +87,14 @@
                   <a-form-item label="单据状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
                     <a-select placeholder="请选择单据状态" v-model="queryParam.status">
                       <a-select-option value="0">未审核</a-select-option>
-                      <a-select-option value="9" v-if="!checkFlag">审核中</a-select-option>
                       <a-select-option value="1">已审核</a-select-option>
-                      <a-select-option value="3">部分采购</a-select-option>
                       <a-select-option value="2">完成采购</a-select-option>
+                      <a-select-option value="3">部分采购</a-select-option>
+                      <a-select-option value="4">进行中</a-select-option>
+                      <a-select-option value="6">待复核</a-select-option>
+                      <a-select-option value="7">复核驳回</a-select-option>
+                      <a-select-option value="8">审核不通过</a-select-option>
+                      <a-select-option value="9" v-if="!checkFlag">审核中</a-select-option>
                     </a-select>
                   </a-form-item>
                 </a-col>
@@ -107,12 +111,6 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
-            >审核</a-button
-          >
-          <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
-            >反审核</a-button
-          >
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >
@@ -147,7 +145,7 @@
           <a-tooltip
             placement="left"
             title="采购订单不涉及付款金额,采购订单可以转采购入库单,但需要先对采购订单进行审核。
-          勾选单据之后可以进行批量操作(删除、审核、反审核)"
+          勾选单据之后可以进行批量操作(删除)"
             slot="action"
           >
             <a-icon v-if="btnEnableList.indexOf(1) > -1" type="question-circle" style="font-size: 20px; float: right" />
@@ -190,6 +188,9 @@
               <a-tag v-if="status == '2'" color="cyan">完成采购</a-tag>
               <a-tag v-if="status == '3'" color="blue">部分采购</a-tag>
               <a-tag v-if="status == '4'" color="purple">进行中</a-tag>
+              <a-tag v-if="status == '6'" color="purple">待复核</a-tag>
+              <a-tag v-if="status == '7'" color="red">复核驳回</a-tag>
+              <a-tag v-if="status == '8'" color="red">审核不通过</a-tag>
               <a-tag v-if="status == '9'" color="orange">审核中</a-tag>
             </template>
           </a-table>
@@ -316,7 +317,7 @@ export default {
         {
           title: '状态',
           dataIndex: 'status',
-          width: 80,
+          width: 100,
           align: 'center',
           scopedSlots: { customRender: 'customRenderStatus' },
         },

+ 2 - 2
jshERP-web/src/views/bill/RetailBackList.vue

@@ -128,12 +128,12 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          >
+          > -->
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

+ 2 - 2
jshERP-web/src/views/bill/RetailOutList.vue

@@ -123,12 +123,12 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          >
+          > -->
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

+ 2 - 2
jshERP-web/src/views/bill/SaleBackList.vue

@@ -131,12 +131,12 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          >
+          > -->
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

+ 9 - 9
jshERP-web/src/views/bill/SaleOrderList.vue

@@ -16,7 +16,7 @@
               <a-col :md="6" :sm="24">
                 <a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
                   <a-input
-                    placeholder="请输入条码、名称、助记码、规格、型号等信息"
+                    placeholder="请输入SKU、名称、助记码、规格、型号等信息"
                     v-model="queryParam.materialParam"
                   ></a-input>
                 </a-form-item>
@@ -79,6 +79,9 @@
                     <a-select placeholder="请选择单据状态" v-model="queryParam.status">
                       <a-select-option value="0">未审核</a-select-option>
                       <a-select-option value="9" v-if="!checkFlag">审核中</a-select-option>
+                      <a-select-option value="6">待复核</a-select-option>
+                      <a-select-option value="7">复核驳回</a-select-option>
+                      <a-select-option value="8">审核不通过</a-select-option>
                       <a-select-option value="1">已审核</a-select-option>
                       <a-select-option value="3">部分销售</a-select-option>
                       <a-select-option value="2">完成销售</a-select-option>
@@ -98,12 +101,6 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
-            >审核</a-button
-          >
-          <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
-            >反审核</a-button
-          >
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >
@@ -133,7 +130,7 @@
           <a-tooltip
             placement="left"
             title="销售订单不涉及收款金额,销售订单可以转销售出库单,但需要先对销售订单进行审核。
-          勾选单据之后可以进行批量操作(删除、审核、反审核)"
+          勾选单据之后可以进行批量操作(删除)"
             slot="action"
           >
             <a-icon v-if="btnEnableList.indexOf(1) > -1" type="question-circle" style="font-size: 20px; float: right" />
@@ -176,6 +173,9 @@
               <a-tag v-if="status == '2'" color="cyan">完成销售</a-tag>
               <a-tag v-if="status == '3'" color="blue">部分销售</a-tag>
               <a-tag v-if="status == '4'" color="blue">进行中</a-tag>
+              <a-tag v-if="status == '6'" color="purple">待复核</a-tag>
+              <a-tag v-if="status == '7'" color="purple">复核驳回</a-tag>
+              <a-tag v-if="status == '8'" color="red">审核不通过</a-tag>
               <a-tag v-if="status == '9'" color="orange">审核中</a-tag>
             </template>
             <template slot="customRenderPurchaseStatus" slot-scope="purchaseStatus">
@@ -303,7 +303,7 @@ export default {
         {
           title: '状态',
           dataIndex: 'status',
-          width: 70,
+          width: 100,
           align: 'center',
           scopedSlots: { customRender: 'customRenderStatus' },
         },

+ 9 - 9
jshERP-web/src/views/bill/SaleOutList.vue

@@ -16,7 +16,7 @@
               <a-col :md="6" :sm="24">
                 <a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
                   <a-input
-                    placeholder="请输入条码、名称、助记码、规格、型号等信息"
+                    placeholder="请输入SKU、名称、助记码、规格、型号等信息"
                     v-model="queryParam.materialParam"
                   ></a-input>
                 </a-form-item>
@@ -120,6 +120,9 @@
                     <a-select placeholder="请选择单据状态" v-model="queryParam.status">
                       <a-select-option value="0">未审核</a-select-option>
                       <a-select-option value="9" v-if="!checkFlag">审核中</a-select-option>
+                      <a-select-option value="6">待复核</a-select-option>
+                      <a-select-option value="7">复核驳回</a-select-option>
+                      <a-select-option value="8">审核不通过</a-select-option>
                       <a-select-option value="1">已审核</a-select-option>
                       <a-select-option value="3">部分出库</a-select-option>
                       <a-select-option value="2">完成出库</a-select-option>
@@ -139,12 +142,6 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
-            >审核</a-button
-          >
-          <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
-            >反审核</a-button
-          >
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >
@@ -175,7 +172,7 @@
             placement="left"
             title="销售出库单可以由销售订单转过来,也可以单独创建。
           销售出库单据中的仓库列表只显示当前用户有权限的仓库。销售出库单可以使用多账户收款。
-          勾选单据之后可以进行批量操作(删除、审核、反审核)"
+          勾选单据之后可以进行批量操作(删除)"
             slot="action"
           >
             <a-icon v-if="btnEnableList.indexOf(1) > -1" type="question-circle" style="font-size: 20px; float: right" />
@@ -226,6 +223,9 @@
               <a-tag v-if="status == '1'" color="green">已审核</a-tag>
               <a-tag v-if="status == '2'" color="cyan">完成出库</a-tag>
               <a-tag v-if="status == '3'" color="blue">部分出库</a-tag>
+              <a-tag v-if="status == '8'" color="red">审核不通过</a-tag>
+              <a-tag v-if="status == '6'" color="purple">待复核</a-tag>
+              <a-tag v-if="status == '7'" color="purple">复核驳回</a-tag>
               <a-tag v-if="status == '9'" color="orange">审核中</a-tag>
             </template>
           </a-table>
@@ -363,7 +363,7 @@ export default {
         {
           title: '状态',
           dataIndex: 'status',
-          width: 80,
+          width: 100,
           align: 'center',
           scopedSlots: { customRender: 'customRenderStatus' },
         },

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

@@ -11,7 +11,7 @@
     @cancel="handleCancel"
     wrapClassName="ant-modal-cust-warp"
   >
-    <template slot="footer">
+    <template slot="footer" v-if="!approvalId">
       <!--打印-->
       <a-button key="back" @click="handleCancel">取消(ESC)</a-button>
       <template v-if="isShowPrintBtn">
@@ -34,7 +34,7 @@
         <a-button v-if="billType === '盘点复盘'" v-print="'#stockCheckReplayPrint'">普通打印</a-button>
       </template>
       <!--导出Excel-->
-      <a-button v-if="billType === '零售出库' || billType === '零售退货入库'" @click="retailExportExcel()"
+      <!-- <a-button v-if="billType === '零售出库' || billType === '零售退货入库'" @click="retailExportExcel()"
         >导出</a-button
       >
       <a-button v-if="billType === '请购单'" @click="applyExportExcel()">导出</a-button>
@@ -52,9 +52,12 @@
       <a-button v-if="billType === '其它入库' || billType === '其它出库'" @click="otherExportExcel()">导出</a-button>
       <a-button v-if="billType === '调拨出库'" @click="allocationOutExportExcel()">导出</a-button>
       <a-button v-if="billType === '组装单' || billType === '拆卸单'" @click="assembleExportExcel()">导出</a-button>
-      <a-button v-if="billType === '盘点复盘'" @click="stockCheckReplayExportExcel()">导出</a-button>
-      <!--反审核-->
-      <a-button v-if="checkFlag && isCanBackCheck && model.status === '1'" @click="handleBackCheck()">反审核</a-button>
+      <a-button v-if="billType === '盘点复盘'" @click="stockCheckReplayExportExcel()">导出</a-button> -->
+    </template>
+    <template slot="footer" v-else>
+      <a-button v-if="!approvalIsReadonly" :loading="confirmLoading" @click="submitApproval(2)">审核不通过</a-button>
+      <a-button type="primary" v-if="!approvalIsReadonly" :loading="confirmLoading" @click="submitApproval(1)">审核通过</a-button>
+      <a-button key="back" v-if="approvalIsReadonly" @click="handleCancel">取消(ESC)</a-button>
     </template>
     <a-form :form="form">
       <!--零售出库-->
@@ -1902,7 +1905,7 @@
           <a-col :span="14"></a-col>
         </a-row>
       </template>
-      <template v-if="fileList && fileList.length > 0">
+      <template v-if="voucherPictureList && voucherPictureList.length > 0">
         <a-row class="form-row" :gutter="24">
           <a-col :span="10">
             <a-form-item
@@ -1917,6 +1920,22 @@
         </a-row>
       </template>
     </a-form>
+    <!-- 审批历史 -->
+     <section v-if="approvalId">
+      <h4 class="block-title">审批历史</h4>
+      <a-table 
+        size="middle"
+        bordered
+        rowKey="id"
+        :pagination="false"
+        :loading="approval.loading"
+        :columns="approval.columns"
+        :rowClassName="rowClassName"
+        :dataSource="approval.dataSource"
+        :scroll="{ x: '100%' }"
+      ></a-table>
+      <a-textarea :rows="1" placeholder="审核备注" v-model="auditComment" v-if="!approvalIsReadonly" style="margin-top: 8px" />
+     </section>
     <bill-print-iframe ref="modalDetail"></bill-print-iframe>
     <financial-detail ref="financialDetailModal"></financial-detail>
   </j-modal>
@@ -1936,7 +1955,8 @@ import BillPrintIframe from './BillPrintIframe'
 import FinancialDetail from '../../financial/dialog/FinancialDetail'
 import JUpload from '@/components/jeecg/JUpload'
 import JEllipsis from '@/components/jeecg/JEllipsis'
-import Vue from 'vue'
+import Vue, { isReadonly } from 'vue'
+import { mapGetters } from 'vuex'
 // import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 // import QrcodeVue from 'qrcode.vue'
 // import VueQr from 'vue-qr'
@@ -1952,6 +1972,9 @@ export default {
     JEllipsis
     // VueQr,
   },
+  computed:{
+    ...mapGetters(['username'])
+  },
   data() {
     return {
       title: '详情',
@@ -2014,7 +2037,6 @@ export default {
         { title: '序列号', dataIndex: 'snList', width: 300 },
         { title: '批号', dataIndex: 'batchNumber' },
         { title: '有效期', dataIndex: 'expirationDate' },
-        { title: '多属性', dataIndex: 'sku' },
         { title: '数量', dataIndex: 'operNumber' },
         { title: '单价', dataIndex: 'unitPrice' },
         { title: '金额', dataIndex: 'allPrice' },
@@ -2037,7 +2059,6 @@ export default {
         { title: '序列号', dataIndex: 'snList', width: 300 },
         { title: '批号', dataIndex: 'batchNumber' },
         { title: '有效期', dataIndex: 'expirationDate' },
-        { title: '多属性', dataIndex: 'sku' },
         { title: '数量', dataIndex: 'operNumber' },
         { title: '单价', dataIndex: 'unitPrice' },
         { title: '金额', dataIndex: 'allPrice' },
@@ -2055,7 +2076,6 @@ export default {
         { title: '制造商', dataIndex: 'mfrs' },
         { title: '扩展信息', dataIndex: 'materialOther' },
         { title: '单位', dataIndex: 'unit' },
-        { title: '多属性', dataIndex: 'sku' },
         { title: '数量', dataIndex: 'operNumber' },
         { title: '已采购', dataIndex: 'finishNumber' },
         { title: '备注', dataIndex: 'remark' },
@@ -2066,7 +2086,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 },
@@ -2076,11 +2096,10 @@ export default {
         { title: '品牌', dataIndex: 'brand', width: 90 },
         { title: '制造商', dataIndex: 'mfrs', width: 90 },
         { title: '扩展信息', dataIndex: 'materialOther', width: 90 },
-        { title: '库存', dataIndex: 'inventory', width: 90 },
+        { title: '库存', dataIndex: 'stock', width: 90 },
         { title: '单位', dataIndex: 'unit', width: 90 },
         { title: '序列号', dataIndex: 'snList', width: 300 },
         { title: '有效期', dataIndex: 'expirationDate', width: 90 },
-        { title: '多属性', dataIndex: 'sku', width: 90 },
         { title: '入库数量', dataIndex: 'operNumber', width: 90 },
         { title: '已入库', dataIndex: 'finishNumber', width: 90 },
         { title: '单价', dataIndex: 'unitPrice', width: 90 },
@@ -2100,7 +2119,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 },
@@ -2110,11 +2129,10 @@ export default {
         { title: '品牌', dataIndex: 'brand', width: 90 },
         { title: '制造商', dataIndex: 'mfrs', width: 90 },
         { title: '扩展信息', dataIndex: 'materialOther', width: 90 },
-        { title: '库存', dataIndex: 'inventory', width: 90 },
+        { title: '库存', dataIndex: 'stock', width: 90 },
         { title: '单位', dataIndex: 'unit', width: 90 },
         { title: '序列号', dataIndex: 'snList', width: 300 },
         { title: '有效期', dataIndex: 'expirationDate', width: 90 },
-        { title: '多属性', dataIndex: 'sku', width: 90 },
         { title: '入库数量', dataIndex: 'operNumber', width: 90 },
         { title: '已入库', dataIndex: 'finishNumber', width: 90 },
         { title: '单价', dataIndex: 'unitPrice', width: 90 },
@@ -2142,7 +2160,6 @@ export default {
         { title: '序列号', dataIndex: 'snList', width: 300 },
         { title: '批号', dataIndex: 'batchNumber' },
         { title: '有效期', dataIndex: 'expirationDate' },
-        { title: '多属性', dataIndex: 'sku' },
         { title: '数量', dataIndex: 'operNumber' },
         { title: '已出库', dataIndex: 'finishNumber' },
         { title: '单价', dataIndex: 'unitPrice' },
@@ -2159,7 +2176,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 },
@@ -2170,11 +2187,10 @@ export default {
         { title: '品牌', dataIndex: 'brand', width: 90 },
         { title: '制造商', dataIndex: 'mfrs', width: 90 },
         { title: '扩展信息', dataIndex: 'materialOther', width: 90 },
-        { title: '库存', dataIndex: 'inventory', width: 90 },
+        { title: '库存', dataIndex: 'stock', width: 90 },
         { title: '单位', dataIndex: 'unit', width: 90 },
         { title: '序列号', dataIndex: 'snList', width: 300 },
         { title: '有效期', dataIndex: 'expirationDate', width: 90 },
-        { title: '多属性', dataIndex: 'sku', width: 90 },
         { title: '出库数量', dataIndex: 'operNumber', width: 90 },
         { title: '已出库', dataIndex: 'finishNumber', width: 90 },
         { title: '单价', dataIndex: 'unitPrice', width: 90 },
@@ -2193,7 +2209,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 },
@@ -2204,11 +2220,10 @@ export default {
         { title: '品牌', dataIndex: 'brand', width: 90 },
         { title: '制造商', dataIndex: 'mfrs', width: 90 },
         { title: '扩展信息', dataIndex: 'materialOther', width: 90 },
-        { title: '库存', dataIndex: 'inventory', width: 90 },
+        { title: '库存', dataIndex: 'stock', width: 90 },
         { title: '单位', dataIndex: 'unit', width: 90 },
         { title: '序列号', dataIndex: 'snList', width: 300 },
         { title: '有效期', dataIndex: 'expirationDate', width: 90 },
-        { title: '多属性', dataIndex: 'sku', width: 90 },
         { title: '出库数量', dataIndex: 'operNumber', width: 90 },
         { title: '已出库', dataIndex: 'finishNumber', width: 90 },
         { title: '单价', dataIndex: 'unitPrice', width: 90 },
@@ -2236,7 +2251,6 @@ export default {
         { title: '序列号', dataIndex: 'snList', width: 300 },
         { title: '批号', dataIndex: 'batchNumber' },
         { title: '有效期', dataIndex: 'expirationDate' },
-        { title: '多属性', dataIndex: 'sku' },
         { title: '数量', dataIndex: 'operNumber' },
         { title: '已入库', dataIndex: 'finishNumber' },
         { title: '单价', dataIndex: 'unitPrice' },
@@ -2255,7 +2269,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 },
@@ -2265,11 +2279,10 @@ export default {
         { title: '品牌', dataIndex: 'brand', width: 90 },
         { title: '制造商', dataIndex: 'mfrs', width: 90 },
         { title: '扩展信息', dataIndex: 'materialOther', width: 90 },
-        { title: '库存', dataIndex: 'inventory', width: 90 },
+        { title: '库存', dataIndex: 'stock', width: 90 },
         { title: '单位', dataIndex: 'unit', width: 90 },
         { title: '序列号', dataIndex: 'snList', width: 300 },
         { title: '有效期', dataIndex: 'expirationDate', width: 90 },
-        { title: '多属性', dataIndex: 'sku', width: 90 },
         { title: '入库数量', dataIndex: 'operNumber', width: 90 },
         { title: '单价', dataIndex: 'unitPrice', width: 90 },
         { title: '金额', dataIndex: 'allPrice', width: 90 },
@@ -2281,7 +2294,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 },
@@ -2292,11 +2305,10 @@ export default {
         { title: '品牌', dataIndex: 'brand', width: 90 },
         { title: '制造商', dataIndex: 'mfrs', width: 90 },
         { title: '扩展信息', dataIndex: 'materialOther', width: 90 },
-        { title: '库存', dataIndex: 'inventory', width: 90 },
+        { title: '库存', dataIndex: 'stock', width: 90 },
         { title: '单位', dataIndex: 'unit', width: 90 },
         { title: '序列号', dataIndex: 'snList', width: 300 },
         { title: '有效期', dataIndex: 'expirationDate', width: 90 },
-        { title: '多属性', dataIndex: 'sku', width: 90 },
         { title: '出库数量', dataIndex: 'operNumber', width: 90 },
         { title: '单价', dataIndex: 'unitPrice', width: 90 },
         { title: '金额', dataIndex: 'allPrice', width: 90 },
@@ -2312,7 +2324,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 },
@@ -2323,10 +2335,9 @@ export default {
         { title: '品牌', dataIndex: 'brand', width: 90 },
         { title: '制造商', dataIndex: 'mfrs', width: 90 },
         { title: '扩展信息', dataIndex: 'materialOther', width: 90 },
-        { title: '库存', dataIndex: 'inventory', width: 90 },
+        { title: '库存', dataIndex: 'stock', width: 90 },
         { title: '调入仓库', dataIndex: 'anotherDepotName' },
         { title: '单位', dataIndex: 'unit', width: 90 },
-        { title: '多属性', dataIndex: 'sku' },
         { title: '数量', dataIndex: 'operNumber', width: 90 },
         { title: '单价', dataIndex: 'unitPrice', width: 90 },
         { title: '金额', dataIndex: 'allPrice', width: 90 },
@@ -2351,7 +2362,6 @@ export default {
         { title: '扩展信息', dataIndex: 'materialOther' },
         { title: '库存', dataIndex: 'stock' },
         { title: '单位', dataIndex: 'unit' },
-        { title: '多属性', dataIndex: 'sku' },
         { title: '数量', dataIndex: 'operNumber' },
         { title: '单价', dataIndex: 'unitPrice' },
         { title: '金额', dataIndex: 'allPrice' },
@@ -2370,7 +2380,6 @@ export default {
         { title: '扩展信息', dataIndex: 'materialOther' },
         { title: '库存', dataIndex: 'stock' },
         { title: '单位', dataIndex: 'unit' },
-        { title: '多属性', dataIndex: 'sku' },
         { title: '数量', dataIndex: 'operNumber' },
         { title: '单价', dataIndex: 'unitPrice' },
         { title: '金额', dataIndex: 'allPrice' },
@@ -2387,12 +2396,43 @@ export default {
         { title: '扩展信息', dataIndex: 'materialOther' },
         { title: '库存', dataIndex: 'stock' },
         { title: '单位', dataIndex: 'unit' },
-        { title: '多属性', dataIndex: 'sku' },
         { title: '数量', dataIndex: 'operNumber' },
         { title: '单价', dataIndex: 'unitPrice' },
         { title: '金额', dataIndex: 'allPrice' },
         { title: '备注', dataIndex: 'remark' },
       ],
+
+      // 审批历史
+      confirmLoading: false,
+      approvalId: null,
+      approvalIsReadonly: false,
+      approval:{
+        loading:false,
+        columns:[
+          { title: '审核时间', dataIndex: 'auditTime' },
+          { title: '审核环节', dataIndex: 'nodeOrder',customRender(text,record,index){
+            if(index===0){
+              return text
+            }
+            return `审批节点${text}`
+          } },
+          { title: '审批人', dataIndex: 'auditorName' },
+          { title: '审核动作', dataIndex: 'auditResult',customRender(text,record,index){
+            if(index===0){
+              return text
+            }
+            if(text==1){
+              return '审批通过'
+            }else if(text==2){
+              return '审批不通过'
+            }
+            return ''
+          } },
+          { title: '备注', dataIndex: 'auditComment' },
+        ],
+        dataSource:[]
+      },
+      auditComment: ''
     }
   },
   created() {
@@ -2598,10 +2638,15 @@ export default {
         }
       })
     },
-    show(record, type, prefixNo) {
+    rowClassName(record,index){
+      if(this.username===record.auditorName){
+        return 'red-row'
+      }
+      return ''
+    },
+    show(record, type, prefixNo, approvalRow=null) {
       //查询单条单据信息
       findBillDetailByNumber({ number: record.number }).then((res) => {
-        console.log('findBillDetailByNumber-----------',res)
         if (res && res.code === 200) {
           let item = res.data
           this.billType = type
@@ -2617,12 +2662,6 @@ export default {
           } else {
             this.model.getAmount = this.model.changeAmount
           }
-          // this.model.debt = (
-          //   this.model.discountLastMoney +
-          //   this.model.otherMoney -
-          //   (this.model.deposit + this.model.changeAmount)
-          // ).toFixed(2)
-          this.model.debt = item.debt
           this.$nextTick(() => {
             this.form.setFieldsValue(pick(this.model, 'id'))
           })
@@ -2661,6 +2700,21 @@ export default {
           this.getFinancialBillNoByBillId(this.model.id)
         }
       })
+      //审批历史
+      if(approvalRow&&approvalRow.id){
+        this.approvalId = approvalRow.id
+        getAction('/audit/auditHistory',{id:approvalRow.id}).then(res => {
+          const list = res.data
+          list.unshift({
+            auditTime: approvalRow.submitTime,
+            nodeOrder: '开始',
+            auditorName: approvalRow.initiatorName,
+            auditResult: '提交审批',
+            auditComment: '',
+          })
+          this.approval.dataSource = list
+        })
+      }
     },
     requestSubTableData(record, type, url, params, success) {
       this.loading = true
@@ -2705,6 +2759,10 @@ export default {
       this.$emit('close')
       this.visible = false
       this.modalStyle = ''
+      this.approvalId = null
+      this.approvalIsReadonly = false
+      this.approval.dataSource = []
+      this.auditComment = ''
     },
     myHandleDetail(billNumber) {
       findBillDetailByNumber({ number: billNumber }).then((res) => {
@@ -3059,6 +3117,26 @@ export default {
       let columnsStr = checkedValues.join()
       Vue.ls.set(`${this.prefixNo}_XQ`, columnsStr)
     },
+    submitApproval(status){
+      const params = {
+        id: this.approvalId,
+        status,
+        auditComment: this.auditComment
+      }
+      this.confirmLoading = true
+      postAction('/audit/setStatus',params).then(res => {
+        console.log(res)
+        if(res.code===200){
+          this.$message.success(res.msg)
+          this.handleCancel()
+          this.$emit('ok')
+        }else{
+          this.$message.error(res.data.message)
+        }
+      }).finally(() => {
+       this.confirmLoading = false
+      })
+    }
   },
 }
 </script>
@@ -3081,4 +3159,12 @@ export default {
 .table-operator {
   margin-bottom: 18px;
 }
+
+.block-title{
+  font-size: 16px;
+  margin-bottom: 10px;
+}
+::v-deep .red-row{
+  color: #f5222d;
+}
 </style>

+ 1 - 1
jshERP-web/src/views/bill/dialog/HistoryBillList.vue

@@ -42,7 +42,7 @@
             </a-col>
             <a-col :md="5" :sm="24">
               <a-form-item label="商品" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
-                <a-input placeholder="条码|名称|规格|型号" v-model="queryParam.materialParam"></a-input>
+                <a-input placeholder="SKU|名称|规格|型号" v-model="queryParam.materialParam"></a-input>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">

+ 3 - 2
jshERP-web/src/views/bill/dialog/LinkBillList.vue

@@ -26,7 +26,7 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="商品信息" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
-                <a-input placeholder="条码|名称|规格|型号" v-model="queryParam.materialParam"></a-input>
+                <a-input placeholder="SKU|名称|规格|型号" v-model="queryParam.materialParam"></a-input>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -209,7 +209,7 @@ export default {
         },
       ],
       columnsDetail: [
-        { title: '条码', dataIndex: 'barCode', width: 120 },
+        { title: 'SKU', dataIndex: 'sku', width: 120 },
         { title: '名称', dataIndex: 'name', width: 100, ellipsis: true },
         { title: '规格', dataIndex: 'standard', width: 100, ellipsis: true },
         { title: '型号', dataIndex: 'model', width: 150, ellipsis: true },
@@ -381,6 +381,7 @@ export default {
           if (res.code === 200) {
             let list = res.data.rows
             let listEx = []
+            console.log('listEx', listEx)
             for (let j = 0; j < list.length; j++) {
               let info = list[j]
               if (info.finishNumber < info.preNumber) {

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

@@ -83,11 +83,10 @@ export const BillListMixin = {
       this.$refs.modalForm.disableSubmit = false
       //开启明细的编辑模式
       this.$refs.modalForm.rowCanEdit = true
-      let columnIndex = record.subType === '组装单' || record.subType === '拆卸单' ? 2 : 0
-      this.$refs.modalForm.materialTable.columns[columnIndex].type = FormTypes.popupJsh
     },
     myHandleEdit(record) {
-      if (record.status === '0') {
+      // 未审核、不通过可编辑
+      if (record.status === '0'||record.status === '8') {
         this.$refs.modalForm.action = 'edit'
         if (this.btnEnableList.indexOf(2) === -1) {
           this.$refs.modalForm.isCanCheck = false

+ 63 - 219
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'
@@ -81,14 +78,6 @@ export const BillModalMixin = {
     this.width = realScreenWidth < 1500 ? '1200px' : '1550px'
     this.minWidth = realScreenWidth < 1500 ? 1150 : 1500
   },
-  watch:{
-    $route(to, from) {
-      if(this.handleCancel){
-        this.handleCancel()
-      }
-      this.visible = false
-    }
-  },
   mounted() {
     document.getElementById(this.prefixNo).addEventListener('keydown', this.handleOkKey)
     this.getCreatorSpinnerList()
@@ -161,15 +150,6 @@ export const BillModalMixin = {
         .then((res) => {
           if (res && res.code === 200) {
             tab.dataSource = res.data.rows
-            for (let i = 0; i < tab.dataSource.length; i++) {
-              let info = tab.dataSource[i]
-              info.isEdit = this.model.id ? 1 : 0
-              if (info.unitId) {
-                info.unitList = JSON.stringify(info.unitList)
-              }
-
-              this.changeColumnShow(info)
-            }
             typeof success === 'function' ? success(res) : ''
           }
         })
@@ -281,10 +261,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 +270,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 +368,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 +388,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,13 +447,13 @@ 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,
-              values: { position:position,inventory: stock, stock,depotId },
+              values: { position:position,stock,depotId },
             })
           }
         }
@@ -549,63 +461,64 @@ export const BillModalMixin = {
         target.$forceUpdate()
       })
     },
+    handleSelectMaterial({rows,target,index,value}){
+      console.log('handleSelectMaterial',rows)
+      console.log('target',target)
+      const param = {
+        sku: rows.map(item => item.sku).join(','),
+        organId: this.form.getFieldValue('organId'),
+        prefixNo: this.prefixNo,
+      }
+      const formDepotId = this.form.getFieldValue('depotId')
+      const formTaxRate = this.form.getFieldValue('taxRate')
+      getMaterialBySku(param).then(async (res) => {
+        if (res && res.code === 200) {
+          let mList = res.data
+          let mArr = await target.getValuesPromise(false)
+          const preSkuList = mArr.map(item => item.sku)
+          const newList = mList.filter(item => !preSkuList.includes(item.sku)) // 新sku
+          if(newList.length===0){
+            this.$message.warning('此列表已存在选择的sku')
+            return
+          }
+          for(let i = 0; i < newList.length; i++){
+            const rawInfo = newList[i]
+            const mObj = this.parseInfoToObj(rawInfo)
+            const ratio = mObj.ratio || 1
+            mObj.allPrice = ((mObj.unitPrice - 0)* ratio* (mObj.operNumber)).toFixed(2) - 0
+            mObj.taxRate = formTaxRate || 0
+            mObj.taxMoney = (mObj.taxRate * 0.01 * mObj.allPrice).toFixed(2) - 0
+            mObj.taxLastMoney = (mObj.allPrice + mObj.taxMoney).toFixed(2)
+            mObj.depotId = formDepotId
+            mObj.position = ''
+            if(formDepotId){
+              const res = await findStockByDepotAndSku({ depotId: formDepotId, sku: mObj.sku })
+              const {position='',stock=0} = res.data
+              mObj.stock = stock
+              mObj.position = position
+            }
+            if(!value&&i==0){
+              mArr[index] = mObj
+            }else{
+              mArr.splice(index,0,mObj)
+            }
+          }
+          this.materialTable.dataSource = mArr
+          target.$nextTick(() => {
+            target.recalcAllStatisticsColumns()
+            setTimeout(() => {
+              this.autoChangePrice(target)
+            },100)
+          })
+        }
+      })
+    },
     //单元值改变一个字符就触发一次
     onValueChange(event) {
       let that = this
-      const { type, row, column, value, target } = event
-      let param, snList, batchNumber, operNumber, unitPrice, allPrice, taxRate, taxMoney, taxLastMoney,ratio
+      const { row, column, value, target } = event
+      let snList, 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':
-          param = {
-            barCode: 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) => {
-            if (res && res.code === 200) {
-              let mList = res.data
-              let mArr = await target.getValuesPromise(false)
-              const clickRowIndex = mArr.findIndex(item => item.id === row.id)
-              for(let i = 0; i < mList.length; i++){
-                const rawInfo = mList[i]
-                const mObj = that.parseInfoToObj(rawInfo)
-                const ratio = mObj.ratio || 1
-                mObj.allPrice = ((mObj.unitPrice - 0)* ratio* (mObj.operNumber))
-                mObj.taxRate = formTaxRate || 0
-                mObj.taxMoney = (mObj.taxRate * 0.01 * mObj.allPrice).toFixed(2) - 0
-                mObj.taxLastMoney = (mObj.allPrice + mObj.taxMoney)
-                mObj.depotId = formDepotId
-                mObj.position = ''
-                if(formDepotId){
-                  const res = await findStockByDepotAndBarCode({ depotId: formDepotId, barCode: mObj.barCode })
-                  const {position='',stock=0} = res.data
-                  mObj.stock = stock
-                  mObj.inventory = stock
-                  mObj.position = position
-                }
-                mArr.splice(clickRowIndex,0,mObj)
-              }
-              this.materialTable.dataSource = mArr.filter(item => item.id !== row.id)
-              target.$nextTick(() => {
-                target.recalcAllStatisticsColumns()
-                setTimeout(() => {
-                  that.autoChangePrice(target)
-                },100)
-              })
-            }
-          })
-          break
         case 'snList':
           snList = value
           if (snList) {
@@ -656,72 +569,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 +582,6 @@ export const BillModalMixin = {
         brand: mInfo.brand,
         materialOther: mInfo.materialOther,
         unit: mInfo.commodityUnit,
-        sku: mInfo.sku,
         operNumber: 1,
         unitPrice: mInfo.billPrice, //单价
         wholesaleDecimal:mInfo.defaultWholesaleDecimal, //销售价
@@ -747,7 +599,7 @@ export const BillModalMixin = {
         unitId: mInfo.unitId,
         unitList: mInfo.unitList,
         depotId: mInfo.depotId,
-        inventory: mInfo.inventory,
+        stock: mInfo.stock,
         ratio: mInfo.ratio,
       }
     },
@@ -756,9 +608,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,15 +624,9 @@ 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)
       }
-      if (info.sku) {
-        this.changeFormTypes(this.materialTable.columns, 'sku', 1)
-      }
       if (info.enableSerialNumber === '1') {
         //如果开启出入库管理,并且类型等于采购、采购退货、销售、销售退货,则跳过
         if (
@@ -1162,7 +1006,7 @@ export const BillModalMixin = {
     },
     //保存并审核
     handleOkAndCheck() {
-      this.billStatus = '1'
+      this.billStatus = '9'
       this.handleOk()
     },
     //发起流程

+ 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"

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

@@ -16,15 +16,13 @@
     <template slot="footer">
       <a-button @click="handleCancel">取消</a-button>
       <a-button v-if="billPrintFlag && isShowPrintBtn" @click="handlePrint('其它入库')">三联打印预览</a-button>
-      <a-button v-if="checkFlag && isCanCheck" :loading="confirmLoading" @click="handleOkAndCheck">保存并审核</a-button>
+      <a-button :loading="confirmLoading" @click="handleOkAndCheck">保存并申请审核</a-button>
       <a-button type="primary" :loading="confirmLoading" @click="handleOk">保存(Ctrl+S)</a-button>
-      <!--发起多级审核-->
-      <a-button v-if="!checkFlag" @click="handleWorkflow()" type="primary">提交流程</a-button>
     </template>
     <a-spin :spinning="confirmLoading">
       <a-form :form="form">
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="供应商">
               <a-select
                 placeholder="请选择供应商"
@@ -53,17 +51,17 @@
               </a-select>
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
               <j-date v-decorator="['operTime', validatorRules.operTime]" :show-time="true" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
               <a-input placeholder="请输入单据编号" v-decorator.trim="['number']" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -76,7 +74,7 @@
               </a-select>
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -85,7 +83,7 @@
               <a-input placeholder="自动带出" disabled v-decorator="['taxRate']" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               v-if="inOutManageFlag && !model.billType"
               :labelCol="labelCol"
@@ -107,7 +105,7 @@
           :loading="materialTable.loading"
           :columns="materialTable.columns"
           :dataSource="materialTable.dataSource"
-          :minWidth="minWidth"
+          minWidth="100%"
           :maxHeight="300"
           :rowNumber="false"
           :rowSelection="rowCanEdit"
@@ -116,7 +114,6 @@
           @valueChange="onValueChange"
           @added="onAdded"
           @deleted="onDeleted"
-          @focusChange="getUnitInfo"
         >
           <template #buttonAfter>
             <a-row
@@ -125,14 +122,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"
@@ -149,6 +146,7 @@
           <template #depotId="{ value }">
             <a-select
               disabled
+              :showArrow="false"
               :value="value"
               :options="depotList"
             >
@@ -168,26 +166,6 @@
               </a-tooltip>
             </a-input>
           </template>
-          <!-- <template #depotBatchSet>
-            <a-icon type="down" @click="handleBatchSetDepot" />
-          </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>
           <template #warehousingUser="{ handleChange, value }">
             <a-select
               placeholder="请选择"
@@ -202,23 +180,26 @@
             >
             </a-select>
           </template>
+          <template #sku="{ value, index, target,rowId }">
+            <JSelectMaterial :value="value" @change="($event) => handleSelectMaterial({...$event,target,rowId,index,value})"></JSelectMaterial>
+          </template>
         </j-editable-table>
-        <a-row class="form-row" :gutter="24">
+        <a-row class="form-row" :gutter="24" type="flex">
           <a-col :lg="24" :md="24" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }" label="">
               <a-textarea :rows="1" placeholder="请输入备注" v-decorator="['remark']" style="margin-top: 8px" />
             </a-form-item>
           </a-col>
         </a-row>
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="附件">
               <j-upload v-model="fileList" bizPath="bill"></j-upload>
             </a-form-item>
           </a-col>
         </a-row>
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -259,6 +240,7 @@ import JDate from '@/components/jeecg/JDate'
 import Vue from 'vue'
 import WaitBillList from '../dialog/WaitBillList'
 import JImageUpload from '@/components/jeecg/JImageUpload.vue'
+import JSelectMaterial from '@/components/jeecgbiz/JSelectMaterial'
 
 export default {
   name: 'OtherInModal',
@@ -274,6 +256,7 @@ export default {
     JUpload,
     JImageUpload,
     JDate,
+    JSelectMaterial,
     VNodes: {
       functional: true,
       render: (h, ctx) => ctx.props.vnodes,
@@ -310,15 +293,14 @@ export default {
         dataSource: [],
         columns: [
           {
-            title: '商品条码',
-            key: 'barCode',
-            width: '200px',
-            type: FormTypes.popupJsh,
-            kind: 'material2',
-            multi: true,
+            title: 'SKU',
+            key: 'sku',
+            width: '280px',
+            type: FormTypes.slot,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
           { title: '名称', key: 'name', width: '120px', type: FormTypes.normal },
+          { title: '规格', key: 'standard', width: '120px', type: FormTypes.normal },
           {
             title: '生产日期',
             key: 'productionDate',
@@ -330,11 +312,6 @@ export default {
           { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.slot},
           { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
           { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
-
-          { 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 },
           {
@@ -343,32 +320,23 @@ export default {
             width: '120px',
             type: FormTypes.normal,
           },
-          {
-            title: '销售价',
-            key: 'wholesaleDecimal',
-            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: '单位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: 'snAdd', multi: true },
-          { title: '有效期', key: 'expirationDate', width: '120px', type: FormTypes.date },
-          { 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,
             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: 'wholesaleDecimal',
+            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: 'warehousingVariance', width: '120px', type: FormTypes.hidden },
-          { title: '入库差异原因', key: 'reasonOfDifference', width: '120px', type: FormTypes.hidden },
           {
             title: '入库人',
             key: 'warehousingUser',
@@ -414,13 +382,6 @@ export default {
     editAfter() {
       this.billStatus = '0'
       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.addInit(this.prefixNo)
         this.fileList = []
@@ -512,8 +473,6 @@ export default {
     waitBillListOk(selectBillDetailRows, linkNumber, remark, 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 listEx = []
         for (let j = 0; j < selectBillDetailRows.length; j++) {
@@ -525,7 +484,6 @@ export default {
           info.allPrice = 0
           info.linkId = info.id
           listEx.push(info)
-          this.changeColumnShow(info)
         }
         this.materialTable.dataSource = listEx
         this.$nextTick(() => {
@@ -537,9 +495,6 @@ export default {
         })
       }
     },
-    getUnitInfo(val) {
-      this.unitList = val
-    },
   },
 }
 </script>

+ 26 - 106
jshERP-web/src/views/bill/modules/OtherOutModal.vue

@@ -16,15 +16,13 @@
     <template slot="footer">
       <a-button @click="handleCancel">取消</a-button>
       <a-button v-if="billPrintFlag && isShowPrintBtn" @click="handlePrint('其它出库')">三联打印预览</a-button>
-      <a-button v-if="checkFlag && isCanCheck" :loading="confirmLoading" @click="handleOkAndCheck">保存并审核</a-button>
+      <a-button :loading="confirmLoading" @click="handleOkAndCheck">保存并申请审核</a-button>
       <a-button type="primary" :loading="confirmLoading" @click="handleOk">保存(Ctrl+S)</a-button>
-      <!--发起多级审核-->
-      <a-button v-if="!checkFlag" @click="handleWorkflow()" type="primary">提交流程</a-button>
     </template>
     <a-spin :spinning="confirmLoading">
       <a-form :form="form">
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="客户">
               <a-select
                 placeholder="请选择客户"
@@ -53,17 +51,17 @@
               </a-select>
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
               <j-date v-decorator="['operTime', validatorRules.operTime]" :show-time="true" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
               <a-input placeholder="请输入单据编号" v-decorator.trim="['number']" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -76,7 +74,7 @@
               </a-select>
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -85,7 +83,7 @@
               <a-input placeholder="自动带出" disabled v-decorator="['taxRate']" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               v-if="inOutManageFlag && !model.billType"
               :labelCol="labelCol"
@@ -107,7 +105,7 @@
           :loading="materialTable.loading"
           :columns="materialTable.columns"
           :dataSource="materialTable.dataSource"
-          :minWidth="minWidth"
+          minWidth="100%"
           :maxHeight="300"
           :rowNumber="false"
           :rowSelection="rowCanEdit"
@@ -116,7 +114,6 @@
           @valueChange="onValueChange"
           @added="onAdded"
           @deleted="onDeleted"
-          @focusChange="getUnitInfo"
         >
           <template #buttonAfter>
             <a-row
@@ -125,7 +122,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>
@@ -149,6 +146,7 @@
           <template #depotId="{ value }">
             <a-select
               disabled
+              :showArrow="false"
               :value="value"
               :options="depotList"
             >
@@ -168,32 +166,6 @@
               </a-tooltip>
             </a-input>
           </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="请选择"
-              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>
           <template #warehousingUser="{ handleChange, value }">
             <a-select
               placeholder="请选择"
@@ -208,23 +180,26 @@
             >
             </a-select>
           </template>
+          <template #sku="{ value, index, target,rowId }">
+            <JSelectMaterial :value="value" @change="($event) => handleSelectMaterial({...$event,target,rowId,index,value})"></JSelectMaterial>
+          </template>
         </j-editable-table>
-        <a-row class="form-row" :gutter="24">
+        <a-row class="form-row" :gutter="24" type="flex">
           <a-col :lg="24" :md="24" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }" label="">
               <a-textarea :rows="1" placeholder="请输入备注" v-decorator="['remark']" style="margin-top: 8px" />
             </a-form-item>
           </a-col>
         </a-row>
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="附件">
               <j-upload v-model="fileList" bizPath="bill"></j-upload>
             </a-form-item>
           </a-col>
         </a-row>
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -265,6 +240,7 @@ import JDate from '@/components/jeecg/JDate'
 import Vue from 'vue'
 import WaitBillList from '../dialog/WaitBillList'
 import JImageUpload from '@/components/jeecg/JImageUpload.vue'
+import JSelectMaterial from '@/components/jeecgbiz/JSelectMaterial'
 
 export default {
   name: 'OtherOutModal',
@@ -280,6 +256,7 @@ export default {
     JUpload,
     JImageUpload,
     JDate,
+    JSelectMaterial,
     VNodes: {
       functional: true,
       render: (h, ctx) => ctx.props.vnodes,
@@ -315,79 +292,36 @@ 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',
-            width: '200px',
-            type: FormTypes.popupJsh,
-            kind: 'material2',
-            multi: true,
-            newBatch: true,
-
+            title: 'SKU',
+            key: 'sku',
+            width: '280px',
+            type: FormTypes.slot,
             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: 'standard', 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 },
 
-          { 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 },
           {
             title: '单位',
             key: 'unit',
             width: '120px',
             type: FormTypes.normal,
-            // options: [],
-            // allowClear: false,
-            // slotName: 'unit',
           },
           { title: '销售价', key: 'wholesaleDecimal', 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: '单位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 },
           {
             title: '出库数量',
             key: 'operNumber',
             width: '120px',
             type: FormTypes.inputNumber,
-            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: '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 },
           {
             title: '出库人',
             key: 'warehousingUser',
@@ -432,15 +366,7 @@ export default {
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
       this.billStatus = '0'
-      
       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.addInit(this.prefixNo)
         this.fileList = []
@@ -531,8 +457,6 @@ export default {
     waitBillListOk(selectBillDetailRows, linkNumber, remark) {
       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 = []
         for (let j = 0; j < selectBillDetailRows.length; j++) {
@@ -544,7 +468,6 @@ export default {
           info.allPrice = 0
           info.linkId = info.id
           listEx.push(info)
-          this.changeColumnShow(info)
         }
         this.materialTable.dataSource = listEx
         this.$nextTick(() => {
@@ -555,9 +478,6 @@ export default {
         })
       }
     },
-    getUnitInfo(val) {
-      this.unitList = val
-    },
   },
 }
 </script>

+ 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>

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

@@ -17,15 +17,13 @@
     <template slot="footer">
       <a-button @click="handleCancel">取消</a-button>
       <a-button v-if="billPrintFlag && isShowPrintBtn" @click="handlePrint('采购入库')">三联打印预览</a-button>
-      <a-button v-if="checkFlag && isCanCheck" :loading="confirmLoading" @click="handleOkAndCheck">保存并审核</a-button>
+      <a-button :loading="confirmLoading" @click="handleOkAndCheck">保存并申请审核</a-button>
       <a-button type="primary" :loading="confirmLoading" @click="handleOk">保存(Ctrl+S)</a-button>
-      <!--发起多级审核-->
-      <a-button v-if="!checkFlag" @click="handleWorkflow()" type="primary">提交流程</a-button>
     </template>
     <a-spin :spinning="confirmLoading">
       <a-form :form="form">
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -61,12 +59,12 @@
               </a-select>
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
               <j-date v-decorator="['operTime', validatorRules.operTime]" :show-time="true" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -78,7 +76,7 @@
               <a-input placeholder="请输入单据编号" v-decorator.trim="['number']" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -96,7 +94,7 @@
               />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -112,7 +110,7 @@
               </a-select>
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -131,7 +129,7 @@
           :loading="materialTable.loading"
           :columns="materialTable.columns"
           :dataSource="materialTable.dataSource"
-          :minWidth="1200"
+          minWidth="100%"
           :maxHeight="300"
           :rowNumber="false"
           :rowSelection="rowCanEdit"
@@ -140,32 +138,8 @@
           @valueChange="onValueChange"
           @added="onAdded"
           @deleted="onDeleted"
-          @focusChange="getUnitInfo"
         >
           <template #buttonAfter>
-            <a-row
-              v-if="false"
-              :gutter="24"
-              style="float: left; padding-bottom: 5px"
-              data-step="4"
-              data-title="扫码录入"
-              data-intro="此功能支持扫码枪扫描商品条码进行录入"
-            >
-              <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="请扫描商品条码并回车"
-                  v-model="scanBarCode"
-                  @pressEnter="scanPressEnter"
-                  ref="scanBarCode"
-                />
-              </a-col>
-              <a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px 12px 0 0">
-                <a-button @click="stopScan">收起扫码</a-button>
-              </a-col>
-            </a-row>
             <a-row :gutter="24" style="float: left; padding-bottom: 5px">
               <a-col :md="24" :sm="24">
                 <a-button style="margin-left: 8px" @click="handleHistoryBillList"
@@ -177,32 +151,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="请选择"
-              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>
           <template #warehousingUser="{ handleChange, value }">
             <a-select
               placeholder="请选择"
@@ -220,6 +168,7 @@
           <template #depotId="{ value }">
             <a-select
               disabled
+              :showArrow="false"
               :value="value"
               :options="depotList"
             >
@@ -239,16 +188,19 @@
               </a-tooltip>
             </a-input>
           </template>
+          <template #sku="{value, index, target,rowId }">
+            <JSelectMaterial :value="value" :disabled="!rowCanEdit" @change="($event) => handleSelectMaterial({...$event,target,rowId,index,value})"></JSelectMaterial>
+          </template>
         </j-editable-table>
-        <a-row class="form-row" :gutter="24">
+        <a-row class="form-row" :gutter="24" type="flex">
           <a-col :lg="24" :md="24" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }" label="">
               <a-textarea :rows="1" placeholder="请输入备注" v-decorator="['remark']" style="margin-top: 8px" />
             </a-form-item>
           </a-col>
         </a-row>
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -258,7 +210,7 @@
               data-intro="针对单据明细中商品总金额进行优惠的比例"
             >
               <a-input
-                style="width: 80%"
+                style="width: 100%"
                 placeholder="请输入优惠率"
                 v-decorator.trim="['discount']"
                 suffix="%"
@@ -266,7 +218,7 @@
               />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -282,7 +234,7 @@
               />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -294,7 +246,7 @@
               <a-input placeholder="请输入优惠后金额" v-decorator.trim="['discountLastMoney']" :disabled="true" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -307,8 +259,8 @@
             </a-form-item>
           </a-col>
         </a-row>
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -318,7 +270,7 @@
               data-intro="如果在下拉框中选择多账户,则可以通过多个结算账户进行结算"
             >
               <a-select
-                style="width: 80%"
+                style="width: 100%"
                 placeholder="请选择结算账户"
                 v-decorator="['accountId', validatorRules.accountId]"
                 :dropdownMatchSelectWidth="false"
@@ -353,13 +305,19 @@
               </a-tooltip>
             </a-form-item>
           </a-col>
-          <a-col v-if="depositStatus" :lg="6" :md="12" :sm="24">
+          <a-col v-if="depositStatus" :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="扣除订金">
               <a-input v-decorator.trim="['deposit']" @change="onChangeDeposit" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
-            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="本次实际付款">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
+            <a-form-item :labelCol="{
+              xs: { span: 24 },
+              sm: { span: 9 },
+            }" :wrapperCol="{
+              xs: { span: 24 },
+              sm: { span: 15 },
+            }" label="本次实际付款">
               <a-input
                 disabled
                 placeholder="请输入本次付款"
@@ -368,7 +326,7 @@
               />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -385,8 +343,8 @@
             </a-form-item>
           </a-col>
         </a-row>
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -399,8 +357,8 @@
             </a-form-item>
           </a-col>
         </a-row>
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -448,6 +406,7 @@ import JUpload from '@/components/jeecg/JUpload'
 import JDate from '@/components/jeecg/JDate'
 import Vue from 'vue'
 import JImageUpload from '@/components/jeecg/JImageUpload.vue'
+import JSelectMaterial from '@/components/jeecgbiz/JSelectMaterial'
 
 export default {
   name: 'PurchaseInModal',
@@ -465,6 +424,7 @@ export default {
     BillPrintIframe,
     JUpload,
     JDate,
+    JSelectMaterial,
     VNodes: {
       functional: true,
       render: (h, ctx) => ctx.props.vnodes,
@@ -501,19 +461,14 @@ export default {
         dataSource: [],
         columns: [
           {
-            title: '商品条码',
-            key: 'barCode',
-            width: '200px',
-            type: FormTypes.popupJsh,
-            kind: 'material2',
-            multi: true,
-            newBatch: true,
-
+            title: 'SKU',
+            key: 'sku',
+            width: '280px',
+            type: FormTypes.slot,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
           { title: '名称', key: 'name', width: '120px', type: FormTypes.normal },
           { title: '规格', key: 'standard', width: '120px', type: FormTypes.normal },
-
           {
             title: '生产日期',
             key: 'productionDate',
@@ -525,13 +480,7 @@ export default {
           { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.slot},
           { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
           { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
-
-          { 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: 'inventory', width: '120px', type: FormTypes.normal },
+          { title: '库存', key: 'stock', width: '120px', type: FormTypes.normal },
           {
             title: '单位',
             key: 'unit',
@@ -539,30 +488,21 @@ export default {
             type: FormTypes.normal,
           },
           {
-            title: '销售价',
-            key: 'wholesaleDecimal',
-            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: '单位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: 'snAdd', multi: true },
-          { title: '有效期', key: 'expirationDate', width: '120px', type: FormTypes.date },
-          { 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,
             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: 'wholesaleDecimal',
+            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',
@@ -573,8 +513,6 @@ export default {
           },
           { title: '价税合计', key: 'taxLastMoney', width: '120px', type: FormTypes.inputNumber,disabled: true, statistics: true },
 
-          { title: '入库差异', key: 'warehousingVariance', width: '120px', type: FormTypes.hidden },
-          { title: '入库差异原因', key: 'reasonOfDifference', width: '120px', type: FormTypes.hidden },
           {
             title: '入库人',
             key: 'warehousingUser',
@@ -584,13 +522,16 @@ export default {
             validateRules: [{ required: true, message: '入库人不能为空' }],
           },
           { title: '入库时间', key: 'warehousingTime', width: '200px', type: FormTypes.date },
-
           { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
+          // 以下隐藏字段有用
           { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
+          { title: '税率', key: 'taxRate', width: '120px', type: FormTypes.hidden, placeholder: '%' },
           { title: '默认销售价', key: 'defaultWholesaleDecimal', width: '120px', type: FormTypes.hidden },
           { title: '默认采购价', key: 'defaultPurchaseDecimal', width: '120px', type: FormTypes.hidden },
           { title: '单位换算比例', key: 'ratio', width: '120px', type: FormTypes.hidden },
         ],
+        validRules:{
+        },
       },
       confirmLoading: false,
       validatorRules: {
@@ -629,13 +570,6 @@ export default {
       console.log('this.model======',this.model)
       this.billStatus = '0'
       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)
@@ -656,12 +590,6 @@ export default {
           this.depositStatus = false
           this.model.deposit = 0
         }
-        this.model.debt = (
-          this.model.discountLastMoney +
-          (this.model.otherMoney||0)-
-          this.model.deposit -
-          this.model.changeAmount
-        ).toFixed(2)
         if (this.model.accountId == null) {
           this.model.accountId = 0
           this.manyAccountBtnStatus = true
@@ -701,7 +629,7 @@ export default {
           mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
           linkType: 'basic',
         }
-        let url = this.readOnly ? this.url.detailList : this.url.detailList
+        let url = this.url.detailList
         this.requestSubTableData(url, params, this.materialTable)
       }
       //复制新增单据-初始化单号和日期
@@ -767,8 +695,6 @@ export default {
     linkBillListOk(selectBillDetailRows, linkNumber, organId, discountMoney, deposit, remark, depotId, accountId) {
       let that = this
       this.rowCanEdit = false
-      // this.changeFormTypes(this.materialTable.columns, 'preNumber', 1)
-      // this.changeFormTypes(this.materialTable.columns, 'finishNumber', 1)
       console.log('selectBillDetailRows', selectBillDetailRows)
       if (selectBillDetailRows && selectBillDetailRows.length > 0) {
         let listEx = []
@@ -785,7 +711,6 @@ export default {
           info.linkId = info.id
           allTaxLastMoney += info.taxLastMoney
           listEx.push(info)
-          this.changeColumnShow(info)
         }
         this.materialTable.dataSource = listEx
 
@@ -802,19 +727,19 @@ export default {
           changeAmount = (discountLastMoney - deposit).toFixed(2) - 0
         }
         console.log('depotId===',depotId)
-        this.form.setFieldsValue({
-          organId: organId,
-          linkNumber: linkNumber,
-          discount: discount,
-          discountMoney: discountMoney,
-          discountLastMoney: discountLastMoney,
-          deposit: deposit,
-          changeAmount: changeAmount,
-          accountId: accountId,
-          remark: remark,
-          depotId: depotId,
-        })
         this.$nextTick(() => {
+          this.form.setFieldsValue({
+            organId: organId,
+            linkNumber: linkNumber,
+            discount: discount,
+            discountMoney: discountMoney,
+            discountLastMoney: discountLastMoney,
+            deposit: deposit,
+            changeAmount: changeAmount,
+            accountId: accountId,
+            remark: remark,
+            depotId: depotId,
+          })
           console.log('discount===',this.form.getFieldValue('discount'))
           this.getTatRate(organId)
         })
@@ -826,9 +751,6 @@ export default {
         }
       }
     },
-    getUnitInfo(val) {
-      this.unitList = val
-    },
   },
 }
 </script>

+ 56 - 97
jshERP-web/src/views/bill/modules/PurchaseOrderModal.vue

@@ -17,15 +17,13 @@
     <template slot="footer">
       <a-button @click="handleCancel">取消</a-button>
       <a-button v-if="billPrintFlag && isShowPrintBtn" @click="handlePrint('采购订单')">三联打印预览</a-button>
-      <a-button v-if="checkFlag && isCanCheck" :loading="confirmLoading" @click="handleOkAndCheck">保存并审核</a-button>
+      <a-button :loading="confirmLoading" @click="handleOkAndCheck">保存并申请审核</a-button>
       <a-button type="primary" :loading="confirmLoading" @click="handleOk">保存(Ctrl+S)</a-button>
-      <!--发起多级审核-->
-      <a-button v-if="!checkFlag" @click="handleWorkflow()" type="primary">提交流程</a-button>
     </template>
     <a-spin :spinning="confirmLoading">
       <a-form :form="form">
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -60,12 +58,12 @@
               </a-select>
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
               <j-date v-decorator="['operTime', validatorRules.operTime]" :show-time="true" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -77,7 +75,7 @@
               <a-input placeholder="请输入单据编号" v-decorator.trim="['number']" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -95,7 +93,7 @@
               />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -111,7 +109,7 @@
               </a-select>
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -123,13 +121,13 @@
               <a-input placeholder="自动带出" disabled v-decorator="['taxRate']" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               v-if="purchaseBySaleFlag"
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
               label="关联订单"
-              data-step="5"
+              data-step="6"
               data-title="关联订单"
               data-intro="采购订单单据可以通过关联订单来选择已录入的销售订单,选择之后会自动加载订单的内容,
               提交之后原来的销售订单会对应的改变单据状态。另外本系统支持分批多次关联"
@@ -148,7 +146,7 @@
           :loading="materialTable.loading"
           :columns="materialTable.columns"
           :dataSource="materialTable.dataSource"
-          :minWidth="1200"
+          minWidth="100%"
           :maxHeight="300"
           :rowNumber="false"
           :rowSelection="rowCanEdit"
@@ -157,7 +155,6 @@
           @valueChange="onValueChange"
           @added="onAdded"
           @deleted="onDeleted"
-          @focusChange="getUnitInfo"
         >
           <template #buttonAfter>
             <a-row
@@ -166,14 +163,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"
@@ -197,6 +194,7 @@
           <template #depotId="{ value }">
             <a-select
               disabled
+              :showArrow="false"
               :value="value"
               :options="depotList"
             >
@@ -216,43 +214,27 @@
               </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> -->
+          <template #sku="{ value, index, target,rowId }">
+            <JSelectMaterial :value="value" :disabled="!rowCanEdit" @change="($event) => handleSelectMaterial({...$event,target,rowId,index,value})"></JSelectMaterial>
+          </template>
         </j-editable-table>
-        <a-row class="form-row" :gutter="24">
+        <a-row class="form-row" :gutter="24" type="flex">
           <a-col :lg="24" :md="24" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }" label="">
               <a-textarea :rows="1" placeholder="请输入备注" v-decorator="['remark']" style="margin-top: 8px" />
             </a-form-item>
           </a-col>
-        </a-row>
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
               label="优惠率"
-              data-step="5"
+              data-step="7"
               data-title="优惠率"
               data-intro="针对单据明细中商品总金额进行优惠的比例"
             >
               <a-input
-                style="width: 80%"
+                style="width: 100%"
                 placeholder="请输入优惠率"
                 v-decorator.trim="['discount']"
                 suffix="%"
@@ -260,12 +242,12 @@
               />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
               label="付款优惠"
-              data-step="6"
+              data-step="8"
               data-title="付款优惠"
               data-intro="针对单据明细中商品总金额进行优惠的金额"
             >
@@ -276,34 +258,31 @@
               />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
               label="优惠后金额"
-              data-step="7"
+              data-step="9"
               data-title="优惠后金额"
               data-intro="针对单据明细中商品总金额进行优惠后的金额"
             >
               <a-input placeholder="请输入优惠后金额" v-decorator.trim="['discountLastMoney']" disabled />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24"></a-col>
-        </a-row>
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
               label="结算账户"
-              data-step="8"
+              data-step="10"
               data-title="结算账户"
               data-intro="如果在下拉框中选择多账户,则可以通过多个结算账户进行结算"
             >
               <a-select
-                style="width: 80%"
+                style="width: 100%"
                 placeholder="请选择结算账户"
-                v-decorator="['accountId']"
+                v-decorator="['accountId', validatorRules.accountId]"
                 :dropdownMatchSelectWidth="false"
                 allowClear
                 @select="selectAccount"
@@ -336,12 +315,12 @@
               </a-tooltip>
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
               label="支付订金"
-              data-step="9"
+              data-step="11"
               data-title="支付订金"
               data-intro="填写订金之后,在采购入库单会自动计算扣除订金"
             >
@@ -352,16 +331,14 @@
               />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24"> </a-col>
-          <a-col :lg="6" :md="12" :sm="24"> </a-col>
         </a-row>
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
               label="附件"
-              data-step="10"
+              data-step="12"
               data-title="附件"
               data-intro="可以上传与单据相关的图片、文档,支持多个文件"
             >
@@ -369,13 +346,13 @@
             </a-form-item>
           </a-col>
         </a-row>
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
               label="凭证图片"
-              data-step="11"
+              data-step="13"
               data-title="附件"
               data-intro="可以上传与单据相关的图片、文档,支持多个文件"
             >
@@ -414,6 +391,8 @@ import JUpload from '@/components/jeecg/JUpload'
 import JImageUpload from '@/components/jeecg/JImageUpload.vue'
 import JDate from '@/components/jeecg/JDate'
 import Vue from 'vue'
+import JSelectMaterial from '@/components/jeecgbiz/JSelectMaterial'
+
 // import QrcodeVue from 'qrcode.vue'
 export default {
   name: 'PurchaseOrderModal',
@@ -430,6 +409,7 @@ export default {
     JUpload,
     JImageUpload,
     JDate,
+    JSelectMaterial,
     // QrcodeVue,
     VNodes: {
       functional: true,
@@ -470,12 +450,10 @@ export default {
         dataSource: [],
         columns: [
           {
-            title: '商品条码',
-            key: 'barCode',
-            width: '200px',
-            type: FormTypes.popupJsh,
-            kind: 'material2',
-            multi: true,
+            title: 'SKU',
+            key: 'sku',
+            width: '280px',
+            type: FormTypes.slot,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
           { title: '名称', key: 'name', width: '120px', type: FormTypes.normal },
@@ -493,12 +471,7 @@ export default {
           { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
           { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
 
-          { 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: 'inventory', width: '120px', type: FormTypes.normal },
+          { title: '库存', key: 'stock', width: '120px', type: FormTypes.normal },
           {
             title: '单位',
             key: 'unit',
@@ -506,28 +479,21 @@ export default {
             type: FormTypes.normal,
           },
           {
-            title: '销售价',
-            key: 'wholesaleDecimal',
-            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: '单位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',
             width: '120px',
             type: FormTypes.inputNumber,
-            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: 'wholesaleDecimal',
+            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',
@@ -539,6 +505,7 @@ export default {
           { title: '价税合计', key: 'taxLastMoney', width: '120px', type: FormTypes.inputNumber,disabled: true, statistics: true, },
           { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
           { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
+          { title: '税率', key: 'taxRate', width: '120px', type: FormTypes.hidden, placeholder: '%' },
           { title: '默认销售价', key: 'defaultWholesaleDecimal', width: '120px', type: FormTypes.hidden },
           { title: '默认采购价', key: 'defaultPurchaseDecimal', width: '120px', type: FormTypes.hidden },
           { title: '单位换算比例', key: 'ratio', width: '120px', type: FormTypes.hidden },
@@ -555,6 +522,9 @@ export default {
         depotId: {
           rules: [{ required: true, message: '请选择仓库名!' }],
         },
+        accountId: {
+          rules: [{ required: true, message: '请选择结算账户!' }],
+        },
       },
       url: {
         add: '/depotHead/addDepotHeadAndDetail',
@@ -572,10 +542,6 @@ 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 = []
@@ -696,9 +662,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++) {
@@ -713,7 +676,6 @@ export default {
             discountLastMoney += info.allPrice
           }
           info.linkId = info.id
-          this.changeColumnShow(info)
         }
         //根据单号查询单据类型
         findBillDetailByNumber({ number: linkNumber }).then((res) => {
@@ -745,9 +707,6 @@ export default {
         this.materialTable.dataSource = selectBillDetailRows
       }
     },
-    getUnitInfo(val) {
-      this.unitList = val
-    },
   },
 }
 </script>

+ 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"

+ 43 - 104
jshERP-web/src/views/bill/modules/SaleOrderModal.vue

@@ -17,15 +17,13 @@
     <template slot="footer">
       <a-button @click="handleCancel">取消</a-button>
       <a-button v-if="billPrintFlag && isShowPrintBtn" @click="handlePrint('销售订单')">三联打印预览</a-button>
-      <a-button v-if="checkFlag && isCanCheck" :loading="confirmLoading" @click="handleOkAndCheck">保存并审核</a-button>
+      <a-button :loading="confirmLoading" @click="handleOkAndCheck">保存并申请审核</a-button>
       <a-button type="primary" :loading="confirmLoading" @click="handleOk">保存(Ctrl+S)</a-button>
-      <!--发起多级审核-->
-      <a-button v-if="!checkFlag" @click="handleWorkflow()" type="primary">提交流程</a-button>
     </template>
     <a-spin :spinning="confirmLoading">
       <a-form :form="form">
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -61,12 +59,12 @@
               </a-select>
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
               <j-date v-decorator="['operTime', validatorRules.operTime]" :show-time="true" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -78,7 +76,7 @@
               <a-input placeholder="请输入单据编号" v-decorator.trim="['number']" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -94,7 +92,7 @@
               />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -110,7 +108,7 @@
               </a-select>
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -129,7 +127,7 @@
           :loading="materialTable.loading"
           :columns="materialTable.columns"
           :dataSource="materialTable.dataSource"
-          :minWidth="minWidth"
+          minWidth="100%"
           :maxHeight="300"
           :rowNumber="false"
           :rowSelection="true"
@@ -138,7 +136,6 @@
           @valueChange="onValueChange"
           @added="onAdded"
           @deleted="onDeleted"
-          @focusChange="getUnitInfo"
         >
           <template #buttonAfter>
             <a-row
@@ -146,14 +143,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"
@@ -177,6 +174,7 @@
           <template #depotId="{ value }">
             <a-select
               disabled
+              :showArrow="false"
               :value="value"
               :options="depotList"
             >
@@ -189,33 +187,17 @@
               </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> -->
+          <template #sku="{ value, index, target,rowId }">
+            <JSelectMaterial :value="value" @change="($event) => handleSelectMaterial({...$event,target,rowId,index,value})"></JSelectMaterial>
+          </template>
         </j-editable-table>
-        <a-row class="form-row" :gutter="24">
+        <a-row class="form-row" :gutter="24" type="flex">
           <a-col :lg="24" :md="24" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }" label="">
               <a-textarea :rows="1" placeholder="请输入备注" v-decorator="['remark']" style="margin-top: 8px" />
             </a-form-item>
           </a-col>
-        </a-row>
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -225,7 +207,7 @@
               data-intro="针对单据明细中商品总金额进行优惠的比例"
             >
               <a-input
-                style="width: 80%"
+                style="width: 100%"
                 placeholder="请输入优惠率"
                 v-decorator.trim="['discount']"
                 suffix="%"
@@ -233,7 +215,7 @@
               />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -249,7 +231,7 @@
               />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -261,10 +243,7 @@
               <a-input placeholder="请输入优惠后金额" v-decorator.trim="['discountLastMoney']" :disabled="true" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24"></a-col>
-        </a-row>
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -274,9 +253,9 @@
               data-intro="如果在下拉框中选择多账户,则可以通过多个结算账户进行结算"
             >
               <a-select
-                style="width: 80%"
+                style="width: 100%"
                 placeholder="请选择结算账户"
-                v-decorator="['accountId']"
+                v-decorator="['accountId', validatorRules.accountId]"
                 :dropdownMatchSelectWidth="false"
                 allowClear
                 @select="selectAccount"
@@ -309,7 +288,7 @@
               </a-tooltip>
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -325,24 +304,24 @@
               />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收货人" data-step="10">
               <a-input placeholder="请输入收货人" v-decorator.trim="['receiverName']" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收货人电话" data-step="10">
               <a-input placeholder="请输入收货人电话" v-decorator.trim="['receiverPhone']" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收货地址" data-step="8">
-              <a-input style="width: 80%" placeholder="请输入收货地址" v-decorator.trim="['receiverAddress']" />
+              <a-input style="width: 100%" placeholder="请输入收货地址" v-decorator.trim="['receiverAddress']" />
             </a-form-item>
           </a-col>
         </a-row>
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -383,6 +362,8 @@ import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
 import JUpload from '@/components/jeecg/JUpload'
 import JDate from '@/components/jeecg/JDate'
 import Vue from 'vue'
+import JSelectMaterial from '@/components/jeecgbiz/JSelectMaterial'
+
 export default {
   name: 'SaleOrderModal',
   mixins: [JEditableTableMixin, BillModalMixin],
@@ -397,6 +378,7 @@ export default {
     JUpload,
     JDate,
     JSelectMultiple,
+    JSelectMaterial,
     VNodes: {
       functional: true,
       render: (h, ctx) => ctx.props.vnodes,
@@ -428,59 +410,35 @@ export default {
         loading: false,
         dataSource: [],
         columns: [
-          // { title: '', key: 'hiddenKey', width: '1%', type: FormTypes.hidden },
           {
-            title: '商品条码',
-            key: 'barCode',
-            width: '200px',
-            type: FormTypes.popupJsh,
-            kind: 'material2',
-            multi: true,
+            title: 'SKU',
+            key: 'sku',
+            width: '280px',
+            type: FormTypes.slot,
             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: 'standard', width: '120px', 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 },
 
-          { 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 },
           {
             title: '单位',
             key: 'unit',
             width: '120px',
             type: FormTypes.normal,
-            // options: [],
-            // 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,
             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 +448,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 },
@@ -527,6 +468,9 @@ export default {
         depotId: {
           rules: [{ required: true, message: '请选择仓库名!' }],
         },
+        accountId: {
+          rules: [{ required: true, message: '请选择结算账户!' }],
+        },
       },
       url: {
         add: '/depotHead/addDepotHeadAndDetail',
@@ -541,8 +485,6 @@ export default {
     //调用完edit()方法之后会自动调用此方法
     editAfter() {
       this.billStatus = '0'
-      
-      this.changeColumnHide()
       if (this.action === 'add') {
         this.addInit(this.prefixNo)
         this.personList.value = ''
@@ -644,9 +586,6 @@ export default {
       this.$refs.historyBillListModalForm.show('其它', '销售订单', '客户', organId)
       this.$refs.historyBillListModalForm.disableSubmit = false
     },
-    getUnitInfo(val) {
-      this.unitList = val
-    },
   },
 }
 </script>

+ 42 - 131
jshERP-web/src/views/bill/modules/SaleOutModal.vue

@@ -17,15 +17,13 @@
     <template slot="footer">
       <a-button @click="handleCancel">取消</a-button>
       <a-button v-if="billPrintFlag && isShowPrintBtn" @click="handlePrint('销售出库')">三联打印预览</a-button>
-      <a-button v-if="checkFlag && isCanCheck" :loading="confirmLoading" @click="handleOkAndCheck">保存并审核</a-button>
+      <a-button :loading="confirmLoading" @click="handleOkAndCheck">保存并申请审核</a-button>
       <a-button type="primary" :loading="confirmLoading" @click="handleOk">保存(Ctrl+S)</a-button>
-      <!--发起多级审核-->
-      <a-button v-if="!checkFlag" @click="handleWorkflow()" type="primary">提交流程</a-button>
     </template>
     <a-spin :spinning="confirmLoading">
       <a-form :form="form">
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -62,12 +60,12 @@
               </a-select>
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
               <j-date v-decorator="['operTime', validatorRules.operTime]" :show-time="true" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -79,7 +77,7 @@
               <a-input placeholder="请输入单据编号" v-decorator.trim="['number']" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -97,7 +95,7 @@
               />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -113,7 +111,7 @@
               </a-select>
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -132,7 +130,7 @@
           :loading="materialTable.loading"
           :columns="materialTable.columns"
           :dataSource="materialTable.dataSource"
-          :minWidth="minWidth"
+          minWidth="100%"
           :maxHeight="300"
           :rowNumber="false"
           :rowSelection="rowCanEdit"
@@ -141,7 +139,6 @@
           @valueChange="onValueChange"
           @added="onAdded"
           @deleted="onDeleted"
-          @focusChange="getUnitInfo"
         >
           <template #buttonAfter>
             <a-row
@@ -150,7 +147,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,32 +175,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="请选择"
-              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>
           <template #warehousingUser="{ handleChange, value }">
             <a-select
               placeholder="请选择"
@@ -221,18 +192,12 @@
           <template #depotId="{ value }">
             <a-select
               disabled
+              :showArrow="false"
               :value="value"
               :options="depotList"
             >
             </a-select>
           </template>
-          <!-- <template #wholesaleDecimal="{ handleChange, value, index }">
-            <a-input :value="value" @change="($event) => onChangePrice($event,handleChange)">
-              <a-tooltip slot="suffix" title="修改后和默认价格不一致">
-                <a-icon type="info-circle" style="color: #f5222d" v-show="getDefaultWholesaleDecimal(index,'defaultWholesaleDecimal')!=value" />
-              </a-tooltip>
-            </a-input>
-          </template> -->
           <template #unitPrice="{ handleChange, value, index,allValues }">
             <a-input :value="value" @change="($event) => onChangePrice($event,handleChange)">
               <a-tooltip slot="suffix" title="修改后和默认价格不一致">
@@ -240,16 +205,19 @@
               </a-tooltip>
             </a-input>
           </template>
+          <template #sku="{value, index, target,rowId }">
+            <JSelectMaterial :value="value" :disabled="!rowCanEdit" @change="($event) => handleSelectMaterial({...$event,target,rowId,index,value})"></JSelectMaterial>
+          </template>
         </j-editable-table>
-        <a-row class="form-row" :gutter="24">
+        <a-row class="form-row" :gutter="24" type="flex">
           <a-col :lg="24" :md="24" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }" label="">
               <a-textarea :rows="1" placeholder="请输入备注" v-decorator="['remark']" style="margin-top: 8px" />
             </a-form-item>
           </a-col>
         </a-row>
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -259,7 +227,7 @@
               data-intro="针对单据明细中商品总金额进行优惠的比例"
             >
               <a-input
-                style="width: 80%"
+                style="width: 100%"
                 placeholder="请输入优惠率"
                 v-decorator.trim="['discount']"
                 suffix="%"
@@ -267,7 +235,7 @@
               />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -283,7 +251,7 @@
               />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -295,7 +263,7 @@
               <a-input placeholder="请输入优惠后金额" v-decorator.trim="['discountLastMoney']" disabled />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -307,9 +275,7 @@
               <a-input placeholder="请输入其它费用" v-decorator.trim="['otherMoney']" @change="onChangeOtherMoney" />
             </a-form-item>
           </a-col>
-        </a-row>
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -319,7 +285,7 @@
               data-intro="如果在下拉框中选择多账户,则可以通过多个结算账户进行结算"
             >
               <a-select
-                style="width: 80%"
+                style="width: 100%"
                 placeholder="请选择结算账户"
                 v-decorator="['accountId', validatorRules.accountId]"
                 :dropdownMatchSelectWidth="false"
@@ -354,12 +320,12 @@
               </a-tooltip>
             </a-form-item>
           </a-col>
-          <a-col v-if="depositStatus" :lg="6" :md="12" :sm="24">
+          <a-col v-if="depositStatus" :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="扣除订金">
               <a-input v-decorator.trim="['deposit']" @change="onChangeDeposit" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="本次收款">
               <a-input
                 placeholder="请输入本次收款"
@@ -368,7 +334,7 @@
               />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -384,9 +350,7 @@
               />
             </a-form-item>
           </a-col>
-        </a-row>
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -403,24 +367,24 @@
               />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收货人" data-step="10">
               <a-input placeholder="请输入收货人" v-decorator="['receiverName']" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收货人电话" data-step="10">
               <a-input placeholder="请输入收货人电话" v-decorator="['receiverPhone']" />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收货地址" data-step="10">
               <a-input placeholder="请输入收货地址" v-decorator="['receiverAddress']" />
             </a-form-item>
           </a-col>
         </a-row>
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -433,8 +397,8 @@
             </a-form-item>
           </a-col>
         </a-row>
-        <a-row class="form-row" :gutter="24">
-          <a-col :lg="6" :md="12" :sm="24">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
             <a-form-item
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -480,6 +444,7 @@ import { getMpListShort, handleIntroJs } from '@/utils/util'
 import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
 import JUpload from '@/components/jeecg/JUpload'
 import JImageUpload from '@/components/jeecg/JImageUpload.vue'
+import JSelectMaterial from '@/components/jeecgbiz/JSelectMaterial'
 
 import JDate from '@/components/jeecg/JDate'
 import Vue from 'vue'
@@ -501,6 +466,7 @@ export default {
     JDate,
     JSelectMultiple,
     JImageUpload,
+    JSelectMaterial,
     VNodes: {
       functional: true,
       render: (h, ctx) => ctx.props.vnodes,
@@ -536,59 +502,34 @@ export default {
         dataSource: [],
         columns: [
           {
-            title: '商品条码',
-            key: 'barCode',
-            width: '200px',
-            type: FormTypes.popupJsh,
-            kind: 'material2',
-            multi: true,
-            newBatch: true,
-
+            title: 'SKU',
+            key: 'sku',
+            width: '280px',
+            type: FormTypes.slot,
             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: 'standard', 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 },
 
-          { 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 },
           {
             title: '单位',
             key: 'unit',
             width: '120px',
             type: FormTypes.normal,
-            // options: [],
-            // 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: '120px', type: FormTypes.normal },
-          { title: '已出库', key: 'finishNumber', width: '120px', type: FormTypes.normal },
           {
             title: '出库数量',
             key: 'operNumber',
             width: '120px',
             type: FormTypes.inputNumber,
-            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',
@@ -598,16 +539,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 },
           {
             title: '出库人',
             key: 'warehousingUser',
@@ -617,9 +548,9 @@ export default {
             validateRules: [{ required: true, message: '出库人不能为空' }],
           },
           { title: '出库时间', key: 'warehousingTime', width: '200px', type: FormTypes.date },
-
           { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
           { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
+          { title: '税率', key: 'taxRate', width: '120px', type: FormTypes.hidden, placeholder: '%' },
           { title: '默认销售价', key: 'defaultWholesaleDecimal', width: '120px', type: FormTypes.hidden },
           { title: '默认采购价', key: 'defaultPurchaseDecimal', width: '120px', type: FormTypes.hidden },
           { title: '单位换算比例', key: 'ratio', width: '120px', type: FormTypes.hidden },
@@ -660,13 +591,6 @@ export default {
     editAfter() {
       this.billStatus = '0'
       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)
@@ -689,12 +613,6 @@ export default {
           this.depositStatus = false
           this.model.deposit = 0
         }
-        this.model.debt = (
-          this.model.discountLastMoney +
-          this.model.otherMoney -
-          this.model.deposit -
-          this.model.changeAmount
-        ).toFixed(2)
         if (this.model.accountId == null) {
           this.model.accountId = 0
           this.manyAccountBtnStatus = true
@@ -817,9 +735,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
@@ -835,7 +750,6 @@ export default {
           info.linkId = info.id
           allTaxLastMoney += info.taxLastMoney
           listEx.push(info)
-          this.changeColumnShow(info)
         }
         this.materialTable.dataSource = listEx
         ///给优惠后金额重新赋值
@@ -880,9 +794,6 @@ export default {
         }
       }
     },
-    getUnitInfo(val) {
-      this.unitList = val
-    },
   },
 }
 </script>

+ 15 - 28
jshERP-web/src/views/material/MaterialList.vue

@@ -23,7 +23,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="关键词" :labelCol="labelCol" :wrapperCol="wrapperCol">
-                  <a-input placeholder="请输入条码、名称、助记码等查询" v-model="queryParam.materialParam"></a-input>
+                  <a-input placeholder="请输入sku、名称、助记码等查询" v-model="queryParam.materialParam"></a-input>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -293,19 +293,20 @@ export default {
       // 默认索引
       defDataIndex: [
         'action',
-        'barCode',
         'name',
+        'sku',
+        'brand',
         'standard',
         'model',
         'color',
+        'systemSpu',
+        'expiryNum',
+        'mnemonic',
         'categoryName',
         'materialOther',
-        'unit',
         'stock',
         'defaultPurchaseDecimal',
-        'commodityDecimal',
         'defaultWholesaleDecimal',
-        'lowDecimal',
         'enabled',
         'reminder'
       ],
@@ -318,34 +319,20 @@ 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: '系统SPU', dataIndex: 'systemSpu', width: 120 },
+        { title: '保质期(天)', dataIndex: 'expiryNum', width: 120 },
+        { title: 'SKU', dataIndex: 'sku', 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: 'color', width: 120 },
+        { title: '品牌', dataIndex: 'brand', 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: '单位', dataIndex: 'commodityUnit', width: 120},
+        { title: '重量(kg)', dataIndex: 'weight', width: 80 },
         {
           title: '初始库存',
           dataIndex: 'initialStock',
@@ -523,7 +510,7 @@ export default {
     },
     handleImportXls() {
       let importExcelUrl = this.url.importExcelUrl
-      let templateUrl = '/doc/goods_template.xls'
+      let templateUrl = '/doc/goods_template.xlsx'
       let templateName = '商品信息导入模版[下载]'
       this.$refs.modalImportForm.initModal(importExcelUrl, templateUrl, templateName, '商品信息导入模版')
       this.$refs.modalImportForm.title = '商品导入'

+ 8 - 20
jshERP-web/src/views/material/mixins/MaterialModalMixins.js

@@ -6,29 +6,9 @@ export const MaterialModalMixins = {
     return {
       supList: [],
       depotList: [],
-      quickBtn: {
-        vendor: false,
-        depot: false,
-      },
     }
   },
   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) => {
@@ -52,6 +32,14 @@ export const MaterialModalMixins = {
         }
       })
     },
+    formatDepotName(id){
+      const target = this.depotList.find(item => item.value == id)
+      return target ? target.title : ''
+    },
+    formatSupplierName(id){
+      const target = this.supList.find(item => item.id == id)
+      return target ? target.supplier : ''
+    },
     //初始化下拉选项
     initSelectOpts() {
       this.initSupplier()

+ 2 - 24
jshERP-web/src/views/material/modules/BatchSetInfoModal.vue

@@ -20,20 +20,10 @@
         <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> 
             <a-col :md="8" :sm="24">
               <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="类别">
                 <a-tree-select
@@ -56,16 +46,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 +119,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: '确认操作',

+ 213 - 425
jshERP-web/src/views/material/modules/MaterialModal.vue

@@ -18,9 +18,9 @@
     </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-row class="form-row" :gutter="24" type="flex">
               <a-col :xl="6" :lg="8" :md="12" :sm="24">
                 <a-form-item
                   :labelCol="labelCol"
@@ -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="默认销售价"
                 >
@@ -297,7 +205,7 @@
                 </template>
               </a-table>
             </div>
-            <a-row class="form-row" :gutter="24">
+            <a-row class="form-row" :gutter="24" type="flex">
               <a-col :lg="24" :md="24" :sm="24">
                 <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }" label="">
                   <a-textarea :rows="1" placeholder="请输入备注" v-decorator="['remark']" style="margin-top: 8px" />
@@ -305,35 +213,36 @@
               </a-col>
             </a-row>
           </a-tab-pane>
-          <a-tab-pane key="2" tab="商品条码" forceRender>
+          <a-tab-pane key="2" tab="商品SKU" forceRender>
             <j-editable-table
               ref="editableProBarCodeTable"
               :loading="mbTable.loading"
               :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,25 +318,20 @@
         </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 {
-  checkMaterial,
-  checkMaterialBarCode,
   queryMaterialCategoryTreeList,
   changeNameToPinYin,
 } from '@/api/api'
@@ -445,9 +349,8 @@ export default {
   components: {
     BatchSetPriceModal,
     BatchSetStockModal,
-    UnitModal,
-    VendorModal,
-    DepotModal,
+    MaterialUnitModal,
+    MaterialUpcModal,
     JImageUpload,
     JDate,
     JEditableTable,
@@ -461,12 +364,12 @@ export default {
       title: '操作',
       width: '1300px',
       visible: false,
+      activeKey: '1',
       modalStyle: '',
       categoryTree: [],
       unitList: [],
       depotList: [],
       fileList: [],
-      unitChecked: false,
       meDeleteIdList: [], //删除条码信息的id数组
       prefixNo: 'material',
       model: {},
@@ -504,19 +407,11 @@ export default {
             scopedSlots: { customRender: 'purchaseDecimal' } 
           },
           {
-            title: '零售价',
-            dataIndex: 'commodityDecimal',
-          },
-          {
             title: '销售价',
             dataIndex: 'wholesaleDecimal',
             scopedSlots: { customRender: 'wholesaleDecimal' } 
           },
           {
-            title: '最低售价',
-            dataIndex: 'lowDecimal',
-          },
-          {
             title: '生产日期',
             dataIndex: 'productionDate',
           },
@@ -557,19 +452,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 +581,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: '请输入默认销售价!' }],
         },
@@ -663,7 +598,6 @@ export default {
         depotWithStock: '/depot/getAllListWithStock',
         batchList: '/materialBatch/getDetailList',
       },
-      barCodeUnitList: [],
     }
   },
   created() {
@@ -679,14 +613,6 @@ export default {
     document.getElementById(this.prefixNo).removeEventListener('keydown', this.handleOkKey)
   },
   methods: {
-    formatDepotName(id){
-      const target = this.depotList.find(item => item.value == id)
-      return target ? target.title : ''
-    },
-    formatSupplierName(id){
-      const target = this.supList.find(item => item.id == id)
-      return target ? target.supplier : ''
-    },
     // 快捷键
     handleOkKey(e) {
       const key = window.event.keyCode ? window.event.keyCode : window.event.which
@@ -700,6 +626,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 +659,6 @@ export default {
           pick(
             this.model,
             'name',
-            'standard',
-            'unit',
-            'unitId',
-            'model',
-            'color',
             'brand',
             'mnemonic',
             'categoryId',
@@ -742,8 +667,7 @@ export default {
             'expiryNum',
             'defaultPurchaseDecimal',
             'defaultWholesaleDecimal',
-            'systemSku',
-            'weight',
+            'systemSpu',
             'remark',
             'otherField1',
             'otherField2',
@@ -751,20 +675,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 +709,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 +735,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,59 +759,30 @@ 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)
           }
         })
     },
-    async getUnitListByID(id){
-      await getAction('/unit/getUnitListByID', { id}).then(res => {
-        this.barCodeUnitList = res.data || []
-      })
-    },
     /** 整理成formData */
     classifyIntoFormData(allValues) {
-      
-      const that = this
       let materialMain = Object.assign(this.model, allValues.formValue)
-      console.log('materialMain------mbList------', allValues.tablesValue[0].values)
+      console.log('allValues.tablesValue[0].values',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,138 +791,61 @@ export default {
     /** 发起新增或修改的请求 */
     requestAddOrEdit(formData) {
       console.log('formData------------', formData)
-      if (formData.mbList.length === 0) {
-        this.$message.warning('抱歉,请输入条码信息!')
+      if (formData.meList.length === 0) {
+        this.$message.warning('抱歉,必须填一条SKU信息!')
         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 (formData.enableSerialNumber === '1' && formData.enableBatchNumber === '1') {
-        this.$message.warning('抱歉,序列号和批号只能选择一项!')
-        return
-      }
-      //校验商品是否存在,通过校验商品的名称、型号、规格、颜色、单位、制造商等
-      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),
-      }
-      checkMaterial(param).then((res) => {
-        if (res && res.code === 200) {
-          if (res.data.status) {
-            this.$message.warning('抱歉,该商品已存在!')
+        if (depotStockObj.lowSafeStock && depotStockObj.highSafeStock) {
+          if (depotStockObj.lowSafeStock - 0 > depotStockObj.highSafeStock - 0) {
+            this.$message.warning('抱歉,' + depotStockObj.name + '的最低安全库存大于最高安全库存!')
             return
-          } 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(() => {})
           }
         }
-      })
-    },
-    parseParam(param) {
-      return param ? param : ''
-    },
-    validateBarCode(type, value, row, column, callback, target) {
-      let params = {
-        barCode: value,
-        id: row.id.length >= 20 ? 0 : row.id,
       }
-      checkMaterialBarCode(params).then((res) => {
-        if (res && res.code === 200) {
-          if (!res.data.status) {
-            callback(true)
+      //图片校验
+      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 {
-            callback(false, '该条码已经存在')
+            that.$message.warning(res.data.message)
+            that.confirmLoading = false
           }
-        } else {
-          callback(false, res.data)
-        }
-      })
+        })
+        .finally(() => {})
     },
     loadTreeData() {
       let that = this
@@ -1067,28 +864,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 +938,52 @@ 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}) {
+      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 +1003,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>

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

@@ -0,0 +1,146 @@
+<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}`" :prop="`upcList[${index}].upc`" :rules="{
+                validator: (rule, value, callback) => validatorUPC(rule, value, callback, item),
+                trigger: 'blur',
+              }">
+                <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'
+import { cloneDeep } from 'lodash'
+import { getAction } from '@/api/manage'
+
+export default {
+  name: 'MaterialUpcModal',
+  mixins: [mixinDevice],
+  data() {
+    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,
+      rawUpcMap: {}, // 用于存储原始的UPC列表
+    }
+  },
+  created() {},
+  methods: {
+    edit({upcList=[],rowId}) {
+      this.visible = true
+      this.rowId = rowId
+      console.log('edit', upcList, rowId)
+      this.model = cloneDeep({upcList})
+      this.rawUpcMap = upcList.reduce((map, item) => {
+        if(item.id){
+          map[item.id] = item.upc
+        }
+        return map
+      }, {})
+    },
+    close() {
+      this.$emit('close')
+      this.visible = false
+      this.$refs.form.resetFields()
+      this.$nextTick(() => {
+        this.model = {
+          upcList: []
+        }
+        this.rowId = null
+        this.rawUpcMap = {}
+      })
+    },
+    handleOk() {
+      // 保存之前校验
+      this.$refs.form.validate(async (valid) => {
+        if (valid) {
+          this.$emit('ok', {
+            upcList: cloneDeep(this.model.upcList),
+            rowId: this.rowId
+          })
+          this.visible = false
+        }
+      })
+    },
+    async validatorUPC(rule, value, callback, item) {
+      if(value) {
+        if(item.id&&this.rawUpcMap[item.id]==value) {
+          callback()
+          return
+        }
+        const res = await getAction('/materialsExtend/checkIsUpcExist', { upc: value,id: item.id || '' })
+        if (res.data) {
+          callback(new Error(res.msg))
+          return
+        }
+      }
+      callback()
+    },
+    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>

+ 5 - 7
jshERP-web/src/views/report/InDetail.vue

@@ -10,7 +10,7 @@
               <a-col :md="6" :sm="24">
                 <a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
                   <a-input
-                    placeholder="请输入条码、名称、助记码、规格、型号等信息"
+                    placeholder="请输入SKU、名称、助记码、规格、型号等信息"
                     v-model="queryParam.materialParam"
                   ></a-input>
                 </a-form-item>
@@ -273,7 +273,7 @@ export default {
       defDataIndex: [
         'rowIndex',
         'number',
-        'barCode',
+        'sku',
         'mname',
         'standard',
         'model',
@@ -305,7 +305,7 @@ export default {
           width: 100,
           scopedSlots: { customRender: 'numberCustomRender' },
         },
-        { title: '条码', dataIndex: 'barCode', sorter: (a, b) => a.barCode - b.barCode, width: 80 },
+        { title: 'SKU', dataIndex: 'sku', width: 80 },
         { title: '名称', dataIndex: 'mname', width: 120, ellipsis: true },
         { title: '规格', dataIndex: 'standard', width: 60, ellipsis: true },
         { title: '型号', dataIndex: 'model', width: 60, ellipsis: true },
@@ -313,7 +313,6 @@ export default {
         { title: '品牌', dataIndex: 'brand', width: 60, ellipsis: true },
         { title: '制造商', dataIndex: 'mfrs', width: 60, ellipsis: true },
         { title: '单位', dataIndex: 'mUnit', width: 50, ellipsis: true },
-        { title: '多属性', dataIndex: 'sku', width: 100, ellipsis: true },
         { title: '数量', dataIndex: 'operNumber', sorter: (a, b) => a.operNumber - b.operNumber, width: 60 },
         { title: '单价', dataIndex: 'unitPrice', sorter: (a, b) => a.unitPrice - b.unitPrice, width: 60 },
         { title: '金额', dataIndex: 'allPrice', sorter: (a, b) => a.allPrice - b.allPrice, width: 60 },
@@ -439,13 +438,13 @@ export default {
     exportExcel() {
       let list = []
       let head =
-        '单据编号,条码,名称,规格,型号,颜色,品牌,制造商,单位,多属性,数量,单价,金额,税率(%),税额,往来单位,仓库,入库日期,备注'
+        '单据编号,SKU,名称,规格,型号,颜色,品牌,制造商,单位,数量,单价,金额,税率(%),税额,往来单位,仓库,入库日期,备注'
       for (let i = 0; i < this.dataSource.length; i++) {
         let item = []
         let ds = this.dataSource[i]
         item.push(
           ds.number,
-          ds.barCode,
+          ds.sku,
           ds.mname,
           ds.standard,
           ds.model,
@@ -453,7 +452,6 @@ export default {
           ds.brand,
           ds.mfrs,
           ds.mUnit,
-          ds.sku,
           ds.operNumber,
           ds.unitPrice,
           ds.allPrice,

+ 5 - 7
jshERP-web/src/views/report/OutDetail.vue

@@ -10,7 +10,7 @@
               <a-col :md="6" :sm="24">
                 <a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
                   <a-input
-                    placeholder="请输入条码、名称、助记码、规格、型号等信息"
+                    placeholder="请输入SKU、名称、助记码、规格、型号等信息"
                     v-model="queryParam.materialParam"
                   ></a-input>
                 </a-form-item>
@@ -273,7 +273,7 @@ export default {
       defDataIndex: [
         'rowIndex',
         'number',
-        'barCode',
+        'sku',
         'mname',
         'standard',
         'model',
@@ -305,7 +305,7 @@ export default {
           width: 100,
           scopedSlots: { customRender: 'numberCustomRender' },
         },
-        { title: '条码', dataIndex: 'barCode', sorter: (a, b) => a.barCode - b.barCode, width: 80 },
+        { title: 'SKU', dataIndex: 'sku', width: 80 },
         { title: '名称', dataIndex: 'mname', width: 120, ellipsis: true },
         { title: '规格', dataIndex: 'standard', width: 60, ellipsis: true },
         { title: '型号', dataIndex: 'model', width: 60, ellipsis: true },
@@ -313,7 +313,6 @@ export default {
         { title: '品牌', dataIndex: 'brand', width: 60, ellipsis: true },
         { title: '制造商', dataIndex: 'mfrs', width: 60, ellipsis: true },
         { title: '单位', dataIndex: 'mUnit', width: 50, ellipsis: true },
-        { title: '多属性', dataIndex: 'sku', width: 100, ellipsis: true },
         { title: '数量', dataIndex: 'operNumber', sorter: (a, b) => a.operNumber - b.operNumber, width: 60 },
         { title: '单价', dataIndex: 'unitPrice', sorter: (a, b) => a.unitPrice - b.unitPrice, width: 60 },
         { title: '金额', dataIndex: 'allPrice', sorter: (a, b) => a.allPrice - b.allPrice, width: 60 },
@@ -439,13 +438,13 @@ export default {
     exportExcel() {
       let list = []
       let head =
-        '单据编号,条码,名称,规格,型号,颜色,品牌,制造商,单位,多属性,数量,单价,金额,税率(%),税额,往来单位,仓库,出库日期,备注'
+        '单据编号,SKU,名称,规格,型号,颜色,品牌,制造商,单位,数量,单价,金额,税率(%),税额,往来单位,仓库,出库日期,备注'
       for (let i = 0; i < this.dataSource.length; i++) {
         let item = []
         let ds = this.dataSource[i]
         item.push(
           ds.number,
-          ds.barCode,
+          ds.sku,
           ds.mname,
           ds.standard,
           ds.model,
@@ -453,7 +452,6 @@ export default {
           ds.brand,
           ds.mfrs,
           ds.mUnit,
-          ds.sku,
           ds.operNumber,
           ds.unitPrice,
           ds.allPrice,

+ 176 - 62
jshERP-web/src/views/stock/CheckList.vue

@@ -1,16 +1,50 @@
 <template>
   <a-row :gutter="24">
     <a-col :md="24">
-      <a-card :bordered="false">
+      <a-card :bordered="false" :style="cardStyle">
         <!-- 查询区域 -->
-        <filter-form
-          @search="onSearch"
-          @reset="onReset"
-          :queryParam="queryParam"
-          :spinnerList="spinnerList"
-          :deoptData="deoptData"
-        ></filter-form>
-        <div style="margin-bottom: 6px">
+        <div class="table-page-search-wrapper">
+          <a-form layout="inline" @keyup.enter.native="searchQuery">
+            <a-row :gutter="24">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="盘点状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                  <a-select placeholder="请选择盘点状态" showSearch :options="taskStatusList" v-model="queryParam.taskStatus">
+                  </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.number"></a-input>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="盘点仓库" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                  <a-select placeholder="请选择盘点仓库" showSearch :options="deoptData" v-model="queryParam.depotId">
+                  </a-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
+                  <a-button type="primary" @click="searchQuery">查询</a-button>
+                  <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
+                  <a @click="handleToggleSearch" style="margin-left: 8px">
+                    {{ toggleSearchStatus ? '收起' : '展开' }}
+                    <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
+                  </a>
+                </span>
+              </a-col>
+              <template v-if="toggleSearchStatus">
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="创建人" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                    <a-select placeholder="请选择创建人" showSearch :options="spinnerList" v-model="queryParam.createBy">
+                    </a-select>
+                  </a-form-item>
+                </a-col>
+              </template>
+            </a-row>
+          </a-form>
+        </div>
+        <div class="table-operator" style="margin-top: 5px">
           <a-button :disabled="!selectedRowKeys.length" type="primary" @click="onStartTask">开始盘点</a-button>
         </div>
         <a-table
@@ -40,9 +74,6 @@
             <a @click="addTask('detail', record)">查看</a>
             <a-divider type="vertical" />
             <a :disabled="record.taskStatus > 3" @click="addTask('edit', record)">编辑</a>
-            <!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-              <a :disabled="record.taskStatus !== 1 || record.taskStatus !== 4">删除</a>
-            </a-popconfirm> -->
           </span>
         </a-table>
       </a-card>
@@ -61,56 +92,122 @@
 </template>
 
 <script>
-// import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-import FilterForm from './components/FilterForm.vue'
-import table from './utils/table'
-// import StockModal from './components/stockModal.vue'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import { getAction, postAction } from '@/api/manage'
-import { newTableMixin } from '@/mixins/newTableMixin'
 import CheckModal from './components/checkModal.vue'
 
 export default {
-  components: { FilterForm, CheckModal },
-  mixins: [newTableMixin],
+  components: { CheckModal },
+  mixins: [JeecgListMixin],
   data() {
     return {
-      description: '盘点任务列表',
-      // 表头
-      scroll: { x: 1500 },
-      // 权限按钮集合
-      btnEnableList: [1, 1, 1],
-      queryParam: {
-        taskStatus: undefined,
-        number: '',
-        depotId: undefined,
-        createBy: undefined,
+      labelCol: {
+        span: 4,
+      },
+      wrapperCol: {
+        span: 19,
+        offset: 1,
       },
-      // stockTable: {
-      //   loading: false,
-      //   dataSource: [],
-      //   columns: table.taskColumns,
-      // },
-      columns: table.taskColumns,
+      taskStatusList: [
+        { value: 0, label: '未审核' },
+        { value: 1, label: '已审核' },
+        { value: 2, label: '进行中' },
+        { value: 3, label: '已完成' },
+        { value: 4, label: '已取消' },
+        { value: 5, label: '已更新' },
+        { value: 8, label: '审核未通过' },
+        { value: 9, label: '审核中' },
+      ],
+      queryParam: {},
+      columns: [
+        {
+          title: '操作',
+          dataIndex: 'action',
+          align: 'center',
+          width: 150,
+          scopedSlots: { customRender: 'action' },
+        },
+        {
+          title: '盘点任务编号',
+          dataIndex: 'number',
+          align: 'left',
+          width: 170,
+        },
+        {
+          title: '盘点任务名称',
+          dataIndex: 'taskName',
+          align: 'left',
+          width: 140,
+        },
+        {
+          title: '盘点类型',
+          dataIndex: 'taskType',
+          align: 'left',
+          width: 100,
+          scopedSlots: { customRender: 'taskType' },
+        },
+        {
+          title: '盘点仓库',
+          dataIndex: 'depotName',
+          align: 'left',
+          width: 100,
+        },
+        {
+          title: '商品数量',
+          dataIndex: 'materialCount',
+          align: 'left',
+          width: 100,
+        },
+        {
+          title: '盘点库位范围',
+          dataIndex: 'positionRange',
+          align: 'left',
+          width: 120,
+        },
+        {
+          title: '创建人',
+          dataIndex: 'createByName',
+          align: 'left',
+          width: 100,
+        },
+        {
+          title: '创建时间',
+          dataIndex: 'createTime',
+          align: 'left',
+          width: 100,
+        },
+        {
+          title: '盘点负责人',
+          dataIndex: 'creatorName',
+          align: 'left',
+          width: 100,
+        },
+        {
+          title: '盘点状态',
+          dataIndex: 'taskStatus',
+          align: 'left',
+          width: 100,
+          scopedSlots: { customRender: 'taskStatus' },
+        },
+        {
+          title: '完成时间',
+          dataIndex: 'operTime',
+          align: 'left',
+          width: 100,
+        },
+      ],
       dataSource: [],
       loading: false,
-
       rules: {
         taskType: { rules: [{ required: true, message: '请选择盘点类型' }] },
         depotId: { rules: [{ required: true, message: '请选择盘点仓库' }] },
         taskName: { rules: [{ required: true, message: '请输入盘点任务名称' }] },
       },
-
-      // rules: {
-      //   number: { rules: [{ required: true, message: '请输入盘点编号' }] },
-      // },
-
       url: {
         list: '/stocktaking/list',
         add: '/stocktaking/add',
-        detailList: '/stocktaking/detail',
         spinnerList: '/stocktaking/creatorSpinnerList',
         depotList: '/depot/findDepotByCurrentUser',
-        detailByItemList: '/stocktaking/detailByItemList',
         delete: '/stocktaking/taskDelete/',
         cancel: '/stocktaking/taskCancel/',
         startTask: '/stocktaking/startTask/',
@@ -126,13 +223,13 @@ export default {
   watch: {
     stockVisible(val) {
       if (!val) {
-        this.getList()
+        this.loadData()
       }
     },
   },
   created() {
-    this.getList()
-    this.getSpinnerList(), this.getDepotList()
+    this.getSpinnerList()
+    this.getDepotList()
   },
   methods: {
     addTask(type, data) {
@@ -144,20 +241,28 @@ export default {
       }
       this.stockVisible = true
     },
-    getList(type) {
-      if (type === 'search') this.ipagination.current = 1 // 重新加载数据时,重置当前页为第一页
-      if (type === 'reset') {
-        for (let i in this.queryParam) {
-          this.$set(this.queryParam, i, null)
-        }
+    loadData(arg) {
+      if (!this.url.list) {
+        this.$message.error('请设置url.list属性!')
+        return
+      }
+      //加载数据 若传入参数1则加载第一页的内容
+      if (arg === 1) {
+        this.ipagination.current = 1
       }
-      const url = this.url.list + '?currentPage=' + this.ipagination.current + '&pageSize=' + this.ipagination.pageSize
       this.loading = true
-      const params = { ...this.queryParam }
-      postAction(url, params).then((res) => {
-        this.dataSource = res.data.rows
-        this.ipagination.total = Number(res.data.total)
+      const url = this.url.list + '?currentPage=' + this.ipagination.current + '&pageSize=' + this.ipagination.pageSize
+      postAction(url, {
+        ...this.queryParam
+      }).then((res) => {
+        if (res.code === 200) {
+          this.dataSource = res.data.rows
+          this.ipagination.total = Number(res.data.total)
+        }else {
+          this.$message.warning(res.msg)
+        }
         this.loading = false
+        this.onClearSelected()
       })
     },
     getDetailList(id) {
@@ -187,7 +292,7 @@ export default {
       getAction(url)
         .then((res) => {
           this.$message.success('删除成功')
-          this.getList()
+          this.loadData()
         })
         .catch((err) => {
           this.$message.error('删除失败')
@@ -199,7 +304,7 @@ export default {
       getAction(url)
         .then((res) => {
           this.$message.success('取消成功')
-          this.getList()
+          this.loadData()
         })
         .catch((err) => {
           this.$message.error('取消失败')
@@ -209,18 +314,27 @@ export default {
     onStartTask() {
       const ids = this.selectedRowKeys
       const url = this.url.startTask + ids
-      // this.$refs.table.clearSelection()
 
       getAction(url)
         .then((res) => {
           this.$message.success('盘点成功')
-          this.getList()
-          this.selectedRowKeys = []
+          this.loadData()
         })
         .catch((err) => {
           this.$message.error('盘点失败')
         })
     },
+    formateTaskStatus(type) {
+      const target = this.taskStatusList.find(item => item.value == type)
+      return target?target.label:''
+    },
+    getCheckboxProps(record) {
+      return {
+        props: {
+          disabled: record.taskStatus !== 1,
+        },
+      }
+    },
   },
 }
 </script>

+ 228 - 134
jshERP-web/src/views/stock/TaskList.vue

@@ -1,18 +1,52 @@
 <template>
   <a-row :gutter="24">
     <a-col :md="24">
-      <a-card :bordered="false">
+      <a-card :bordered="false" :style="cardStyle">
         <!-- 查询区域 -->
-        <filter-form
-          @search="onSearch"
-          @reset="onReset"
-          :queryParam="queryParam"
-          :spinnerList="spinnerList"
-          :deoptData="deoptData"
-        ></filter-form>
-        <div style="margin-bottom: 6px">
-          <a-button type="primary" icon="plus" @click="addTask('add')">新增盘点任务</a-button>
-
+        <div class="table-page-search-wrapper">
+          <a-form layout="inline" @keyup.enter.native="searchQuery">
+            <a-row :gutter="24">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="盘点状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                  <a-select placeholder="请选择盘点状态" showSearch :options="taskStatusList" v-model="queryParam.taskStatus">
+                  </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.number"></a-input>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="盘点仓库" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                  <a-select placeholder="请选择盘点仓库" showSearch :options="deoptData" v-model="queryParam.depotId">
+                  </a-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
+                  <a-button type="primary" @click="searchQuery">查询</a-button>
+                  <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
+                  <a @click="handleToggleSearch" style="margin-left: 8px">
+                    {{ toggleSearchStatus ? '收起' : '展开' }}
+                    <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
+                  </a>
+                </span>
+              </a-col>
+              <template v-if="toggleSearchStatus">
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="创建人" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                    <a-select placeholder="请选择创建人" showSearch :options="spinnerList" v-model="queryParam.createBy">
+                    </a-select>
+                  </a-form-item>
+                </a-col>
+              </template>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- 操作按钮区域 -->
+        <div class="table-operator" style="margin-top: 5px">
+          <a-button type="primary" icon="plus" @click="onAdd">新增盘点任务</a-button>
           <a-popconfirm
             :disabled="!selectedRowKeys.length"
             style="margin: 0 6px"
@@ -28,175 +62,229 @@
           >
             <a-button :disabled="!selectedRowKeys.length">批量删除</a-button>
           </a-popconfirm>
-          <!-- <a-button style="margin-left: 6px">导出任务</a-button> -->
         </div>
-        <a-table
-          ref="table"
-          size="middle"
-          bordered
-          rowKey="id"
-          :columns="columns"
-          :dataSource="dataSource"
-          :pagination="ipagination"
-          :scroll="scroll"
-          :loading="loading"
-          :rowSelection="{
-            selectedRowKeys: selectedRowKeys,
-            onChange: onSelectChange,
-          }"
-          @change="handleTableChange"
-        >
-          <template slot="taskType" slot-scope="value">
-            {{ value === 1 ? '全盘' : '抽盘' }}
-          </template>
-          <template slot="taskStatus" slot-scope="value">
-            {{ formateTaskStatus(value) }}
-          </template>
-          <span slot="action" slot-scope="text, record">
-            <a @click="addTask('detail', record)">查看</a>
-            <a-divider type="vertical" />
-            <a :disabled="record.taskStatus !== 1" @click="addTask('edit', record)">编辑</a>
-            <a-divider type="vertical" />
-            <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-              <a :disabled="record.taskStatus !== 1 && record.taskStatus !== 4">删除</a>
-            </a-popconfirm>
-          </span>
-        </a-table>
+        <!-- table区域-begin -->
+        <div>
+          <a-table
+            ref="table"
+            size="middle"
+            bordered
+            rowKey="id"
+            :columns="columns"
+            :dataSource="dataSource"
+            :pagination="ipagination"
+            :scroll="scroll"
+            :loading="loading"
+            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+            @change="handleTableChange"
+          >
+            <template slot="taskType" slot-scope="value">
+              {{ value === 1 ? '全盘' : '抽盘' }}
+            </template>
+            <template slot="taskStatus" slot-scope="value">
+              {{ formateTaskStatus(value) }}
+            </template>
+            <span slot="action" slot-scope="text, record">
+              <a @click="onDetail(record)">查看</a>
+              <a-divider type="vertical" />
+              <a @click="onEdit(record)">编辑</a>
+              <a-divider type="vertical" />
+              <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record)">
+                <a>删除</a>
+              </a-popconfirm>
+            </span>
+          </a-table>
+        </div>
+        <!-- table区域-end -->
       </a-card>
     </a-col>
-    <stock-modal
-      :spinnerList="spinnerList"
-      :deoptData="deoptData"
-      :stockVisible.sync="stockVisible"
-      :title="title"
-      :rules="rules"
-      :taskId="taskId"
-      :openType="openType"
-      ref="stockF"
-    ></stock-modal>
+    <InventoryCheckModal ref="modalForm" @ok="modalFormOk"></InventoryCheckModal>
   </a-row>
 </template>
 
 <script>
-import FilterForm from './components/FilterForm.vue'
-import table from './utils/table'
-import StockModal from './components/stockModal.vue'
 import { getAction, postAction } from '@/api/manage'
-import { newTableMixin } from '@/mixins/newTableMixin'
-
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import InventoryCheckModal from './modules/InventoryCheckModal.vue'
 export default {
-  components: { FilterForm, StockModal },
-  mixins: [newTableMixin],
+  components: { InventoryCheckModal },
+  mixins: [JeecgListMixin],
   data() {
     return {
-      description: '盘点任务列表',
-      // 表头
-      scroll: { x: 1500 },
-      // 权限按钮集合
-      btnEnableList: [1, 1, 1],
-      queryParam: {
-        taskStatus: undefined,
-        number: '',
-        depotId: undefined,
-        createBy: undefined,
+      labelCol: {
+        span: 4,
       },
-      // stockTable: {
-      //   loading: false,
-      //   dataSource: [],
-      //   columns: table.taskColumns,
-      // },
-      columns: table.taskColumns,
-      dataSource: [],
-      loading: false,
-
+      wrapperCol: {
+        span: 19,
+        offset: 1,
+      },
+      taskStatusList: [
+        { value: 0, label: '未审核' },
+        { value: 1, label: '已审核' },
+        { value: 2, label: '进行中' },
+        { value: 3, label: '已完成' },
+        { value: 4, label: '已取消' },
+        { value: 5, label: '已更新' },
+        { value: 8, label: '审核未通过' },
+        { value: 9, label: '审核中' },
+      ],
+      queryParam: {},
+      columns: [
+        {
+          title: '操作',
+          dataIndex: 'action',
+          align: 'center',
+          width: 150,
+          scopedSlots: { customRender: 'action' },
+        },
+        {
+          title: '盘点任务编号',
+          dataIndex: 'number',
+          align: 'left',
+          width: 170,
+        },
+        {
+          title: '盘点任务名称',
+          dataIndex: 'taskName',
+          align: 'left',
+          width: 140,
+        },
+        {
+          title: '盘点类型',
+          dataIndex: 'taskType',
+          align: 'left',
+          width: 100,
+          scopedSlots: { customRender: 'taskType' },
+        },
+        {
+          title: '盘点仓库',
+          dataIndex: 'depotName',
+          align: 'left',
+          width: 100,
+        },
+        {
+          title: '商品数量',
+          dataIndex: 'materialCount',
+          align: 'left',
+          width: 100,
+        },
+        {
+          title: '盘点库位范围',
+          dataIndex: 'positionRange',
+          align: 'left',
+          width: 120,
+        },
+        {
+          title: '创建人',
+          dataIndex: 'createByName',
+          align: 'left',
+          width: 100,
+        },
+        {
+          title: '创建时间',
+          dataIndex: 'createTime',
+          align: 'left',
+          width: 100,
+        },
+        {
+          title: '盘点负责人',
+          dataIndex: 'creatorName',
+          align: 'left',
+          width: 100,
+        },
+        {
+          title: '盘点状态',
+          dataIndex: 'taskStatus',
+          align: 'left',
+          width: 100,
+          scopedSlots: { customRender: 'taskStatus' },
+        },
+        {
+          title: '完成时间',
+          dataIndex: 'operTime',
+          align: 'left',
+          width: 100,
+        },
+      ],
       rules: {
         taskType: { rules: [{ required: true, message: '请选择盘点类型' }] },
         depotId: { rules: [{ required: true, message: '请选择盘点仓库' }] },
         taskName: { rules: [{ required: true, message: '请输入盘点任务名称' }] },
       },
-
-      // rules: {
-      //   number: { rules: [{ required: true, message: '请输入盘点编号' }] },
-      // },
-
       url: {
         list: '/stocktaking/list',
         add: '/stocktaking/add',
-        detailList: '/stocktaking/detail',
         spinnerList: '/stocktaking/creatorSpinnerList',
         depotList: '/depot/findDepotByCurrentUser',
-        detailByItemList: '/stocktaking/detailByItemList',
         delete: '/stocktaking/taskDelete/',
         cancel: '/stocktaking/taskCancel/',
       },
-      stockVisible: false,
-      title: '',
       spinnerList: [],
       deoptData: [],
-      taskId: '',
-      openType: 'add',
     }
   },
-  watch: {
-    stockVisible(val) {
-      if (!val) {
-        this.getList()
-      }
-    },
-  },
   computed: {
     isDel() {
-      return this.selectionRows.filter((item) => item.taskStatus !== 1 && item.taskStatus !== 4).length > 0
+      return this.selectionRows.filter((item) => item.taskStatus !== 0 && item.taskStatus !== 4).length > 0
         ? true
         : false
     },
     isStock() {
-      return this.selectionRows.filter((item) => item.taskStatus !== 1 && item.taskStatus !== 2).length > 0
+      return this.selectionRows.filter((item) => item.taskStatus !== 0 && item.taskStatus !== 2).length > 0
         ? true
         : false
     },
   },
-
   created() {
-    this.getList()
-    this.getSpinnerList(), this.getDepotList()
+    this.getSpinnerList()
+    this.getDepotList()
   },
   methods: {
-    addTask(type, data) {
-      this.taskId = ''
-      this.openType = type
-      this.title = type === 'add' ? '新增盘点任务' : type === 'edit' ? '编辑盘点任务' : '查看盘点任务'
-      if (type !== 'add') {
-        this.getDetailList(data.id)
+    loadData(arg) {
+      if (!this.url.list) {
+        this.$message.error('请设置url.list属性!')
+        return
       }
-      this.stockVisible = true
-    },
-    getList(type) {
-      if (type === 'search') this.ipagination.current = 1 // 重新加载数据时,重置当前页为第一页
-      if (type === 'reset') {
-        for (let i in this.queryParam) {
-          this.$set(this.queryParam, i, null)
-        }
+      //加载数据 若传入参数1则加载第一页的内容
+      if (arg === 1) {
+        this.ipagination.current = 1
       }
-      const url = this.url.list + '?currentPage=' + this.ipagination.current + '&pageSize=' + this.ipagination.pageSize
       this.loading = true
-      const params = { ...this.queryParam }
-      postAction(url, params).then((res) => {
-        this.dataSource = res.data.rows
-        this.ipagination.total = Number(res.data.total)
+      const url = this.url.list + '?currentPage=' + this.ipagination.current + '&pageSize=' + this.ipagination.pageSize
+      postAction(url, {
+        ...this.queryParam
+      }).then((res) => {
+        if (res.code === 200) {
+          this.dataSource = res.data.rows
+          this.ipagination.total = Number(res.data.total)
+        }else {
+          this.$message.warning(res.msg)
+        }
         this.loading = false
+        this.onClearSelected()
       })
     },
-    getDetailList(id) {
-      this.taskId = id
+    onEdit(record){
+      if(record.taskStatus==0||record.taskStatus==8){
+        this.$refs.modalForm.edit(record.number)
+        this.$refs.modalForm.title = '编辑盘点任务'
+      }else{
+        this.$message.warning('只有未审核、审核不通过的状态才能编辑!')
+      }
+    },
+    onAdd(){
+      this.$refs.modalForm.add()
+      this.$refs.modalForm.title = '新增盘点任务'
+    },
+    onDetail(record){
+      this.$refs.modalForm.lookDetail(record.number)
+      this.$refs.modalForm.title = '查看盘点任务'
     },
-
     getSpinnerList() {
       getAction(this.url.spinnerList).then((res) => {
         this.spinnerList = res.data || []
       })
     },
-
     getDepotList() {
       getAction(this.url.depotList).then((res) => {
         this.deoptData = res.data.map((item) => {
@@ -207,34 +295,40 @@ export default {
         })
       })
     },
-
-    handleDelete(id) {
-      if (this.isDel) return this.$message.error('只能删除未开始或已取消的盘点任务,请重新选择!')
-
-      const ids = id || this.selectedRowKeys
+    handleDelete(record) {
+      if(record&&(record.taskStatus!=0&&record.taskStatus!=4)){
+        this.$message.warning('只有未审核、已取消的状态才能删除!')
+        return
+      }
+      if (this.isDel) return this.$message.error('只能删除未审核或已取消的盘点任务,请重新选择!')
+      const ids = record? record.id: this.selectedRowKeys
       const url = this.url.delete + ids
       getAction(url)
         .then((res) => {
           this.$message.success('删除成功')
-          this.getList()
+          this.loadData()
         })
         .catch((err) => {
           this.$message.error('删除失败')
         })
     },
     cancelTask() {
-      if (this.isStock) return this.$message.error('只能取消未开始或进行中的盘点任务,请重新选择!')
+      if (this.isStock) return this.$message.error('只能取消未审核或进行中的盘点任务,请重新选择!')
       const ids = this.selectedRowKeys
       const url = this.url.cancel + ids
       getAction(url)
         .then((res) => {
           this.$message.success('取消成功')
-          this.getList()
+          this.loadData()
         })
         .catch((err) => {
           this.$message.error('取消失败')
         })
     },
+    formateTaskStatus(type) {
+      const target = this.taskStatusList.find(item => item.value == type)
+      return target?target.label:''
+    },
   },
 }
 </script>

+ 0 - 99
jshERP-web/src/views/stock/components/FilterForm.vue

@@ -1,99 +0,0 @@
-<template>
-  <div class="table-page-search-wrapper">
-    <!-- 搜索区域 -->
-    <a-form layout="inline" :form="queryParam" ref="form" @keyup.enter.native="searchQuery">
-      <a-row :gutter="24">
-        <a-col :md="4" :sm="24">
-          <a-form-item label="盘点状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
-            <a-select placeholder="请选择盘点状态" showSearch :options="taskStatusList" v-model="queryParam.taskStatus">
-            </a-select>
-          </a-form-item>
-        </a-col>
-        <a-col :md="5" :sm="24">
-          <a-form-item label="盘点单号" :labelCol="labelCol" :wrapperCol="wrapperCol">
-            <a-input placeholder="请输入条码、名称" v-model="queryParam.number"></a-input>
-          </a-form-item>
-        </a-col>
-        <a-col :md="5" :sm="24">
-          <a-form-item label="盘点仓库" :labelCol="labelCol" :wrapperCol="wrapperCol">
-            <a-select placeholder="请选择盘点仓库" showSearch :options="deoptData" v-model="queryParam.depotId">
-            </a-select>
-          </a-form-item>
-        </a-col>
-        <a-col :md="4" :sm="24">
-          <a-form-item label="创建人" :labelCol="labelCol" :wrapperCol="wrapperCol">
-            <a-select placeholder="请选择创建人" showSearch :options="spinnerList" v-model="queryParam.createBy">
-            </a-select>
-          </a-form-item>
-        </a-col>
-        <!-- <a-col :md="6" :sm="24">
-          <a-form-item label="商品类别" :labelCol="labelCol" :wrapperCol="wrapperCol">
-            <a-select placeholder="请选择商品类别" showSearch optionFilterProp="children" v-model="queryParam.organId">
-              <a-select-option v-for="(item, index) in statusList" :key="index" :value="item.id">
-                {{ item.supplier }}
-              </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.number"></a-input>
-          </a-form-item>
-        </a-col> -->
-        <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="onSearch">查询</a-button>
-            <a-button style="margin-left: 8px" @click="onReset">重置</a-button>
-          </a-col>
-        </span>
-      </a-row>
-    </a-form>
-  </div>
-</template>
-
-<script>
-export default {
-  props: {
-    queryParam: {
-      type: Object,
-      default: () => {},
-    },
-    spinnerList: {
-      type: Array,
-      default: () => [],
-    },
-    deoptData: {
-      type: Array,
-      default: () => [],
-    },
-  },
-  data() {
-    return {
-      labelCol: {
-        xs: { span: 24 },
-        sm: { span: 8 },
-      },
-      wrapperCol: {
-        xs: { span: 24 },
-        sm: { span: 16 },
-      },
-      taskStatusList: [
-        { value: 1, label: '未开始' },
-        { value: 2, label: '进行中' },
-        { value: 3, label: '已完成' },
-        { value: 4, label: '已取消' },
-      ],
-    }
-  },
-  methods: {
-    onSearch() {
-      this.$emit('search')
-    },
-    onReset() {
-      this.$emit('reset')
-    },
-  },
-}
-</script>
-
-<style></style>

+ 13 - 5
jshERP-web/src/views/stock/components/checkModal.vue

@@ -59,7 +59,13 @@
                   </a-form-item>
                 </a-col>
                 <a-col :xl="6" :lg="8" :md="12" :sm="24" class="form-col">
-                  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="是否存在数量差异">
+                  <a-form-item :labelCol="{
+                    xs: { span: 24 },
+                    sm: { span: 11 },
+                }" :wrapperCol="{
+                    xs: { span: 24 },
+                    sm: { span: 13 },
+                  }" label="是否存在数量差异">
                     <a-select placeholder="请选择" v-model="queryParam.isDifference" :options="isDifferenceData"> </a-select>
                   </a-form-item>
                 </a-col>
@@ -99,7 +105,7 @@
         <a-button v-if="isShowBtn" @click="handleUpdate" type="primary">确定更新盘点数据</a-button>
       </template>
     </a-modal>
-    <a-modal @cancel="editVisible = false" @ok="onSubmitGoods" :visible="editVisible" title="编辑" width="50%">
+    <a-modal @cancel="closeFormModal" @ok="onSubmitGoods" :visible="editVisible" title="编辑" width="50%">
       <a-form-model :model="editForm" :rules="editFormRules" ref="editFormModel">
         <a-form-model-item label="盘点任务名称" :labelCol="{ span: 4 }" :wrapperCol="{ span: 14 }" prop="name">
           <a-input disabled v-model="editForm.name" placeholder="请输入"></a-input>
@@ -141,7 +147,6 @@
 
 <script>
 import {  queryMaterialCategoryTreeList } from '@/api/api'
-
 import editForm from './editForm.vue'
 import table from '../utils/table'
 import JSelectMaterialModal from '../../../components/jeecgbiz/modal/JSelectMaterialModal.vue'
@@ -207,7 +212,7 @@ export default {
       form: {},
       isShow: false,
       stockType: 'check',
-      queryParam: { categoryId: '', materialName: '', batchNumber: '', position: '', isDifference: null },
+      queryParam: { categoryId: undefined, materialName: '', batchNumber: '', position: '', isDifference: undefined },
       isDifferenceData: [
         {
           label: '全部',
@@ -274,11 +279,14 @@ export default {
     },
   },
   methods: {
+    closeFormModal(){
+      this.editVisible = false
+      this.$refs.editFormModel.resetFields()
+    },
     handleEdit(data) {
       console.log('handleEdit=====',data)
       this.editForm = { ...data,name:this.form.taskName }
       this.editVisible = true
-      this.handleChangeNewInventory(data.inventory)
     },
     onSubmitGoods() {
       this.$refs.editFormModel.validate((valid) => {

+ 8 - 4
jshERP-web/src/views/stock/components/editForm.vue

@@ -129,10 +129,14 @@ export default {
   data() {
     return {
       taskStatusList: [
-        { value: 1, label: '未开始' },
+        { value: 0, label: '未审核' },
+        { value: 1, label: '已审核' },
         { value: 2, label: '进行中' },
         { value: 3, label: '已完成' },
         { value: 4, label: '已取消' },
+        { value: 5, label: '已更新' },
+        { value: 8, label: '审核未通过' },
+        { value: 9, label: '审核中' },
       ],
       labelCol: {
         xs: { span: 24 },
@@ -164,10 +168,10 @@ export default {
           this.emitForm()
         }
         if (this.openType === 'add') {
-          this.model.taskStatus = 1
+          this.model.taskStatus = 0
 
           this.$nextTick(() => {
-            this.form.setFieldsValue({ taskStatus: 1 })
+            this.form.setFieldsValue({ taskStatus: 0 })
           })
         }
       },
@@ -177,7 +181,7 @@ export default {
   },
   computed: {
     isDisabled() {
-      return this.openType === 'detail' || this.model.taskStatus !== 1
+      return this.openType === 'detail' || this.model.taskStatus !== 0
     },
   },
   methods: {

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

@@ -1,343 +0,0 @@
-<template>
-  <div ref="container">
-    <a-modal 
-      :title="title" 
-      width="100%" 
-      @cancel="handleCancel" 
-      :visible="stockVisible" 
-      :confirmLoading="confirmLoading"
-      :getContainer="() => $refs.container" 
-      :wrapClassName="wrapClassNameInfo()"
-      :mask="isDesktop()"
-      :maskClosable="false"
-      style="top: 0; height: 100%"
-    >
-      <a-spin :spinning="confirmLoading">
-        <edit-form
-          :spinnerList="spinnerList"
-          :depotList="deoptData"
-          :form="form"
-          :rules="rules"
-          :stockVisible="stockVisible"
-          ref="editForm"
-          :total="ipagination.total"
-          :openType="openType"
-          :stockType="stockType"
-          @changeForm="handleChangeForm"
-        ></edit-form>
-        <div>
-          <a-button v-if="form.taskType === 2&&openType!='detail'" style="margin-bottom: 6px" type="primary" @click="onChangeGoods"
-            >选择商品</a-button
-          >
-          <a-table
-            v-if="dataSource.length"
-            ref="table"
-            size="middle"
-            bordered
-            rowKey="id"
-            :scroll="{ x: 'max-content'}"
-            :columns="columns"
-            :dataSource="dataSource"
-            :loading="loading"
-            :pagination="ipagination"
-            @change="handleTableChange"
-          >
-            <span v-if="isShowBtn" slot="action" slot-scope="text, record">
-              <!-- <a-divider type="vertical" /> -->
-              <a-popconfirm @confirm="handleDelete(record)" title="确定删除吗?">
-                <a v-if="form.taskType!=1">删除</a>
-              </a-popconfirm>
-            </span>
-            <template slot="inventory" slot-scope="value, record">
-              {{ parseInt(value) }}
-            </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> -->
-          </a-table>
-        </div>
-      </a-spin>
-      <template slot="footer">
-        <a-button @click="handleCancel">取消</a-button>
-        <a-button v-if="isShowBtn" @click="handleOk" type="primary">确认发布盘点任务</a-button>
-      </template>
-    </a-modal>
-    <j-select-material-modal
-      @ok="getGoods"
-      @all="findAllSelect"
-      ref="selectModal"
-      :multi="true"
-      :isStock="true"
-    ></j-select-material-modal>
-  </div>
-</template>
-
-<script>
-import editForm from './editForm.vue'
-import table from '../utils/table'
-import JSelectMaterialModal from '../../../components/jeecgbiz/modal/JSelectMaterialModal2.vue'
-import { getAction, postAction } from '@/api/manage'
-import { newTableMixin } from '@/mixins/newTableMixin'
-import { mixinDevice } from '@/utils/mixin'
-
-export default {
-  name: 'StockModal',
-  components: { editForm, JSelectMaterialModal },
-  mixins: [ newTableMixin, mixinDevice ],
-  props: {
-    rules: {
-      type: Object,
-      default: () => {
-        return {}
-      },
-    },
-
-    stockVisible: {
-      type: Boolean,
-      default: false,
-    },
-    title: {
-      type: String,
-      default: '新增',
-    },
-    spinnerList: {
-      type: Array,
-      default: () => [],
-    },
-    deoptData: {
-      type: Array,
-      default: () => [],
-    },
-    taskId: {
-      type: String,
-      default: '',
-    },
-    openType: {
-      type: String,
-      default: 'add',
-    },
-  },
-  data() {
-    return {
-      width: '1600px',
-      visible: false,
-      confirmLoading: false,
-      prefixNo: '',
-      loading: false,
-      dataSource: [],
-      columns: table.goodsColums,
-      url: {
-        add: '/stocktaking/add',
-        update: '/stocktaking/detailUpdate',
-      },
-      form: {},
-      isShow: false,
-      stockType: 'task',
-      batchNumberStr: ''
-    }
-  },
-  watch: {
-    stockVisible(val) {
-      if (val) {
-        if (this.taskId) {
-          this.$nextTick(() => {
-            this.getList(this.taskId)
-          })
-
-          return
-        }
-      } else {
-        this.dataSource = []
-        this.ipagination.current = 1
-        this.loading = false
-      }
-    },
-  },
-  computed: {
-    isShowBtn() {
-      if (this.openType === 'add') return true
-
-      if (this.openType === 'detail') return false
-      if (this.form.taskStatus !== 1) return false
-      return true
-    },
-  },
-  methods: {
-    handleCancel() {
-      this.$emit('update:stockVisible', false)
-    },
-    handleOk() {
-      this.$refs.editForm.form.validateFields((err, values) => {
-        if (!err) {
-          const params = { ...values }
-          if (params.taskType === 2) {
-            params.materialExtendIdList = this.dataSource.map((item) => item.batchNumber)
-          }
-          if(this.openType != 'add') {
-            params.id = this.taskId
-          }
-          const url = this.openType === 'add' ? this.url.add : this.url.update
-          postAction(url, params).then((res) => {
-            if (res.code === 200) {
-              this.$message.success('操作成功')
-              this.handleCancel()
-            } else {
-              this.$message.error(res.msg)
-            }
-          })
-        }
-      })
-    },
-    onChangeGoods() {
-      if(!this.form.depotId){
-        this.$message.warning('请选择仓库!')
-        return
-      }
-      // this.$refs.selectModal.queryParam.depotId = this.form.depotId
-      this.$refs.selectModal.showModal()
-    },
-    getList(id) {
-      const url = '/stocktaking/detail/' + id
-      const url2 = `/stocktaking/detailByItemList?currentPage=${this.ipagination.current}&pageSize=${this.ipagination.pageSize}`
-      const form = this.$refs['editForm'].form
-
-      getAction(url).then((res) => {
-        const {
-          depotId,
-          taskName,
-          taskStatus,
-          taskType,
-          createTime,
-          createByName,
-          materialCount,
-          positionRange,
-          creator,
-          id,
-          number
-        } = res.data
-        form.setFieldsValue({
-          depotId,
-          taskName,
-          taskStatus,
-          taskType,
-          createTime,
-          createByName,
-          materialCount,
-          positionRange,
-          creator,
-          id,
-          number
-        })
-
-        postAction(url2, { taskStocktakingId: id }).then((res) => {
-          this.dataSource = res.data
-          this.ipagination.total = this.dataSource.length
-          const materialExtendIdList = this.dataSource.map((item) => item.batchNumber)
-
-          form.setFieldsValue({
-            materialExtendIdList,
-          })
-          this.getForm(form.getFieldsValue())
-          console.log('this.dataSource',this.dataSource)
-          console.log('this.columns',this.columns)
-        })
-      })
-    },
-    getGoods(rows, ids) {
-      const str = ids
-        .split(',')
-        .filter((item) => item)
-        .join(',')
-      if(!this.form.depotId){
-        this.$message.warning('请选择仓库!')
-        return
-      }
-      getAction('/materialBatch/findBatchNumbersByBarCode',{
-        barCodes: str,
-        depotId:this.form.depotId
-      }).then((res) => {
-        const batchStr = res.data.split(',')
-        .filter((item) => item)
-        .join(',')
-        this.batchNumberStr = batchStr
-        this.getBatchData()
-      })
-    },
-    findAllSelect() {
-      if(!this.form.depotId){
-        this.$message.warning('请选择仓库!')
-        return
-      }
-      getAction('/materialBatch/findBatchNumbersByBarCode',{
-        depotId:this.form.depotId
-      }).then((res) => {
-        this.$refs.selectModal.close()
-        const batchStr = res.data.split(',')
-        .filter((item) => item)
-        .join(',')
-        this.batchNumberStr = batchStr
-        this.getBatchData()
-      })
-    },
-    getBatchData() {
-      const params = {
-        batchNumber: this.batchNumberStr,
-        // organId: '',
-        // mpList: '',
-        // prefixNo: '',
-      }
-      getAction(`/material/getMaterialByBatchNumber?currentPage=${this.ipagination.current}&pageSize=${this.ipagination.pageSize}`, params).then((res) => {
-        this.dataSource = res.data.rows
-        if(this.dataSource.length===0){
-          this.$message.warning('暂无数据!')
-        }
-        this.ipagination.total = Number(res.data.total)
-        this.dataSource = this.dataSource.reduce((acc, cur) => {
-          const hasDuplicate = acc.some((item) => item.batchNumber === cur.batchNumber)
-          if (!hasDuplicate) {
-            acc.push(cur)
-          }
-          return acc
-        }, [])
-      })
-    },
-    getForm(val) {
-      this.form = val
-      this.$refs['editForm'].model = val
-    },
-    //删除
-    handleDelete(record) {
-      this.dataSource = this.dataSource.filter((item) => item.batchNumber !== record.batchNumber)
-      this.ipagination.total -=1
-    },
-
-    handleChangeForm(val) {
-      this.dataSource = []
-      this.ipagination.current = 1
-      this.ipagination.total = 0
-      this.getForm(val)
-      if (val.taskType === 1) {
-        this.findAllSelect()
-      }
-    },
-
-    handleDrag() {},
-    // ipagination() {},
-
-    handleTableChange(pagination) {
-      if (pagination && pagination.current) {
-        this.ipagination = pagination
-      }
-      if(this.openType=='add'){
-        this.getBatchData()
-      }else{
-        this.getList(this.taskId)
-      }
-    },
-  },
-}
-</script>
-
-<style></style>

+ 525 - 0
jshERP-web/src/views/stock/modules/InventoryCheckModal.vue

@@ -0,0 +1,525 @@
+<template>
+  <j-modal
+    :title="title"
+    width="100%"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    :keyboard="false"
+    :forceRender="true"
+    v-bind:prefixNo="prefixNo"
+    fullscreen
+    switchFullscreen
+    @cancel="handleCancel"
+    :id="prefixNo"
+    style="top: 20px; height: 95%"
+  >
+    <template slot="footer" v-if="!approvalId">
+      <a-button @click="handleCancel">取消</a-button>
+      <a-button v-if="isShowBtn" @click="submit(9)" :loading="confirmLoading">保存并申请审核</a-button>
+      <a-button v-if="isShowBtn" @click="submit(0)" :loading="confirmLoading" type="primary">保存</a-button>
+    </template>
+    <template slot="footer" v-else>
+      <a-button v-if="!approvalIsReadonly" :loading="confirmLoading" @click="submitApproval(2)">审核不通过</a-button>
+      <a-button type="primary" v-if="!approvalIsReadonly" :loading="confirmLoading" @click="submitApproval(1)">审核通过</a-button>
+      <a-button key="back" v-if="approvalIsReadonly" @click="handleCancel">取消</a-button>
+    </template>
+    <a-spin :spinning="confirmLoading">
+      <a-form-model :model="model" ref="form" :rules="rules" :labelCol="labelCol" :wrapperCol="wrapperCol">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24" >
+            <a-form-model-item label="盘点单号" prop="number">
+              <a-input disabled placeholder="自动生成" v-model="model.number" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :xl="6" :lg="8" :md="12" :sm="24" >
+            <a-form-model-item label="盘点类型" prop="taskType">
+              <a-select
+                placeholder="请选择"
+                @change="handleChangeForm"
+                v-model="model.taskType"
+                :options="taskTypeList"
+                :disabled="isDisabled"
+              >
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :xl="6" :lg="8" :md="12" :sm="24" >
+            <a-form-model-item prop="taskName" label="盘点任务名称">
+              <a-input placeholder="请输入" :disabled="isDisabled" v-model="model.taskName" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :xl="6" :lg="8" :md="12" :sm="24" >
+            <a-form-model-item prop="depotId" label="盘点仓库">
+              <a-select
+                placeholder="请选择"
+                :options="deoptData"
+                v-model="model.depotId"
+                :disabled="isDisabled"
+                @change="handleChangeForm"
+              >
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :xl="6" :lg="8" :md="12" :sm="24" >
+            <a-form-model-item label="盘点负责人" prop="creator">
+              <a-select placeholder="请选择" v-model="model.creator" :options="spinnerList" :disabled="isDisabled">
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :xl="6" :lg="8" :md="12" :sm="24" >
+            <a-form-model-item label="创建人" prop="createByName">
+              <a-input placeholder="自动生成" v-model="model.createByName" disabled />
+            </a-form-model-item>
+          </a-col>
+          <a-col :xl="6" :lg="8" :md="12" :sm="24" >
+            <a-form-model-item label="创建时间" prop="createTime">
+              <a-input placeholder="自动生成" v-model="model.createTime" disabled />
+            </a-form-model-item>
+          </a-col>
+          <a-col :xl="6" :lg="8" :md="12" :sm="24" >
+            <a-form-model-item label="盘点库位范围" prop="positionRange">
+              <a-input placeholder="自动生成" v-model="model.positionRange" disabled />
+            </a-form-model-item>
+          </a-col>
+          <a-col :xl="6" :lg="8" :md="12" :sm="24" >
+            <a-form-model-item label="商品数量" prop="materialCount">
+              <a-input disabled placeholder="自动生成" v-model="model.materialCount" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :xl="6" :lg="8" :md="12" :sm="24" >
+            <a-form-model-item label="盘点状态" prop="taskStatus">
+              <a-select placeholder="自动生成" v-model="model.taskStatus" :options="taskStatusList" disabled>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+      <div>
+        <a-button v-if="model.taskType === 2&&action!='detail'" style="margin-bottom: 6px" type="primary" @click="onChangeGoods"
+          >选择商品</a-button
+        >
+        <a-table
+          v-if="dataSource.length"
+          ref="table"
+          size="middle"
+          bordered
+          rowKey="id"
+          :scroll="{ x: 'max-content'}"
+          :columns="columns"
+          :dataSource="dataSource"
+          :loading="loading"
+          :pagination="ipagination"
+          @change="handleTableChange"
+        >
+          <span v-if="isShowBtn" slot="action" slot-scope="text, record">
+            <a-popconfirm @confirm="handleDelete(record)" title="确定删除吗?">
+              <a v-if="model.taskType!=1">删除</a>
+            </a-popconfirm>
+          </span>
+        </a-table>
+      </div>
+      <!-- 审批历史 -->
+    <section v-if="approvalId">
+      <h4 class="block-title">审批历史</h4>
+      <a-table 
+        size="middle"
+        bordered
+        rowKey="id"
+        :pagination="false"
+        :loading="approval.loading"
+        :columns="approval.columns"
+        :rowClassName="rowClassName"
+        :dataSource="approval.dataSource"
+        :scroll="{ x: '100%' }"
+      ></a-table>
+      <a-textarea :rows="1" placeholder="审核备注" v-model="auditComment" v-if="!approvalIsReadonly" style="margin-top: 8px" />
+    </section>
+  </a-spin>
+  <j-select-material-modal
+    @ok="getGoods"
+    @all="findAllSelect"
+    ref="selectModal"
+    :multi="true"
+    :isStock="true"
+  ></j-select-material-modal> 
+  </j-modal>
+</template>
+
+<script>
+import JSelectMaterialModal from '@/components/jeecgbiz/modal/JSelectMaterialModal.vue'
+import { getAction, postAction } from '@/api/manage'
+import { mapGetters } from 'vuex'
+
+export default {
+  name: 'InventoryCheckModal',
+  components: { JSelectMaterialModal },
+  data() {
+    return {
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 9 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 15 },
+      },
+      visible: false,
+      spinnerList: [],
+      deoptData: [],
+      taskTypeList: [
+        { value: 1, label: '全盘' },
+        { value: 2, label: '抽盘' },
+      ],
+      taskStatusList: [
+        { value: 0, label: '未审核' },
+        { value: 1, label: '已审核' },
+        { value: 2, label: '进行中' },
+        { value: 3, label: '已完成' },
+        { value: 4, label: '已取消' },
+        { value: 5, label: '已更新' },
+        { value: 8, label: '审核未通过' },
+        { value: 9, label: '审核中' },
+      ],
+      confirmLoading: false,
+      prefixNo: 'PDRW',
+      loading: false,
+      dataSource: [],
+      columns: [
+        {
+          title: '操作',
+          dataIndex: 'action',
+          align: 'center',
+          width: 90,
+          scopedSlots: { customRender: 'action' },
+        },
+        { dataIndex: 'batchNumber', title: '批次号' },
+        { dataIndex: 'materialName', title: '商品名称', scopedSlots: { customRender: 'customName' } },
+        { dataIndex: 'categoryName', title: '类别' },
+        { dataIndex: 'standard', title: '规格' },
+        { dataIndex: 'model', title: '型号' },
+        { dataIndex: 'color', title: '颜色' },
+        { dataIndex: 'brand', title: '品牌' },
+        { dataIndex: 'supplierName', title: '供应商' },
+        { dataIndex: 'commodityUnit', title: '单位' },
+        { dataIndex: 'inventory', title: '库存' },
+        { dataIndex: 'productionDate', title: '生产日期' },
+        { dataIndex: 'expiryNum', title: '保质期' },
+        { dataIndex: 'sku', title: 'SKU' },
+        { dataIndex: 'depotName', title: '仓库名称' },
+        { dataIndex: 'position', title: '仓库货架' },
+      ],
+      ipagination: {
+        current: 1,
+        pageSize: 10,
+        pageSizeOptions: ['10', '20', '30', '50', '100'],
+        showTotal: (total, range) => {
+          return range[0] + '-' + range[1] + ' 共' + total + '条'
+        },
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0,
+      },
+      url: {
+        add: '/stocktaking/add',
+        update: '/stocktaking/detailUpdate',
+        spinnerList: '/stocktaking/creatorSpinnerList',
+        depotList: '/depot/findDepotByCurrentUser',
+      },
+      batchNumberStr: '',
+      action: '',
+      title: '',
+      rules: {
+        taskType: [{ required: true, message: '请选择盘点类型', trigger: 'change' }],
+        depotId: [{ required: true, message: '请选择盘点仓库',trigger: 'change' }],
+        taskName: [{ required: true, message: '请输入盘点任务名称', trigger: 'change' }],
+      },
+      model: {},
+
+      // 审批历史
+      approvalId: null, //审批id
+      approvalIsReadonly: false,
+      approval:{
+        loading:false,
+        columns:[
+          { title: '审核时间', dataIndex: 'auditTime' },
+          { title: '审核环节', dataIndex: 'nodeOrder',customRender(text,record,index){
+            if(index===0){
+              return text
+            }
+            return `审批节点${text}`
+          } },
+          { title: '审批人', dataIndex: 'auditorName' },
+          { title: '审核动作', dataIndex: 'auditResult',customRender(text,record,index){
+            if(index===0){
+              return text
+            }
+            if(text==1){
+              return '审批通过'
+            }else if(text==2){
+              return '审批不通过'
+            }
+            return ''
+          } },
+          { title: '备注', dataIndex: 'auditComment' },
+        ],
+        dataSource:[]
+      },
+      auditComment: ''
+    }
+  },
+  computed: {
+    isDisabled() {
+      switch (this.action) {
+        case 'detail':
+          return true
+        case 'add':
+          return false
+        case 'edit':
+          return this.model.taskStatus != 0&&this.model.taskStatus != 8
+        default:
+          return true
+      }
+    },
+    isShowBtn() {
+      switch (this.action) {
+        case 'detail':
+          return false
+        case 'add':
+          return true
+        case 'edit':
+          return this.model.taskStatus == 0 || this.model.taskStatus == 8
+        default:
+          return false
+      }
+    },
+    ...mapGetters(['username'])
+  },
+  methods: {
+    getSpinnerList() {
+      getAction(this.url.spinnerList).then((res) => {
+        this.spinnerList = res.data || []
+      })
+    },
+    getDepotList() {
+      getAction(this.url.depotList).then((res) => {
+        this.deoptData = res.data.map((item) => {
+          return {
+            label: item.depotName,
+            value: item.id,
+          }
+        })
+      })
+    },
+    handleOpen(number){
+      this.visible = true
+      if(number){
+        this.getDetail(number)
+      }
+      this.getSpinnerList()
+      this.getDepotList()
+    },
+    edit(number) {
+      this.action = 'edit'
+      this.handleOpen(number)
+    },
+    add(){
+      this.action = 'add'
+      this.$set(this.model,'taskStatus',0)
+      this.handleOpen()
+    },
+    lookDetail(number,approvalRow=null){
+      this.action = 'detail'
+      this.handleOpen(number)
+      //审批历史
+      if(approvalRow&&approvalRow.id){
+        this.approvalId = approvalRow.id
+        getAction('/audit/auditHistory',{id:approvalRow.id}).then(res => {
+          const list = res.data
+          list.unshift({
+            auditTime: approvalRow.submitTime,
+            nodeOrder: '开始',
+            auditorName: approvalRow.initiatorName,
+            auditResult: '提交审批',
+            auditComment: '',
+          })
+          this.approval.dataSource = list
+          console.log('approvalRow=====',approvalRow)
+        })
+      }
+    },
+    getDetail(number){
+      const url = '/stocktaking/detail/number/' + number
+      getAction(url).then((res) => {
+        this.model = res.data
+        this.getTableData(res.data.id)
+      })
+    },
+    getTableData(id){
+      const url2 = `/stocktaking/detailByItemList?currentPage=${this.ipagination.current}&pageSize=${this.ipagination.pageSize}`
+      postAction(url2, { taskStocktakingId: id }).then((res) => {
+        this.dataSource = res.data
+        this.ipagination.total = this.dataSource.length
+      })
+    },
+    close(){
+      this.visible = false
+      this.$refs.form.resetFields()
+      this.dataSource = []
+      this.action = ''
+      this.model = {}
+      this.ipagination.current = 1
+      this.$emit('close')
+      // 审批
+      this.approvalId = null
+      this.auditComment = ''
+      this.approval.dataSource = []
+      this.approvalIsReadonly = false
+    },
+    handleCancel() {
+      this.close()
+    },
+    // 提交盘点任务
+    submit(taskStatus) {
+      this.$refs.form.validate((flag, values) => {
+        console.log('flag===',flag)
+        if (flag) {
+          this.confirmLoading = true
+          const params = { ...this.model }
+          if (params.taskType === 2) {
+            params.materialExtendIdList = this.dataSource.map((item) => item.batchNumber)
+          }
+          params.taskStatus = taskStatus
+          const url = params.id ? this.url.update : this.url.add
+          postAction(url, params).then((res) => {
+            if (res.code === 200) {
+              this.$message.success('操作成功')
+              this.handleCancel()
+              this.$emit('ok')
+            } else {
+              this.$message.error(res.msg)
+            }
+          }).finally(() => {
+            this.confirmLoading = false
+          })
+        }
+      })
+    },
+    onChangeGoods() {
+      if(!this.model.depotId){
+        this.$message.warning('请选择仓库!')
+        return
+      }
+      this.$refs.selectModal.showModal()
+    },
+    getGoods(rows, ids) {
+      const str = ids
+        .split(',')
+        .filter((item) => item)
+        .join(',')
+      if(!this.model.depotId){
+        this.$message.warning('请选择仓库!')
+        return
+      }
+      getAction('/materialBatch/findBatchNumbersByBarCode',{
+        barCodes: str,
+        depotId:this.model.depotId
+      }).then((res) => {
+        const batchStr = res.data.split(',')
+        .filter((item) => item)
+        .join(',')
+        this.batchNumberStr = batchStr
+        this.getBatchData()
+      })
+    },
+    findAllSelect() {
+      if(!this.model.depotId){
+        this.$message.warning('请选择仓库!')
+        return
+      }
+      getAction('/materialBatch/findBatchNumbersByBarCode',{
+        depotId:this.model.depotId
+      }).then((res) => {
+        this.$refs.selectModal.close()
+        const batchStr = res.data.split(',')
+        .filter((item) => item)
+        .join(',')
+        this.batchNumberStr = batchStr
+        this.getBatchData()
+      })
+    },
+    getBatchData() {
+      const params = {
+        batchNumber: this.batchNumberStr,
+      }
+      getAction(`/material/getMaterialByBatchNumber?currentPage=${this.ipagination.current}&pageSize=${this.ipagination.pageSize}`, params).then((res) => {
+        this.dataSource = res.data.rows
+        if(this.dataSource.length===0){
+          this.$message.warning('暂无数据!')
+        }
+        this.ipagination.total = Number(res.data.total)
+        this.$set(this.model,'materialCount',Number(res.data.total))
+      })
+    },
+    //删除
+    handleDelete(record) {
+      this.dataSource = this.dataSource.filter((item) => item.batchNumber !== record.batchNumber)
+      this.ipagination.total -=1
+      this.$set(this.model,'materialCount',this.ipagination.total)
+    },
+
+    handleChangeForm(val) {
+      this.dataSource = []
+      this.ipagination.current = 1
+      this.ipagination.total = 0
+      this.$set(this.model,'materialCount',0)
+      console.log('this.model=====',this.model)
+      if (this.model.taskType === 1) {
+        this.findAllSelect()
+      }
+    },
+    handleTableChange(pagination) {
+      if (pagination && pagination.current) {
+        this.ipagination = pagination
+      }
+      if(this.action=='add'){
+        this.getBatchData()
+      }else{
+        this.getTableData(this.model.id)
+      }
+    },
+    rowClassName(record,index){
+      if(this.username===record.auditorName){
+        return 'red-row'
+      }
+      return ''
+    },
+    // 提交审核
+    submitApproval(status){
+      const params = {
+        id: this.approvalId,
+        status,
+        auditComment: this.auditComment
+      }
+      this.confirmLoading = true
+      postAction('/audit/setStatus',params).then(res => {
+        console.log(res)
+        if(res.code===200){
+          this.$message.success(res.msg)
+          this.handleCancel()
+          this.$emit('ok')
+        }else{
+          this.$message.error(res.data.message)
+        }
+      }).finally(() => {
+       this.confirmLoading = false
+      })
+    }
+  },
+}
+</script>
+
+<style scoped>
+::v-deep .red-row{
+  color: #f5222d;
+}
+</style>

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

@@ -3,54 +3,66 @@ const table = {
     {
       title: '操作',
       dataIndex: 'action',
+      align: 'center',
+      width: 100,
       scopedSlots: { customRender: 'action' },
     },
     {
       title: '盘点任务编号',
       dataIndex: 'number',
+      align: 'left',
     },
-
     {
       title: '盘点任务名称',
       dataIndex: 'taskName',
+      align: 'left',
     },
     {
       title: '盘点类型',
       dataIndex: 'taskType',
+      align: 'left',
       scopedSlots: { customRender: 'taskType' },
     },
     {
       title: '盘点仓库',
       dataIndex: 'depotName',
+      align: 'left',
     },
     {
       title: '商品数量',
       dataIndex: 'materialCount',
+      align: 'left',
     },
     {
       title: '盘点库位范围',
       dataIndex: 'positionRange',
+      align: 'left',
     },
     {
       title: '创建人',
       dataIndex: 'createByName',
+      align: 'left',
     },
     {
       title: '创建时间',
       dataIndex: 'createTime',
+      align: 'left',
     },
     {
       title: '盘点负责人',
       dataIndex: 'creatorName',
+      align: 'left',
     },
     {
       title: '盘点状态',
       dataIndex: 'taskStatus',
+      align: 'left',
       scopedSlots: { customRender: 'taskStatus' },
     },
     {
       title: '完成时间',
       dataIndex: 'operTime',
+      align: 'left',
     },
   ],
   goodsColums: [
@@ -61,9 +73,6 @@ const table = {
       width: 90,
       scopedSlots: { customRender: 'action' },
     },
-    { dataIndex: 'id', title: 'id' },
-
-    // { dataIndex: 'mBarCode', title: '条码', scopedSlots: { customRender: 'customBarCode' } },
     { dataIndex: 'batchNumber', title: '批次号' },
     { dataIndex: 'materialName', title: '商品名称', scopedSlots: { customRender: 'customName' } },
     { dataIndex: 'categoryName', title: '类别' },
@@ -73,23 +82,22 @@ const table = {
     { dataIndex: 'brand', title: '品牌' },
     { dataIndex: 'supplierName', title: '供应商' },
     { dataIndex: 'commodityUnit', title: '单位' },
-    { dataIndex: 'sku', title: '多属性' },
     { dataIndex: 'inventory', title: '库存', scopedSlots: { customRender: 'inventory' } },
     { dataIndex: 'productionDate', title: '生产日期' },
     { dataIndex: 'expiryNum', title: '保质期' },
-    { dataIndex: 'barCode', title: '商品条码' },
+    { dataIndex: 'sku', title: 'SKU' },
     { dataIndex: 'depotName', title: '仓库名称' },
     { dataIndex: 'position', title: '仓库货架' },
   ],
   checkGoodsColumns: [
     { dataIndex: 'categoryName', title: '商品类别' },
     { dataIndex: 'materialName', title: '商品名称' },
-    { dataIndex: 'systemSku', title: '系统SKU' },
+    { dataIndex: 'systemSpu', title: '系统SPU' },
     { dataIndex: 'batchNumber', title: '批次号' },
     { dataIndex: 'commodityUnit', title: '单位' },
     { dataIndex: 'productionDate', title: '生产日期' },
     { dataIndex: 'supplierName', title: '供应商' },
-    { dataIndex: 'barCode', title: '商品条码' },
+    { dataIndex: 'sku', title: 'SKU' },
     { dataIndex: 'inventory', title: '库存(最小单位)', scopedSlots: { customRender: 'inventory' } },
     { dataIndex: 'depotName', title: '仓库名称' },
     { dataIndex: 'position', title: '仓库货架' },

+ 1 - 1
jshERP-web/src/views/system/MsgList.vue

@@ -6,7 +6,7 @@
     :confirmLoading="confirmLoading"
     @cancel="handleCancel"
     cancelText="关闭"
-    style="top: 15%; height: 70%; overflow-y: hidden"
+    style="top: 10vh; height: 80vh; overflow-y: scroll"
   >
     <template slot="footer">
       <a-button key="back" @click="handleCancel"> 关闭 </a-button>

+ 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)

+ 0 - 1
jshERP-web/src/views/system/modules/VendorModal.vue

@@ -6,7 +6,6 @@
       :visible="visible"
       :confirmLoading="confirmLoading"
       :getContainer="() => $refs.container"
-      :maskStyle="{ top: '93px', left: '154px' }"
       :wrapClassName="wrapClassNameInfo()"
       :mask="isDesktop()"
       :maskClosable="false"

+ 73 - 34
jshERP-web/src/views/task/ApprovalList.vue

@@ -8,20 +8,19 @@
             <a-row :gutter="24">
               <a-col :md="6" :sm="24">
                 <a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
-                  <a-input placeholder="请输入单据编号" v-model="queryParam.loginName"></a-input>
+                  <a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="流程类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
-                  <a-select v-model="queryParam.processType" placeholder="请选择流程类型">
-                    <a-select-option value="0">全部</a-select-option>
-                    <a-select-option value="1">请假</a-select-option>
+                  <a-select v-model="queryParam.type" allowClear placeholder="请选择流程类型">
+                    <a-select-option v-for="item in flowTypes" :key="item.value" :value="item.value">{{item.label}}</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.loginName"></a-input>
+                  <a-input placeholder="请输入审核发起人" v-model="queryParam.initiatorName"></a-input>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -45,33 +44,47 @@
             :pagination="ipagination"
             :scroll="scroll"
             :loading="loading"
-            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
             @change="handleTableChange"
           >
             <span slot="action" slot-scope="text, record">
-              <a @click="">查看</a>
-              <a-divider type="vertical" />
-              <a-popconfirm
-                title="确定删除吗?"
-                @confirm="() => handleDelete(record.id)"
-              >
-                <a>删除</a>
-              </a-popconfirm>
+              <a @click="goApproval(record,true)">详情</a>
+              <a-divider v-if="btnEnableList.indexOf(2) > -1" type="vertical" />
+              <a @click="goApproval(record,false)" v-if="btnEnableList.indexOf(2) > -1" style="margin-left: 8px;">审批</a>
             </span>
+            <template slot="auditStatus" slot-scope="status">
+              <a-tag v-if="status == 0" color="blue">待审批</a-tag>
+              <a-tag v-if="status == 1" color="green">已通过</a-tag>
+              <a-tag v-if="status == 2" color="red">未通过</a-tag>
+            </template>
           </a-table>
         </div>
         <!-- table区域-end -->
       </a-card>
     </a-col>
+    <bill-detail ref="modalDetail" @ok="handleOk"></bill-detail>
+    <!-- 盘点任务审批 -->
+    <InventoryCheckModal ref="InventoryCheckModal" @ok="handleOk" />
+    <!-- pda维护商品 -->
+     <PdaFlowModal ref="PdaFlowModal" @ok="handleOk" />
   </a-row>
 </template>
 <script>
 import { postAction } from '@/api/manage'
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { approvalMixin } from './mixin/approvalMixin'
+import { flowTypes } from './utils/flow'
+import BillDetail from '@/views/bill/dialog/BillDetail.vue'
+import InventoryCheckModal from '@/views/stock/modules/InventoryCheckModal'
+import PdaFlowModal from './modules/PdaFlowModal.vue'
+
 export default {
   name: 'ApprovalList',
-  mixins: [JeecgListMixin],
-  components: {},
+  mixins: [JeecgListMixin,approvalMixin],
+  components: {
+    BillDetail,
+    InventoryCheckModal,
+    PdaFlowModal
+  },
   data() {
     return {
       labelCol: {
@@ -81,17 +94,11 @@ export default {
         span: 18,
         offset: 1,
       },
+      flowTypes,
       queryParam: {},
       depotFlag: '0',
       customerFlag: '0',
       columns: [
-        { title: '单据编号', dataIndex: 'number', width: 100, align: 'left' },
-        { title: '流程类型', dataIndex: 'username', width: 100, align: 'left' },
-        { title: '发起人', dataIndex: 'userType', width: 80, align: 'left' },
-        { title: '审核人', dataIndex: 'roleName', width: 100, align: 'left' },
-        { title: '创建时间', dataIndex: 'orgAbr', width: 100, align: 'left' },
-        { title: '审批时间', dataIndex: 'leaderFlagStr', width: 60, align: 'left' },
-        { title: '审批结果', dataIndex: 'phonenum', width: 80, align: 'left' },
         {
           title: '操作',
           dataIndex: 'action',
@@ -99,25 +106,57 @@ export default {
           align: 'center',
           width: 100,
         },
+        { title: '单据编号', dataIndex: 'number', align: 'left' },
+        { title: '流程类型', dataIndex: 'type', align: 'left' },
+        { title: '发起人', dataIndex: 'initiatorName', align: 'left' },
+        { title: '审核人', dataIndex: 'auditorName', align: 'left' },
+        { title: '创建时间', dataIndex: 'submitTime',width: 170, align: 'left'},
+        { title: '审批状态', dataIndex: 'auditStatus', align: 'left',scopedSlots: { customRender: 'auditStatus' }},
       ],
       url: {
-        list: '',
-        delete: '',
+        list: '/audit/pendingApprovalList',
       },
+      disableMixinCreated: true
     }
   },
-  created() {
+  beforeRouteEnter(to, from, next){
+    next(vm => {
+      vm.loadData()
+      //初始化按钮权限
+      vm.initActiveBtnStr()
+      // 更新数据
+      vm.$store.dispatch('updateApprovalStat')
+    })
   },
   methods: {
-    searchQuery() {
-      this.loadData(1)
-      this.getSystemConfig()
-    },
-    searchReset() {
-      this.queryParam = {}
-      this.loadData(1)
-      this.getSystemConfig()
+    loadData(arg) {
+      if (!this.url.list) {
+        this.$message.error('请设置url.list属性!')
+        return
+      }
+      //加载数据 若传入参数1则加载第一页的内容
+      if (arg === 1) {
+        this.ipagination.current = 1
+      }
+      this.loading = true
+      const url = this.url.list + '?currentPage=' + this.ipagination.current + '&pageSize=' + this.ipagination.pageSize
+      postAction(url, {
+        ...this.queryParam
+      }).then((res) => {
+        if (res.code === 200) {
+          this.dataSource = res.data.rows
+          this.ipagination.total = Number(res.data.total)
+        }else {
+          this.$message.warning(res.msg)
+        }
+        this.loading = false
+        this.onClearSelected()
+      })
     },
+    handleOk(){
+      this.$store.dispatch('updateApprovalStat')
+      this.loadData()
+    }
   },
 }
 </script>

+ 75 - 24
jshERP-web/src/views/task/FlowList.vue

@@ -8,9 +8,8 @@
             <a-row :gutter="24">
               <a-col :md="6" :sm="24">
                 <a-form-item label="流程类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
-                  <a-select v-model="queryParam.processType" placeholder="请选择流程类型">
-                    <a-select-option value="0">全部</a-select-option>
-                    <a-select-option value="1">请假</a-select-option>
+                  <a-select v-model="queryParam.type" allowClear placeholder="请选择流程类型">
+                    <a-select-option v-for="item in flowTypes" :key="item.value" :value="item.value">{{item.label}}</a-select-option>
                   </a-select>
                 </a-form-item>
               </a-col>
@@ -23,6 +22,11 @@
             </a-row>
           </a-form>
         </div>
+        <!-- 操作按钮区域 -->
+        <div class="table-operator" style="margin-top: 5px">
+          <a-button @click="handleAdd" type="primary" icon="plus" v-if="btnEnableList.indexOf(1) > -1">新增</a-button>
+          <a-button icon="delete" @click="batchDel" v-if="btnEnableList.indexOf(1) > -1">删除</a-button>
+        </div>
         <!-- table区域-begin -->
         <div>
           <a-table
@@ -38,14 +42,20 @@
             :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
             @change="handleTableChange"
           >
+            <span slot="auditNode1" slot-scope="text, record"> {{ getAuditNodeText(record,1) }} </span>
+            <span slot="auditNode2" slot-scope="text, record"> {{ getAuditNodeText(record,2) }} </span>
+            <span slot="auditNode3" slot-scope="text, record"> {{ getAuditNodeText(record,3) }} </span>
+            <span slot="auditNode4" slot-scope="text, record"> {{ getAuditNodeText(record,4) }} </span>
             <span slot="action" slot-scope="text, record">
-              <a @click="">查看</a>
-              <a-divider type="vertical" />
+              <a @click="showDetail(record)">详情</a>
+              <a-divider v-if="btnEnableList.indexOf(1) > -1" type="vertical" />
+              <a @click="handleEdit(record)" style="margin-left: 8px;" v-if="btnEnableList.indexOf(1) > -1">编辑</a>
+              <a-divider v-if="btnEnableList.indexOf(1) > -1" type="vertical" />
               <a-popconfirm
                 title="确定删除吗?"
                 @confirm="() => handleDelete(record.id)"
               >
-                <a>删除</a>
+                <a style="margin-left: 8px;" v-if="btnEnableList.indexOf(1) > -1">删除</a>
               </a-popconfirm>
             </span>
           </a-table>
@@ -53,15 +63,20 @@
         <!-- table区域-end -->
       </a-card>
     </a-col>
+    <FlowModal ref="modalForm" @ok="modalFormOk" />
   </a-row>
 </template>
 <script>
 import { postAction } from '@/api/manage'
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import FlowModal from './modules/FlowModal.vue'
+import { flowTypes,approvers } from './utils/flow'
 export default {
   name: 'FlowList',
   mixins: [JeecgListMixin],
-  components: {},
+  components: {
+    FlowModal
+  },
   data() {
     return {
       labelCol: {
@@ -71,16 +86,9 @@ export default {
         span: 18,
         offset: 1,
       },
+      flowTypes,
       queryParam: {},
-      depotFlag: '0',
-      customerFlag: '0',
       columns: [
-        { title: '流程类型', dataIndex: 'username', width: 100, align: 'left' },
-        { title: '流程节点1', dataIndex: 'userType', width: 80, align: 'left' },
-        { title: '流程节点2', dataIndex: 'roleName', width: 100, align: 'left' },
-        { title: '流程节点3', dataIndex: 'orgAbr', width: 100, align: 'left' },
-        { title: '流程节点4', dataIndex: 'leaderFlagStr', width: 60, align: 'left' },
-        { title: '备注', dataIndex: 'phonenum', width: 80, align: 'left' },
         {
           title: '操作',
           dataIndex: 'action',
@@ -88,24 +96,67 @@ export default {
           align: 'center',
           width: 100,
         },
+        { title: '流程类型', dataIndex: 'type', width: 100, align: 'left' },
+        { title: '流程节点1', dataIndex: 'auditNode1', width: 100, scopedSlots: { customRender: 'auditNode1' }, align: 'left' },
+        { title: '流程节点2', dataIndex: 'auditNode2', width: 100, scopedSlots: { customRender: 'auditNode2' }, align: 'left' },
+        { title: '流程节点3', dataIndex: 'auditNode3', width: 100, scopedSlots: { customRender: 'auditNode3' }, align: 'left' },
+        { title: '流程节点4', dataIndex: 'auditNode4', width: 100, scopedSlots: { customRender: 'auditNode4' }, align: 'left' },
+        { title: '备注', dataIndex: 'description', width: 100, align: 'left' },
       ],
+      approvers,
       url: {
-        list: '',
-        delete: '',
+        list: '/auditProcess/list',
+        delete: '/auditProcess/delete',
+        deleteBatch: '/auditProcess/deleteBatch'
       },
     }
   },
   created() {
   },
   methods: {
-    searchQuery() {
-      this.loadData(1)
-      this.getSystemConfig()
+    getAuditNodeText(record,step){
+      const obj = record.auditNodes[step-1]
+      if(obj){
+        if(obj.auditorType==2||obj.auditorType==3){
+          const target = this.approvers.find(item => item.value == obj.auditorType)
+          return target.label
+        }
+        return obj.auditorName
+      }
+      return ''
+    },
+    loadData(arg) {
+      if (!this.url.list) {
+        this.$message.error('请设置url.list属性!')
+        return
+      }
+      //加载数据 若传入参数1则加载第一页的内容
+      if (arg === 1) {
+        this.ipagination.current = 1
+      }
+      this.loading = true
+      const url = this.url.list + '?currentPage=' + this.ipagination.current + '&pageSize=' + this.ipagination.pageSize
+      postAction(url, {
+        ...this.queryParam
+      }).then((res) => {
+        if (res.code === 200) {
+          this.dataSource = res.data.rows
+          this.ipagination.total = Number(res.data.total)
+        }else {
+          this.$message.warning(res.msg)
+        }
+        this.loading = false
+        this.onClearSelected()
+      })
+    },
+    showDetail(record){
+      this.$refs.modalForm.show(record)
+    },
+    handleEdit(record){
+      this.$refs.modalForm.edit(record)
     },
-    searchReset() {
-      this.queryParam = {}
-      this.loadData(1)
-      this.getSystemConfig()
+    handleAdd: function () {
+      this.$refs.modalForm.add()
     },
   },
 }

+ 97 - 57
jshERP-web/src/views/task/HandledList.vue

@@ -8,48 +8,51 @@
             <a-row :gutter="24">
               <a-col :md="6" :sm="24">
                 <a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
-                  <a-input placeholder="请输入单据编号" v-model="queryParam.loginName"></a-input>
+                  <a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="流程类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
-                  <a-select v-model="queryParam.processType" placeholder="请选择流程类型">
-                    <a-select-option value="0">全部</a-select-option>
-                    <a-select-option value="1">请假</a-select-option>
+                  <a-select v-model="queryParam.type" allowClear placeholder="请选择流程类型">
+                    <a-select-option v-for="item in flowTypes" :key="item.value" :value="item.value">{{item.label}}</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-select v-model="queryParam.processType" placeholder="请选择状态">
-                    <a-select-option value="0">全部</a-select-option>
-                    <a-select-option value="1">请假</a-select-option>
-                    <a-select-option value="2">报销</a-select-option>
-                    <a-select-option value="3">采购</a-select-option>
+                  <a-select v-model="queryParam.auditStatus" allowClear placeholder="请选择状态">
+                    <a-select-option :value="1" :key="1">审批完成</a-select-option>
+                    <a-select-option :value="2" :key="2">审批未通过</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-range-picker
-                    style="width: 100%"
-                    v-model="queryParam.createTimeRange"
-                    format="YYYY-MM-DD"
-                    :placeholder="['开始时间', '结束时间']"
-                  />
-                </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.loginName"></a-input>
-                </a-form-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
                 <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
                   <a-button type="primary" @click="searchQuery">查询</a-button>
                   <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
+                  <a @click="handleToggleSearch" style="margin-left: 8px">
+                    {{ toggleSearchStatus ? '收起' : '展开' }}
+                    <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
+                  </a>
                 </span>
               </a-col>
+              <template v-if="toggleSearchStatus">
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="审核时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                    <a-range-picker
+                      style="width: 100%"
+                      v-model="queryParam.auditTimeRange"
+                      format="YYYY-MM-DD"
+                      :placeholder="['开始时间', '结束时间']"
+                    />
+                  </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.initiatorName"></a-input>
+                  </a-form-item>
+                </a-col>
+              </template>
             </a-row>
           </a-form>
         </div>
@@ -65,78 +68,115 @@
             :pagination="ipagination"
             :scroll="scroll"
             :loading="loading"
-            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
             @change="handleTableChange"
           >
             <span slot="action" slot-scope="text, record">
-              <a @click="">查看</a>
-              <a-divider type="vertical" />
-              <a-popconfirm
-                title="确定删除吗?"
-                @confirm="() => handleDelete(record.id)"
-              >
-                <a>删除</a>
-              </a-popconfirm>
+              <a @click="goApproval(record,true)">详情</a>
             </span>
+            <template slot="auditStatus" slot-scope="status">
+              <a-tag v-if="status == 0" color="blue">审批中</a-tag>
+              <a-tag v-if="status == 1" color="green">审批完成</a-tag>
+              <a-tag v-if="status == 2" color="red">审批未通过</a-tag>
+            </template>
           </a-table>
         </div>
         <!-- table区域-end -->
       </a-card>
     </a-col>
+    <bill-detail ref="modalDetail" @ok="modalFormOk" @close="modalFormClose"></bill-detail>
+    <!-- 盘点任务审批 -->
+    <InventoryCheckModal ref="InventoryCheckModal" @ok="modalFormOk" />
+    <!-- pda维护商品 -->
+    <PdaFlowModal ref="PdaFlowModal" @ok="modalFormOk" />
   </a-row>
 </template>
 <script>
 import { postAction } from '@/api/manage'
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { approvalMixin } from './mixin/approvalMixin'
+import { flowTypes } from './utils/flow'
+import BillDetail from '@/views/bill/dialog/BillDetail.vue'
+import InventoryCheckModal from '@/views/stock/modules/InventoryCheckModal'
+import { cloneDeep } from 'lodash'
+import moment from 'moment'
+import PdaFlowModal from './modules/PdaFlowModal.vue'
+
 export default {
   name: 'HandledList',
-  mixins: [JeecgListMixin],
-  components: {},
+  mixins: [JeecgListMixin,approvalMixin],
+  components: {
+    BillDetail,
+    InventoryCheckModal,
+    PdaFlowModal
+  },
   data() {
     return {
       labelCol: {
-        span: 5,
+        span: 4,
       },
       wrapperCol: {
-        span: 18,
-        offset: 1,
+        span: 20,
       },
+      flowTypes,
       queryParam: {},
       depotFlag: '0',
       customerFlag: '0',
       columns: [
-        { title: '单据编号', dataIndex: 'number', width: 100, align: 'left' },
-        { title: '流程类型', dataIndex: 'username', width: 100, align: 'left' },
-        { title: '发起人', dataIndex: 'userType', width: 80, align: 'left' },
-        { title: '审核人', dataIndex: 'roleName', width: 100, align: 'left' },
-        { title: '创建时间', dataIndex: 'orgAbr', width: 100, align: 'left' },
-        { title: '审批时间', dataIndex: 'leaderFlagStr', width: 60, align: 'left' },
-        { title: '审批结果', dataIndex: 'phonenum', width: 80, align: 'left' },
         {
           title: '操作',
           dataIndex: 'action',
           scopedSlots: { customRender: 'action' },
           align: 'center',
-          width: 100,
+          width: 70,
         },
+        { title: '单据编号', dataIndex: 'number', align: 'left' },
+        { title: '流程类型', dataIndex: 'type', align: 'left' },
+        { title: '发起人', dataIndex: 'initiatorName', align: 'left' },
+        { title: '审核人', dataIndex: 'auditorName', align: 'left' },
+        { title: '创建时间', dataIndex: 'submitTime',width: 170, align: 'left' },
+        { title: '审批时间', dataIndex: 'auditTime', width: 170, align: 'left' },
+        { title: '审批结果', dataIndex: 'auditStatus', align: 'left',scopedSlots: { customRender: 'auditStatus' }},
       ],
       url: {
-        list: '',
-        delete: '',
+        list: '/audit/processedApprovalList',
       },
+      disableMixinCreated: true
     }
   },
-  created() {
+  beforeRouteEnter(to, from, next){
+    next(vm => {
+      vm.loadData()
+      //初始化按钮权限
+      vm.initActiveBtnStr()
+    })
   },
   methods: {
-    searchQuery() {
-      this.loadData(1)
-      this.getSystemConfig()
-    },
-    searchReset() {
-      this.queryParam = {}
-      this.loadData(1)
-      this.getSystemConfig()
+    loadData(arg) {
+      if (!this.url.list) {
+        this.$message.error('请设置url.list属性!')
+        return
+      }
+      //加载数据 若传入参数1则加载第一页的内容
+      if (arg === 1) {
+        this.ipagination.current = 1
+      }
+      this.loading = true
+      const url = this.url.list + '?currentPage=' + this.ipagination.current + '&pageSize=' + this.ipagination.pageSize
+      const params = cloneDeep(this.queryParam)
+      const {auditTimeRange=[]} = params
+      params.beginTime = auditTimeRange[0]?moment(auditTimeRange[0]).format('YYYY-MM-DD'):''
+      params.endTime = auditTimeRange[1]?moment(auditTimeRange[1]).format('YYYY-MM-DD'):''
+      delete params.auditTimeRange
+      postAction(url, params).then((res) => {
+        if (res.code === 200) {
+          this.dataSource = res.data.rows
+          this.ipagination.total = Number(res.data.total)
+        }else {
+          this.$message.warning(res.msg)
+        }
+        this.loading = false
+        this.onClearSelected()
+      })
     },
   },
 }

+ 168 - 50
jshERP-web/src/views/task/InitiateList.vue

@@ -8,43 +8,47 @@
             <a-row :gutter="24">
               <a-col :md="6" :sm="24">
                 <a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
-                  <a-input placeholder="请输入单据编号" v-model="queryParam.loginName"></a-input>
+                  <a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="流程类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
-                  <a-select v-model="queryParam.processType" placeholder="请选择流程类型">
-                    <a-select-option value="0">全部</a-select-option>
-                    <a-select-option value="1">请假</a-select-option>
+                  <a-select v-model="queryParam.type" allowClear placeholder="请选择流程类型">
+                    <a-select-option v-for="item in flowTypes" :key="item.value" :value="item.value">{{item.label}}</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-select v-model="queryParam.processType" placeholder="请选择状态">
-                    <a-select-option value="0">全部</a-select-option>
-                    <a-select-option value="1">请假</a-select-option>
-                    <a-select-option value="2">报销</a-select-option>
-                    <a-select-option value="3">采购</a-select-option>
+                  <a-select v-model="queryParam.auditStatus" allowClear placeholder="请选择状态">
+                    <a-select-option :value="0">审批中</a-select-option>
+                    <a-select-option :value="1">审批完成</a-select-option>
+                    <a-select-option :value="2">审批未通过</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-range-picker
-                    style="width: 100%"
-                    v-model="queryParam.createTimeRange"
-                    format="YYYY-MM-DD"
-                    :placeholder="['开始时间', '结束时间']"
-                  />
-                </a-form-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
                 <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
                   <a-button type="primary" @click="searchQuery">查询</a-button>
                   <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
+                  <a @click="handleToggleSearch" style="margin-left: 8px">
+                    {{ toggleSearchStatus ? '收起' : '展开' }}
+                    <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
+                  </a>
                 </span>
               </a-col>
+              <template v-if="toggleSearchStatus">
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="创建时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                    <a-range-picker
+                      style="width: 100%"
+                      v-model="queryParam.auditTimeRange"
+                      format="YYYY-MM-DD"
+                      :placeholder="['开始时间', '结束时间']"
+                    />
+                  </a-form-item>
+                </a-col>
+              </template>
             </a-row>
           </a-form>
         </div>
@@ -60,53 +64,84 @@
             :pagination="ipagination"
             :scroll="scroll"
             :loading="loading"
-            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
             @change="handleTableChange"
           >
             <span slot="action" slot-scope="text, record">
-              <a @click="">查看</a>
-              <a-divider type="vertical" />
-              <a-popconfirm
-                title="确定删除吗?"
-                @confirm="() => handleDelete(record.id)"
-              >
-                <a>删除</a>
-              </a-popconfirm>
+              <a @click="goApproval(record,true)">详情</a>
+              <a-divider v-if="btnEnableList.indexOf(1) > -1" type="vertical" />
+              <a @click="myHandleEdit(record)" v-if="btnEnableList.indexOf(1) > -1" style="margin-left: 8px;">编辑</a>
             </span>
+            <template slot="auditStatus" slot-scope="status">
+              <a-tag v-if="status == 0" color="blue">审批中</a-tag>
+              <a-tag v-if="status == 1" color="green">审批完成</a-tag>
+              <a-tag v-if="status == 2" color="red">审批未通过</a-tag>
+            </template>
           </a-table>
         </div>
         <!-- table区域-end -->
       </a-card>
     </a-col>
+    <!-- 审核详情 -->
+    <bill-detail ref="modalDetail" @ok="modalFormOk" ></bill-detail>
+    <!-- 订单未通过审核重新编辑 -->
+    <OtherInModal ref="OtherInModal" @ok="modalFormOk" />
+    <OtherOutModal ref="OtherOutModal" @ok="modalFormOk" />
+    <PurchaseInModal ref="PurchaseInModal" @ok="modalFormOk" />
+    <PurchaseOrderModal ref="PurchaseOrderModal" @ok="modalFormOk" />
+    <SaleOrderModal ref="SaleOrderModal" @ok="modalFormOk" />
+    <SaleOutModal ref="SaleOutModal" @ok="modalFormOk" />
+    <!-- 盘点未通过重新编辑 -->
+    <InventoryCheckModal ref="InventoryCheckModal" @ok="modalFormOk" />
+    <!-- pda维护商品 -->
+    <PdaFlowModal ref="PdaFlowModal" @ok="modalFormOk" />
   </a-row>
 </template>
 <script>
 import { postAction } from '@/api/manage'
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { approvalMixin } from './mixin/approvalMixin'
+import { flowTypes } from './utils/flow'
+import BillDetail from '@/views/bill/dialog/BillDetail.vue'
+import moment from 'moment'
+import { cloneDeep } from 'lodash'
+import OtherInModal from '@/views/bill/modules/OtherInModal'
+import OtherOutModal from '@/views/bill/modules/OtherOutModal'
+import PurchaseInModal from '@/views/bill/modules/PurchaseInModal'
+import PurchaseOrderModal from '@/views/bill/modules/PurchaseOrderModal'
+import SaleOrderModal from '@/views/bill/modules/SaleOrderModal'
+import SaleOutModal from '@/views/bill/modules/SaleOutModal'
+import InventoryCheckModal from '@/views/stock/modules/InventoryCheckModal'
+import PdaFlowModal from './modules/PdaFlowModal.vue'
+import {
+  findBillDetailByNumber,
+} from '@/api/api'
 export default {
   name: 'InitiateList',
-  mixins: [JeecgListMixin],
-  components: {},
+  mixins: [JeecgListMixin,approvalMixin],
+  components: {
+    BillDetail,
+    OtherInModal,
+    OtherOutModal,
+    PurchaseInModal,
+    PurchaseOrderModal,
+    SaleOrderModal,
+    SaleOutModal,
+    InventoryCheckModal,
+    PdaFlowModal
+  },
   data() {
     return {
       labelCol: {
-        span: 5,
+        span: 4,
       },
       wrapperCol: {
-        span: 18,
-        offset: 1,
+        span: 20,
       },
+      flowTypes,
       queryParam: {},
       depotFlag: '0',
       customerFlag: '0',
       columns: [
-        { title: '单据编号', dataIndex: 'number', width: 100, align: 'left' },
-        { title: '流程类型', dataIndex: 'username', width: 100, align: 'left' },
-        { title: '发起人', dataIndex: 'userType', width: 80, align: 'left' },
-        { title: '审核人', dataIndex: 'roleName', width: 100, align: 'left' },
-        { title: '创建时间', dataIndex: 'orgAbr', width: 100, align: 'left' },
-        { title: '审批时间', dataIndex: 'leaderFlagStr', width: 60, align: 'left' },
-        { title: '审批结果', dataIndex: 'phonenum', width: 80, align: 'left' },
         {
           title: '操作',
           dataIndex: 'action',
@@ -114,24 +149,107 @@ export default {
           align: 'center',
           width: 100,
         },
+        { title: '单据编号', dataIndex: 'number', align: 'left' },
+        { title: '流程类型', dataIndex: 'type', align: 'left' },
+        { title: '发起人', dataIndex: 'initiatorName', align: 'left' },
+        { title: '当前审核人', dataIndex: 'auditorName', align: 'left' },
+        { title: '创建时间', dataIndex: 'submitTime', width: 170, align: 'left' },
+        { title: '状态', dataIndex: 'auditStatus', align: 'left',scopedSlots: { customRender: 'auditStatus' } },
       ],
       url: {
-        list: '',
-        delete: '',
+        list: '/audit/myApprovalList',
       },
+      disableMixinCreated: true
     }
   },
-  created() {
+  beforeRouteEnter(to, from, next){
+    next(vm => {
+      vm.loadData()
+      //初始化按钮权限
+      vm.initActiveBtnStr()
+    })
   },
   methods: {
-    searchQuery() {
-      this.loadData(1)
-      this.getSystemConfig()
+    loadData(arg) {
+      if (!this.url.list) {
+        this.$message.error('请设置url.list属性!')
+        return
+      }
+      //加载数据 若传入参数1则加载第一页的内容
+      if (arg === 1) {
+        this.ipagination.current = 1
+      }
+      this.loading = true
+      const url = this.url.list + '?currentPage=' + this.ipagination.current + '&pageSize=' + this.ipagination.pageSize
+      const params = cloneDeep(this.queryParam)
+      const {auditTimeRange=[]} = params
+      params.beginTime = auditTimeRange[0]?moment(auditTimeRange[0]).format('YYYY-MM-DD'):''
+      params.endTime = auditTimeRange[1]?moment(auditTimeRange[1]).format('YYYY-MM-DD'):''
+      delete params.auditTimeRange
+      postAction(url, params).then((res) => {
+        if (res.code === 200) {
+          this.dataSource = res.data.rows
+          this.ipagination.total = Number(res.data.total)
+        }else {
+          this.$message.warning(res.msg)
+        }
+        this.loading = false
+        this.onClearSelected()
+      })
+    },
+    myHandleEdit(record) {
+      if(record.auditStatus!=2){
+        this.$message.warning('抱歉,只有审批未通过的单据才能编辑!')
+        return
+      }
+      let modalRefName = ''
+      switch (record.type) {
+        case '销售订单':
+          modalRefName = 'SaleOrderModal'
+          break;
+        case '销售出库':
+          modalRefName = 'SaleOutModal'
+          break;
+        case '其它入库':
+          modalRefName = 'OtherInModal'
+          break;
+        case '其它出库':
+          modalRefName = 'OtherOutModal'
+          break;
+        case '采购订单':
+          modalRefName = 'PurchaseOrderModal'
+          break;
+        case '采购入库':
+          modalRefName = 'PurchaseInModal'
+          break;
+        case '盘点任务':
+          this.$refs.InventoryCheckModal.edit(record.number)
+          this.$refs.InventoryCheckModal.title = '编辑盘点任务'
+          break;
+        case 'pda维护商品':
+          this.$message.warning('请重新去pda申请!')
+          break;
+      
+        default:
+          break;
+      }
+      if(!modalRefName){
+        return
+      }
+      this.$refs[modalRefName].action = 'edit'
+      //查询单条单据信息
+      findBillDetailByNumber({ number: record.number }).then((res) => {
+        if (res && res.code === 200) {
+          let item = res.data
+          this.handleEdit(item,modalRefName)
+        }
+      })
     },
-    searchReset() {
-      this.queryParam = {}
-      this.loadData(1)
-      this.getSystemConfig()
+    // 订单弹框编辑
+    handleEdit(record,modalRefName) {
+      this.$refs[modalRefName].edit(record)
+      this.$refs[modalRefName].title = '编辑'
+      this.$refs[modalRefName].disableSubmit = false
     },
   },
 }

+ 46 - 0
jshERP-web/src/views/task/mixin/approvalMixin.js

@@ -0,0 +1,46 @@
+
+export const approvalMixin = {
+  methods:{
+    goApproval(record,approvalIsReadonly){
+      console.log('record===',record)
+      const target = this.flowTypes.find(item => item.value===record.type)
+      switch (record.type) {
+        case '销售订单':
+        case '销售出库':
+        case '其它入库':
+        case '其它出库':
+        case '采购订单':
+        case '采购入库':
+          this.$refs.modalDetail.show({number: record.number}, record.type, target.prefixNo, record)
+          this.$refs.modalDetail.approvalIsReadonly = approvalIsReadonly
+          if(approvalIsReadonly){
+            this.$refs.modalDetail.title = record.type + '-审核详情'
+          }else{
+            this.$refs.modalDetail.title = record.type + '-去审核'
+          }
+          break;
+        case '盘点任务':
+          this.$refs.InventoryCheckModal.lookDetail(record.number,record)
+          this.$refs.InventoryCheckModal.approvalIsReadonly = approvalIsReadonly
+          if(approvalIsReadonly){
+            this.$refs.InventoryCheckModal.title = record.type + '-审核详情'
+          }else{
+            this.$refs.InventoryCheckModal.title = record.type + '-去审核'
+          }
+          break
+        case 'pda维护商品':
+          this.$refs.PdaFlowModal.lookDetail(record.number,record)
+          this.$refs.PdaFlowModal.approvalIsReadonly = approvalIsReadonly
+          if(approvalIsReadonly){
+            this.$refs.PdaFlowModal.title = record.type + '-审核详情'
+          }else{
+            this.$refs.PdaFlowModal.title = record.type + '-去审核'
+          }
+          break
+        default:
+          break;
+      }
+
+    },
+  }
+}

+ 296 - 0
jshERP-web/src/views/task/modules/FlowModal.vue

@@ -0,0 +1,296 @@
+<template>
+  <div ref="container">
+    <a-modal
+      :title="title"
+      width="100%"
+      :visible="visible"
+      :confirmLoading="confirmLoading"
+      :getContainer="() => $refs.container"
+      :wrapClassName="wrapClassNameInfo()"
+      :mask="isDesktop()"
+      :maskClosable="false"
+      @ok="handleOk"
+      @cancel="handleCancel"
+      cancelText="取消"
+      okText="保存"
+      style="top: 0; height: 100%"
+    >
+      <template slot="footer">
+        <a-button key="back" v-if="isReadOnly" @click="handleCancel"> 取消 </a-button>
+      </template>
+      <a-spin :spinning="confirmLoading">
+        <a-form-model :model="model" ref="form" id="FlowModal" :rules="rules">
+          <a-row class="form-row" :gutter="24" type="flex">
+            <a-col :span="24 / 2">
+              <a-form-model-item label="流程类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type">
+                <a-select v-model="model.type" allowClear placeholder="请选择流程类型" style="width: 100%;" :disabled="isReadOnly">
+                  <a-select-option v-for="item in flowTypes" :key="item.value" :value="item.value">{{item.label}}</a-select-option>
+                </a-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="24 / 2">
+              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="流程备注" prop="description">
+                <a-input placeholder="请输入" v-model="model.description" :disabled="isReadOnly" />
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-row class="form-row" :gutter="24" type="flex" v-for="(item,index) in model.auditNodes" :key="index">
+            <a-col :span="24 / 2">
+              <a-form-model-item :label="`流程节点${index+1}`" :labelCol="labelCol" :wrapperCol="wrapperCol" :prop="`auditNodes[${index}].auditorType`" :rules="{
+                required: index===0,
+                trigger: 'change',
+                validator: (rule, value, callback) => validatorAuditorType(rule, value, callback, index)
+              }">
+                <a-select v-model="item.auditorType" allowClear placeholder="请选择" style="width: 100%;" :disabled="isReadOnly" @change="changeAuditorType($event,index)">
+                  <a-select-option v-for="item in approvers" :disabled="item.disabled" :key="item.value" :value="item.value">{{item.label}}</a-select-option>
+                </a-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="24 / 2">
+              <a-form-model-item :label="`审核人${index+1}`" :labelCol="labelCol" :wrapperCol="wrapperCol" :prop="`auditNodes[${index}].auditor`" :rules="item.auditorType===1?{
+                required: true,
+                message: '请选择',
+                trigger: 'change',
+              }:{}">
+                <a-select v-model="item.auditor" @change="changeAuditor($event,index)" allowClear placeholder="请选择" :disabled="item.auditorType==2||item.auditorType==3||isReadOnly" style="width: 100%;">
+                  <a-select-option v-for="(item, index) in _userList" :disabled="item.disabled" :key="index" :value="item.id">
+                    {{ item.userName }}
+                  </a-select-option>
+                </a-select>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </a-spin>
+    </a-modal>
+  </div>
+</template>
+<script>
+import { cloneDeep } from 'lodash'
+import {
+  getUserList,
+} from '@/api/api'
+import { postAction } from '@/api/manage'
+import { autoJumpNextInput } from '@/utils/util'
+import { mixinDevice } from '@/utils/mixin'
+import { flowTypes } from '../utils/flow'
+export default {
+  name: 'FlowModal',
+  mixins: [mixinDevice],
+  data() {
+    return {
+      model: {
+        type: undefined,
+        description: '',
+        auditNodes: [
+          {
+            auditorType: undefined,
+            auditor: undefined,
+            nodeOrder: 1
+          },
+          {
+            auditorType: undefined,
+            auditor: undefined,
+            nodeOrder: 2
+          },
+          {
+            auditorType: undefined,
+            auditor: undefined,
+            nodeOrder: 3
+          },
+          {
+            auditorType: undefined,
+            auditor: undefined,
+            nodeOrder: 4
+          },
+        ],
+      },
+      userList: [],
+      title: '',
+      visible: false,
+      
+      flowTypes,
+      isReadOnly: false,
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 6 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 18 },
+      },
+      confirmLoading: false,
+      rules: {
+        type: [
+          {required:true, message: '请选择流程类型', trigger: 'change'}
+        ]
+      },
+      url:{
+        add: '/auditProcess/add',
+        update: '/auditProcess/detailUpdate',
+      }
+    }
+  },
+  computed: {
+    approvers(){
+      const auditNodeTypes = this.model.auditNodes.filter(item => (item.auditorType==2||item.auditorType==3)).map(item => item.auditorType)
+      return [
+        {
+          label: '部门最高领导审核',
+          value: 3,
+          disabled: auditNodeTypes.includes(3)
+        },
+        {
+          label: '上级部门最高领导审核',
+          value: 2,
+          disabled: auditNodeTypes.includes(2)
+        },
+        {
+          label: '指定用户',
+          value: 1,
+          disabled: false
+        },
+      ]
+    },
+    _userList(){
+      const auditorList = this.model.auditNodes.filter(item => (item.auditorType==1)).map(item => item.auditor)
+      return this.userList.map(item => {
+        return {
+          ...item,
+          disabled: auditorList.includes(item.id)
+        }
+      })
+    }
+  },
+  created() {
+    this.initUser()
+  },
+  methods: {
+    initUser() {
+      getUserList({}).then((res) => {
+        if (res) {
+          this.userList = res
+        }
+      })
+    },
+    resetModal(){
+      this.model = {
+        type: undefined,
+        description: '',
+        auditNodes: [
+          {
+            auditorType: undefined,
+            auditor: undefined,
+            nodeOrder: 1
+          },
+          {
+            auditorType: undefined,
+            auditor: undefined,
+            nodeOrder: 2
+          },
+          {
+            auditorType: undefined,
+            auditor: undefined,
+            nodeOrder: 3
+          },
+          {
+            auditorType: undefined,
+            auditor: undefined,
+            nodeOrder: 4
+          },
+        ]
+      }
+    },
+    show(record){
+      this.title = '详情'
+      this.visible = true
+      this.isReadOnly = true
+      this.model = cloneDeep(record)
+    },
+    add() {
+      this.title = '新增'
+      this.edit({})
+    },
+
+    edit(record) {
+      this.isReadOnly = false
+      this.title = '编辑'
+      this.visible = true
+      if(record.id){
+        this.model = cloneDeep(record)
+      }
+      this.$nextTick(() => {
+        autoJumpNextInput('FlowModal')
+      })
+    },
+    close() {
+      this.$emit('close')
+      this.$refs.form.resetFields()
+      this.visible = false
+      this.$nextTick(() => {
+        this.resetModal()
+      })
+    },
+     changeAuditorType(v,index){
+      // this.$refs.form.clearValidate([`auditNodes[${index}].auditor`])
+      this.model.auditNodes[index].auditor = undefined
+      this.$forceUpdate()
+      this.$nextTick(() => {
+        this.$refs.form.validate()
+      })
+    },
+    changeAuditor(val,index){
+      this.$refs.form.clearValidate([`auditNodes[${index}].auditor`])
+      this.$forceUpdate()
+    },
+    validatorAuditorType(rule, value, callback, index){
+      if(index === 0){
+        if(!value){
+          return callback(new Error(`请选择流程节点1`))
+        }
+        callback()
+      }else{
+        const nextArr = this.model.auditNodes.slice(index)
+        const arr = nextArr.filter(item => item.auditorType)
+        if(arr.length>0&&!value){
+          return callback(new Error(`中间流程节点不能为空!`))
+        }
+        callback()
+      }
+    },
+    handleOk() {
+      const that = this
+      // 触发表单验证
+      this.$refs.form.validate((flag, values) => {
+        if (flag) {
+          that.confirmLoading = true
+          let formData = Object.assign({}, this.model)
+          let obj
+          if (!this.model.id) {
+            obj = postAction(this.url.add,formData)
+          } else {
+            obj = postAction(this.url.update,formData)
+          }
+          obj
+            .then((res) => {
+              if (res.code === 200) {
+                that.$emit('ok')
+                that.close()
+              } else {
+                that.$message.warning(res.msg)
+              }
+            })
+            .finally(() => {
+              that.confirmLoading = false
+            })
+        }
+      })
+    },
+    handleCancel() {
+      this.close()
+    },
+  },
+}
+</script>
+<style scoped>
+</style>

+ 310 - 0
jshERP-web/src/views/task/modules/PdaFlowModal.vue

@@ -0,0 +1,310 @@
+<template>
+  <j-modal
+    :title="title"
+    width="100%"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    :keyboard="false"
+    :forceRender="true"
+    v-bind:prefixNo="prefixNo"
+    fullscreen
+    switchFullscreen
+    @cancel="handleCancel"
+    :id="prefixNo"
+    style="top: 20px; height: 95%"
+  >
+    <template slot="footer">
+      <a-button v-if="!approvalIsReadonly" :loading="confirmLoading" @click="submitApproval(2)">审核不通过</a-button>
+      <a-button type="primary" v-if="!approvalIsReadonly" :loading="confirmLoading" @click="submitApproval(1)">审核通过</a-button>
+      <a-button key="back" v-if="approvalIsReadonly" @click="handleCancel">取消</a-button>
+    </template>
+    <a-spin :spinning="confirmLoading">
+      <a-form-model :model="model" ref="form" :rules="rules" :labelCol="labelCol" :wrapperCol="wrapperCol">
+        <a-row class="form-row" :gutter="24" type="flex">
+          <a-col :xl="6" :lg="8" :md="12" :sm="24" >
+            <a-form-model-item label="货物条码" prop="number">
+              <a-input disabled placeholder="自动生成" v-model="model.number" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :xl="6" :lg="8" :md="12" :sm="24" >
+            <a-form-model-item label="货物名称" prop="name">
+              <a-input disabled placeholder="自动生成" v-model="model.name" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :xl="6" :lg="8" :md="12" :sm="24" >
+            <a-form-model-item label="规格" prop="standard" >
+              <a-input placeholder="请输入" disabled v-model="model.standard" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :xl="6" :lg="8" :md="12" :sm="24" >
+            <a-form-model-item label="库位" prop="position">
+              <a-input placeholder="请输入" disabled v-model="model.position" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :xl="6" :lg="8" :md="12" :sm="24" >
+            <a-form-model-item label="单位" prop="commodityUnit">
+              <a-select placeholder="请选择" :disabled="approvalIsReadonly&&nodeOrder==1" style="width: 150px" v-model="model.commodityUnit" :options="unitList"></a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :xl="6" :lg="8" :md="12" :sm="24" >
+            <a-form-model-item label="类别" prop="categoryId">
+              <a-tree-select
+                v-model="model.categoryId"
+                :disabled="approvalIsReadonly&&nodeOrder==1"
+                style="width: 100%"
+                :dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }"
+                allow-clear
+                :treeData="categoryTree"
+                placeholder="请选择类别"
+              >
+              </a-tree-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :xl="6" :lg="8" :md="12" :sm="24" >
+            <a-form-model-item label="默认采购价" prop="defaultPurchaseDecimal">
+              <a-input placeholder="请输入" :disabled="approvalIsReadonly&&nodeOrder==1" v-model="model.defaultPurchaseDecimal" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :xl="6" :lg="8" :md="12" :sm="24" >
+            <a-form-model-item label="默认销售价" prop="defaultWholesaleDecimal">
+              <a-input placeholder="请输入" :disabled="approvalIsReadonly&&nodeOrder==1" v-model="model.defaultWholesaleDecimal" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :xl="6" :lg="8" :md="12" :sm="24">
+            <a-form-model-item
+              label="图片"
+            >
+              <img v-for="(url,i) in fileList" :key="i" :src="url" alt="" style="margin: 0 10px 10px 0;display: inline-block;width: 100px;height: 100px;"  />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+        <!-- 审批历史 -->
+      <section v-if="approvalId">
+        <h4 class="block-title">审批历史</h4>
+        <a-table 
+          size="middle"
+          bordered
+          rowKey="id"
+          :pagination="false"
+          :loading="approval.loading"
+          :columns="approval.columns"
+          :rowClassName="rowClassName"
+          :dataSource="approval.dataSource"
+          :scroll="{ x: '100%' }"
+        ></a-table>
+        <a-textarea :rows="1" placeholder="审核备注" v-model="auditComment" v-if="!approvalIsReadonly" style="margin-top: 8px" />
+      </section>
+    </a-spin>
+  </j-modal>
+</template>
+
+<script>
+import {
+  queryMaterialCategoryTreeList,
+} from '@/api/api'
+import { getAction, postAction } from '@/api/manage'
+import { mapGetters } from 'vuex'
+
+export default {
+  name: 'PdaFlowModal',
+  data() {
+    return {
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 9 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 15 },
+      },
+      visible: false,
+      categoryTree: [],
+      unitList: [],
+      confirmLoading: false,
+      prefixNo: 'PDAWHSP',
+      action: '',
+      title: '',
+      rules: {
+        categoryId: [{ required: true, message: '请选择类别!' }],
+        commodityUnit: [{ required: true, message: '请选择单位!' }],
+        defaultWholesaleDecimal: [{ required: true, message: '请输入默认销售价!' }],
+        defaultPurchaseDecimal: [{ required: true, message: '请输入默认采购价!' }],
+      },
+      model: {},
+      fileList:[],
+      // 审批历史
+      nodeOrder: null,
+      approvalId: null, //审批id
+      approvalIsReadonly: false,
+      approval:{
+        loading:false,
+        columns:[
+          { title: '审核时间', dataIndex: 'auditTime' },
+          { title: '审核环节', dataIndex: 'nodeOrder',customRender(text,record,index){
+            if(index===0){
+              return text
+            }
+            return `审批节点${text}`
+          } },
+          { title: '审批人', dataIndex: 'auditorName' },
+          { title: '审核动作', dataIndex: 'auditResult',customRender(text,record,index){
+            if(index===0){
+              return text
+            }
+            if(text==1){
+              return '审批通过'
+            }else if(text==2){
+              return '审批不通过'
+            }
+            return ''
+          } },
+          { title: '备注', dataIndex: 'auditComment' },
+        ],
+        dataSource:[]
+      },
+      auditComment: ''
+    }
+  },
+  computed: {
+    ...mapGetters(['username']),
+  },
+  methods: {
+    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)
+          }
+        }
+      })
+    },
+    loadUnitListData() {
+      let that = this
+      let params = {}
+      getAction('/unit/getAllList', params).then((res) => {
+        if (res) {
+          that.unitList = res.data.map(item => ({
+            title: item.name,
+            value: item.name,
+          }))
+        }
+      })
+    },
+    handleOpen(number){
+      this.visible = true
+      if(number){
+        this.getDetail(number)
+      }
+      this.loadTreeData()
+      this.loadUnitListData()
+    },
+    edit(number) {
+      this.action = 'edit'
+      this.handleOpen(number)
+    },
+    add(){
+      this.action = 'add'
+      this.$set(this.model,'taskStatus',0)
+      this.handleOpen()
+    },
+    lookDetail(number,approvalRow=null){
+      this.action = 'detail'
+      this.handleOpen(number)
+      //审批历史
+      if(approvalRow&&approvalRow.id){
+        this.approvalId = approvalRow.id
+        this.nodeOrder = approvalRow.nodeOrder
+        getAction('/audit/auditHistory',{id:approvalRow.id}).then(res => {
+          const list = res.data
+          list.unshift({
+            auditTime: approvalRow.submitTime,
+            nodeOrder: '开始',
+            auditorName: approvalRow.initiatorName,
+            auditResult: '提交审批',
+            auditComment: '',
+          })
+          this.approval.dataSource = list
+          console.log('approvalRow=====',approvalRow)
+        })
+      }
+    },
+    getDetail(number){
+      const url = '/materialInput/detail/' + number
+      getAction(url).then((res) => {
+        this.model = res.data
+        this.fileList = res.data.imgName?res.data.imgName.split(','):[]
+      })
+    },
+    close(){
+      this.visible = false
+      this.$refs.form.resetFields()
+      this.action = ''
+      this.model = {}
+      this.$emit('close')
+      // 审批
+      this.approvalId = null
+      this.auditComment = ''
+      this.approval.dataSource = []
+      this.approvalIsReadonly = false
+    },
+    handleCancel() {
+      this.close()
+    },
+    rowClassName(record,index){
+      if(this.username===record.auditorName){
+        return 'red-row'
+      }
+      return ''
+    },
+    toApproval(status){
+      const params = {
+        id: this.approvalId,
+        status,
+        auditComment: this.auditComment
+      }
+      this.confirmLoading = true
+      postAction('/audit/setStatus',params).then(res => {
+        console.log(res)
+        if(res.code===200){
+          this.$message.success(res.msg)
+          this.handleCancel()
+          this.$emit('ok')
+        }else{
+          this.$message.error(res.data.message)
+        }
+      }).finally(() => {
+        this.confirmLoading = false
+      })
+    },
+    // 提交审核
+    submitApproval(status){
+      if(this.nodeOrder==1&&status==1){
+        this.$refs.form.validate(async (flag, values) => {
+          if(flag){
+            const res = await postAction('/materialInput/update',{...this.model})
+            if(res.code===200){
+              this.toApproval(status)
+            }else{
+              this.$message.error(res.data||'操作失败')
+            }
+          }
+        })
+      }else{
+        this.toApproval(status)
+      }
+    }
+  },
+}
+</script>
+
+<style scoped>
+::v-deep .red-row{
+  color: #f5222d;
+}
+</style>

+ 142 - 0
jshERP-web/src/views/task/utils/flow.js

@@ -0,0 +1,142 @@
+export const flowTypes = [
+  {
+    label: '销售订单',
+    value: '销售订单',
+    prefixNo: 'XSDD'
+  },
+  {
+    label: '销售出库',
+    value: '销售出库',
+    prefixNo: 'XSCK'
+  },
+  // {
+  //   label: '销售退货',
+  //   value: '销售退货',
+  //   prefixNo: 'XSTH'
+  // },
+  {
+    label: '其它入库',
+    value: '其它入库',
+    prefixNo: 'QTRK'
+  },
+  {
+    label: '其它出库',
+    value: '其它出库',
+    prefixNo: 'QTCK'
+
+  },
+  // {
+  //   label: '调拨出库',
+  //   value: '调拨出库',
+  //   prefixNo: 'DBCK'
+
+  // },
+  // {
+  //   label: '组装单',
+  //   value: '组装单',
+  //   prefixNo: 'ZZD'
+
+  // },
+  // {
+  //   label: '拆卸单',
+  //   value: '拆卸单',
+  //   prefixNo: 'CXD'
+
+  // },
+  // {
+  //   label: '零售出库',
+  //   value: '零售出库',
+  //   prefixNo: 'LSCK'
+
+  // },
+  // {
+  //   label: '零售退货',
+  //   value: '零售退货',
+  //   prefixNo: 'LSTH'
+  // },
+  // {
+  //   label: '请购单',
+  //   value: '请购单',
+  //   prefixNo: 'QGD'
+  // },
+  {
+    label: '采购订单',
+    value: '采购订单',
+    prefixNo: 'CGDD'
+  },
+  {
+    label: '采购入库',
+    value: '采购入库',
+    prefixNo: 'CGRK'
+  },
+  // {
+  //   label: '采购退货',
+  //   value: '采购退货',
+  //   prefixNo: 'CGTH'
+  // },
+  // {
+  //   label: '收款单',
+  //   value: '收款单',
+  //   prefixNo: 'SKD'
+  // },
+  // {
+  //   label: '付款单',
+  //   value: '付款单',
+  //   prefixNo: 'FKD'
+  // },
+  // {
+  //   label: '转账单',
+  //   value: '转账单',
+  //   prefixNo: 'ZZD'
+  // },
+  // {
+  //   label: '收入单',
+  //   value: '收入单',
+  //   prefixNo: 'SRD'
+  // },
+  // {
+  //   label: '支出单',
+  //   value: '支出单',
+  //   prefixNo: 'ZCD'
+  // },
+  {
+    label: '盘点任务',
+    value: '盘点任务',
+    prefixNo: 'PDRW'
+  },
+  {
+    label: 'pda维护商品',
+    value: 'pda维护商品',
+    prefixNo: 'PDAWHSP'
+  },
+]
+
+export const approvers = [
+  {
+    label: '部门最高领导审核',
+    value: 3
+  },
+  {
+    label: '上级部门最高领导审核',
+    value: 2
+  },
+  {
+    label: '指定用户',
+    value: 1
+  },
+]
+
+export const auditStatusList = [
+  {
+    label: '待审批',
+    value: 0
+  },
+  {
+    label: '已通过',
+    value: 1
+  },
+  {
+    label: '未通过',
+    value: 2
+  },
+]