lilei hace 11 meses
padre
commit
e823fae2f1
Se han modificado 21 ficheros con 282 adiciones y 252 borrados
  1. 1 1
      public/version.json
  2. 4 3
      src/views/allocationManagement/chainTransferIn/detail.vue
  3. 15 6
      src/views/allocationManagement/chainTransferIn/edit.vue
  4. 24 21
      src/views/allocationManagement/chainTransferIn/list.vue
  5. 3 4
      src/views/allocationManagement/chainTransferOut/basicInfoModal.vue
  6. 5 4
      src/views/allocationManagement/chainTransferOut/chooseImportModal.vue
  7. 5 3
      src/views/allocationManagement/chainTransferOut/detail.vue
  8. 38 36
      src/views/allocationManagement/chainTransferOut/edit.vue
  9. 3 3
      src/views/allocationManagement/chainTransferOut/importGuideModal.vue
  10. 36 34
      src/views/allocationManagement/chainTransferOut/list.vue
  11. 11 12
      src/views/allocationManagement/storeTransferOut/basicInfoModal.vue
  12. 5 3
      src/views/allocationManagement/storeTransferOut/chooseImportModal.vue
  13. 4 2
      src/views/allocationManagement/storeTransferOut/detail.vue
  14. 34 29
      src/views/allocationManagement/storeTransferOut/edit.vue
  15. 38 34
      src/views/allocationManagement/storeTransferOut/list.vue
  16. 2 6
      src/views/allocationManagement/warehouseAllocation/basicInfoModal.vue
  17. 5 4
      src/views/allocationManagement/warehouseAllocation/chooseImportModal.vue
  18. 4 6
      src/views/allocationManagement/warehouseAllocation/detail.vue
  19. 19 19
      src/views/allocationManagement/warehouseAllocation/edit.vue
  20. 5 5
      src/views/allocationManagement/warehouseAllocation/importGuideModal.vue
  21. 21 17
      src/views/allocationManagement/warehouseAllocation/list.vue

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1721009994868
+  "version": 1721029576536
 }

+ 4 - 3
src/views/allocationManagement/chainTransferIn/detail.vue

@@ -102,10 +102,11 @@ export default {
       },
       basicInfoData: null, //  基本信息
       productTotal: null, //  合计
-      localDataSource: []
+      localDataSource: [] // 列表原始数据
     }
   },
   computed: {
+    // 是否可编辑
     isEdit () {
       return (this.basicInfoData && this.basicInfoData.state == 'WAIT_AUDIT' && this.$hasPermissions('B_allocLinkagePutEdit'))
     },
@@ -133,7 +134,7 @@ export default {
   methods: {
     //  返回列表
     handleBack () {
-      this.$router.push({ path: '/allocationManagement/chainTransferIn/list' })
+      this.$router.push({ name: 'chainTransferInList' })
     },
     // 基本信息
     getDetail () {
@@ -157,7 +158,7 @@ export default {
     },
     //  编辑
     handleEdit () {
-      this.$router.push({ path: `/allocationManagement/chainTransferIn/edit/${this.basicInfoData.id}/${this.basicInfoData.allocationLinkagePutSn}` })
+      this.$router.push({ name: 'chainTransferInEdit', params: { id: this.basicInfoData.id, sn: this.basicInfoData.allocationLinkagePutSn } })
     },
     // 打印预览/快捷打印
     handlePrint (type, printerType) {

+ 15 - 6
src/views/allocationManagement/chainTransferIn/edit.vue

@@ -91,7 +91,7 @@
               :allowClear="false"
               :options="warehouseCascadeData"
               :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
-              id="chainTransferInEdit-warehouseCascade"
+              :id="'chainTransferInEdit-warehouseCascade-'+record.id"
               placeholder="请选择仓库仓位"
               style="width: 100%;" />
           </template>
@@ -113,13 +113,14 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import Print from '@/views/common/print.vue'
+import { hdPrint } from '@/libs/JGPrint'
 import { STable, VSelect } from '@/components'
 import { getOperationalPrecision } from '@/libs/tools.js'
 import { dealerProductTypeList } from '@/api/dealerProductType'
 import { warehouseCascadeList } from '@/api/warehouse'
 import { allocLinkagePutDetailSn, allocLinkagePutDetailList, allocLinkagePutDetailCount, allocLinkagePutDetailUpdate, allocLinkagePutSubmit, allocLinkagePutDetailPrint } from '@/api/allocLinkagePut'
-import Print from '@/views/common/print.vue'
-import { hdPrint } from '@/libs/JGPrint'
+
 export default {
   name: 'AllocLinkagePutEdit',
   components: { STable, VSelect, Print },
@@ -136,7 +137,7 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       productTypeList: [], //  产品分类  下拉数据
-      productType: [],
+      productType: [], // 产品分类默认值
       warehouseCascadeData: [], //  仓库仓位
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -147,10 +148,12 @@ export default {
           let data
           if (res.status == 200) {
             data = res.data
+            // 统计数据
             this.getDetailCount(params)
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
+              // 默认仓库仓位获取
               const warehouseSn = data.list[i].warehouseSn || undefined
               const warehouseLocationSn = data.list[i].warehouseLocationSn || undefined
               data.list[i].warehouseSnBackups = warehouseSn
@@ -170,7 +173,7 @@ export default {
           return data
         })
       },
-      localDataSource: [],
+      localDataSource: [], // 列表原始数据
       basicInfoData: null, //  基本信息
       productTotal: null, //  合计
       printerType: 'NEEDLE' //  打印机类型
@@ -190,6 +193,7 @@ export default {
         // { title: '成本小计', dataIndex: 'costSubtotal', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: '16%', align: 'center' }
       ]
+      // 成本价权限
       if (this.$hasPermissions('M_ShowAllCost')) {
         arr.splice(4, 0, { title: '成本价', dataIndex: 'putCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
         arr.splice(7, 0, { title: '成本小计', dataIndex: 'costSubtotal', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
@@ -244,7 +248,7 @@ export default {
     },
     //  返回列表
     handleBack () {
-      this.$router.push({ path: '/allocationManagement/chainTransferIn/list' })
+      this.$router.push({ name: 'chainTransferInList' })
     },
     //  产品分类  change
     changeProductType (val, opt) {
@@ -252,7 +256,9 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
+    // 选择仓库仓位
     changeWarehouseCascade (val, opt, ind) {
+      // 仓库无仓位
       if (val.length < 2) {
         this.$message.warning('当前仓库无仓位,请选择其他仓库')
         const warehouseSnBackups = this.localDataSource[ind].warehouseSnBackups || undefined
@@ -277,6 +283,7 @@ export default {
         row.warehouseSn = row.warehouseSnBackups
         return
       }
+      // 没用选仓库
       if (!row.warehouseLocationSn) {
         row.warehouseLocationSn = row.warehouseLocationSnBackups
         return
@@ -307,6 +314,7 @@ export default {
         }
       })
     },
+    // 获取仓库仓位数据
     getWarehouseCascade () {
       warehouseCascadeList({}).then(res => {
         if (res.status == 200) {
@@ -335,6 +343,7 @@ export default {
         _this.spinning = false
       })
     },
+    // 初始化
     pageInit () {
       this.getDetail()
       this.getWarehouseCascade()

+ 24 - 21
src/views/allocationManagement/chainTransferIn/list.vue

@@ -7,7 +7,7 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="入库时间">
-                <rangeDate ref="rangeDate" @change="dateChange" />
+                <rangeDate id="chainTransferInList-date" ref="rangeDate" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -67,7 +67,7 @@
                 class="button-warning"
                 v-if="$hasPermissions('B_allocLinkagePutExport')"
                 id="chainTransferInList-export-btn">导出</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 5px">
+              <a @click="advanced=!advanced" style="margin-left: 5px" id="chainTransferInList-advanced">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -99,7 +99,7 @@
         bordered>
         <!-- 连锁调入单号 -->
         <template slot="allocationLinkagePutNo" slot-scope="text, record">
-          <span class="table-td-link" v-if="$hasPermissions('B_allocLinkagePutDetail')" @click="handleDetail(record)">{{ record.allocationLinkagePutNo }}</span>
+          <span class="table-td-link" :id="'chainTransferInList-detail-'+record.id" v-if="$hasPermissions('B_allocLinkagePutDetail')" @click="handleDetail(record)">{{ record.allocationLinkagePutNo }}</span>
           <span v-else>{{ record.allocationLinkagePutNo }}</span>
         </template>
         <!-- 审核 -->
@@ -122,21 +122,21 @@
             v-if="record.state == 'WAIT_SUBMIT'&&$hasPermissions('B_allocLinkagePutEdit')"
             class="button-primary"
             @click="handleEdit(record)"
-            id="chainTransferInList-warehousing-btn">入库</a-button>
+            :id="'chainTransferInList-in-'+record.id" >入库</a-button>
           <a-button
             size="small"
             type="link"
             v-if="record.state == 'WAIT_AUDIT'&&$hasPermissions('B_allocLinkagePutAudit')"
             class="button-primary"
             @click="handleExamine(record)"
-            id="chainTransferInList-examine-btn">审核</a-button>
+            :id="'chainTransferInList-audit-'+record.id" >审核</a-button>
           <a-button
             size="small"
             type="link"
             v-if="record.state == 'WAIT_AUDIT'&&$hasPermissions('B_allocLinkagePutEdit')"
             class="button-primary"
             @click="handleEdit(record)"
-            id="chainTransferInList-edit-btn">编辑</a-button>
+            :id="'chainTransferInList-edit-'+record.id" >编辑</a-button>
           <span v-if="((record.state != 'WAIT_SUBMIT') && (record.state != 'WAIT_AUDIT')) || (!(record.state == 'WAIT_SUBMIT'&&$hasPermissions('B_allocLinkagePutEdit'))&&!(record.state == 'WAIT_AUDIT'&&$hasPermissions('B_allocLinkagePutAudit'))&&!(record.state == 'WAIT_AUDIT'&&$hasPermissions('B_allocLinkagePutEdit')))">--</span>
         </template>
       </s-table>
@@ -149,10 +149,10 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import { formatDecimal } from '@/libs/tools'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { allocLinkagePutList, allocLinkagePutAudit, allocLinkagePutQueryCount, allocLinkagePutExport } from '@/api/allocLinkagePut'
 import getTenantList from '@/views/common/getTenantList.js'
 import stateIcon from '@/views/common/stateIcon'
 import { downloadExcel } from '@/libs/JGPrint.js'
+import { allocLinkagePutList, allocLinkagePutAudit, allocLinkagePutQueryCount, allocLinkagePutExport } from '@/api/allocLinkagePut'
 export default {
   name: 'AllocLinkagePutList',
   components: { STable, VSelect, rangeDate, stateIcon, getTenantList },
@@ -161,15 +161,15 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
+        beginDate: '', // 开始时间
+        endDate: '', // 结束时间
         allocationLinkagePutNo: undefined, // 连锁调入单号
         outTenantSn: undefined, //  调入对象
         allocationType: undefined, //  调拨产品类型
         state: undefined, //  业务状态
-        settleState: undefined
+        settleState: undefined // 财务状态
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出
@@ -188,7 +188,7 @@ export default {
 
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
-
+              // 总成本
               data.list[i].productTotalCost = formatDecimal(data.list[i].productTotalCost, 2)
             }
             this.disabled = false
@@ -219,6 +219,7 @@ export default {
         { title: '付款', scopedSlots: { customRender: 'financial' }, width: '3%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
+      // 成本价权限
       if (this.$hasPermissions('M_ShowAllCost')) {
         arr.splice(6, 0, { title: '总成本', dataIndex: 'productTotalCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
       }
@@ -226,6 +227,14 @@ export default {
     }
   },
   methods: {
+    //  详情
+    handleDetail (row) {
+      this.$router.push({ name: 'chainTransferInDetail', params: { sn: row.allocationLinkagePutSn } })
+    },
+    //  入库/编辑
+    handleEdit (row) {
+      this.$router.push({ name: 'chainTransferInEdit', params: { id: row.id, sn: row.allocationLinkagePutSn } })
+    },
     // 统计
     getCount (params) {
       allocLinkagePutQueryCount(params).then(res => {
@@ -236,7 +245,7 @@ export default {
         }
       })
     },
-    //  时间  change
+    //  选择时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
@@ -253,14 +262,6 @@ export default {
       this.queryParam.settleState = undefined
       this.$refs.table.refresh(true)
     },
-    //  详情
-    handleDetail (row) {
-      this.$router.push({ path: `/allocationManagement/chainTransferIn/detail/${row.allocationLinkagePutSn}` })
-    },
-    //  入库/编辑
-    handleEdit (row) {
-      this.$router.push({ path: `/allocationManagement/chainTransferIn/edit/${row.id}/${row.allocationLinkagePutSn}` })
-    },
     //  审核
     handleExamine (row) {
       const _this = this
@@ -295,12 +296,14 @@ export default {
         _this.spinning = false
       })
     },
+    // 初始化页面
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 表格高度计算
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 232

+ 3 - 4
src/views/allocationManagement/chainTransferOut/basicInfoModal.vue

@@ -69,12 +69,12 @@ export default {
       form: {
         allocationType: '', // 调出产品类型
         putTenantSn: undefined, //  调往对象
-        remark: ''
+        remark: ''// 备注
       },
       rules: {
         allocationType: [{ required: true, message: '请选择调出产品类型', trigger: 'change' }],
         putTenantSn: [{ required: true, message: '请选择调往对象', trigger: 'change' }]
-      },
+      }
     }
   },
   methods: {
@@ -98,11 +98,10 @@ export default {
             }
           })
         } else {
-          console.log('error submit!!')
           return false
         }
       })
-    },
+    }
   },
   watch: {
     //  父页面传过来的弹框状态

+ 5 - 4
src/views/allocationManagement/chainTransferOut/chooseImportModal.vue

@@ -85,7 +85,7 @@ export default {
       type: Boolean,
       default: false
     },
-    paramsData: {
+    paramsData: {// 参数
       type: Object,
       default: () => {
         return {}
@@ -93,7 +93,6 @@ export default {
     }
   },
   data () {
-    const _this = this
     return {
       isShow: this.openModal, //  是否打开弹框
       nowColumns: [ //  可导入
@@ -113,8 +112,8 @@ export default {
         { title: '调出数量', dataIndex: 'outQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '错误说明', scopedSlots: { customRender: 'errorMsg' }, width: '10%', align: 'center' }
       ],
-      loadData: [],
-      unLoadData: [],
+      loadData: [], // 可导入数据
+      unLoadData: [], // 错误数据
       loading: false
     }
   },
@@ -125,11 +124,13 @@ export default {
       importProduct(this.paramsData).then(res => {
         this.loading = false
         if (res.status == 200) {
+          // 可导入数据
           if (res.data.rightList && res.data.rightList.length > 0) {
             res.data.rightList.map((item, index) => {
               item.no = index + 1
             })
           }
+          // 错误数据
           if (res.data.errorList && res.data.errorList.length > 0) {
             res.data.errorList.map((item, index) => {
               item.no = index + 1

+ 5 - 3
src/views/allocationManagement/chainTransferOut/detail.vue

@@ -69,9 +69,9 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import { getOperationalPrecision } from '@/libs/tools.js'
-import { allocLinkageOutDetailSn, allocLinkageOutDetailList, allocLinkageOutDetailCount, allocLinkageOutDetailPrint } from '@/api/allocLinkageOut'
 import Print from '@/views/common/print.vue'
 import { hdPrint } from '@/libs/JGPrint'
+import { allocLinkageOutDetailSn, allocLinkageOutDetailList, allocLinkageOutDetailCount, allocLinkageOutDetailPrint } from '@/api/allocLinkageOut'
 export default {
   name: 'AllocLinkageOutDetail',
   components: { STable, VSelect, Print },
@@ -108,13 +108,15 @@ export default {
       },
       basicInfoData: null, //  基本信息
       productTotal: null, //  合计
-      localDataSource: []
+      localDataSource: [] // 原始列表数据
     }
   },
   computed: {
+    // 是否可编辑
     isEdit () {
       return ((this.basicInfoData && this.basicInfoData.state == 'WAIT_SUBMIT') || (this.basicInfoData && this.basicInfoData.state == 'WAIT_AUDIT')) && this.$hasPermissions('B_allocLinkageOutEdit')
     },
+    // 列定义
     columns () {
       const _this = this
       const arr = [
@@ -161,7 +163,7 @@ export default {
     },
     //  编辑
     handleEdit () {
-      this.$router.push({ path: `/allocationManagement/chainTransferOut/edit/${this.basicInfoData.id}/${this.basicInfoData.allocationLinkageOutSn}` })
+      this.$router.push({ name: 'chainTransferOutEdit', params: { id: this.basicInfoData.id, sn: this.basicInfoData.allocationLinkageOutSn } })
     },
     // 打印预览/快捷打印
     handlePrint (type, printerType) {

+ 38 - 36
src/views/allocationManagement/chainTransferOut/edit.vue

@@ -50,7 +50,7 @@
                     <a-col :md="6" :sm="24">
                       <a-form-item label="仓库">
                         <a-select id="chainTransferOutEdit-warehouseSn" allowClear placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
-                          <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
+                          <a-select-option v-for="item in warehouseList" :id="'warehouseSn-'+item.warehouseSn" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-item>
                     </a-col>
@@ -58,7 +58,7 @@
                   <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
                     <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="chainTransferOutEdit-refresh">查询</a-button>
                     <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="chainTransferOutEdit-reset">重置</a-button>
-                    <a @click="advanced=!advanced" style="margin-left: 8px">
+                    <a @click="advanced=!advanced" style="margin-left: 8px" id="chainTransferOutEdit-advanced">
                       {{ advanced ? '收起' : '展开' }}
                       <a-icon :type="advanced ? 'up' : 'down'"/>
                     </a>
@@ -84,7 +84,7 @@
                 <div @dblclick.stop>
                   <a-input-number
                     size="small"
-                    id="chainTransferOutEdit-outQty"
+                    :id="'chainTransferOutEdit-outQty-'+record.stockDetailSn"
                     v-model="record.outQty"
                     :precision="0"
                     :min="1"
@@ -95,7 +95,7 @@
               </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="link" class="button-primary" @click="handleAdd(record)" id="chainTransferOutEdit-add-btn">添加</a-button>
+                <a-button :id="'chainTransferOutEdit-add-'+record.stockDetailSn" size="small" type="link" class="button-primary" @click="handleAdd(record)">添加</a-button>
               </template>
             </s-table>
           </a-collapse-panel>
@@ -123,17 +123,17 @@
                     <a-row :gutter="15">
                       <a-col :md="9" :sm="24">
                         <a-form-item label="产品编码" prop="productCode">
-                          <a-input id="chainTransferOutEdit-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
+                          <a-input id="coe-choosed-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
                         </a-form-item>
                       </a-col>
                       <a-col :md="9" :sm="24">
                         <a-form-item label="产品名称" prop="productName">
-                          <a-input id="chainTransferOutEdit-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
+                          <a-input id="coe-choosed-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
                         </a-form-item>
                       </a-col>
                       <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                        <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="chainTransferOutList-refresh">查询</a-button>
-                        <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="chainTransferOutList-reset">重置</a-button>
+                        <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="coe-choosed-refresh">查询</a-button>
+                        <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="coe-choosed-reset">重置</a-button>
                       </a-col>
                     </a-row>
                   </a-form>
@@ -146,7 +146,7 @@
                   size="small"
                   @click="openGuideModal=true"
                   style="margin-right: 5px"
-                  id="chainTransferOutEdit-import-btn">导入产品</a-button>
+                  id="coe-choosed-import-btn">导入产品</a-button>
                 <a-button
                   size="small"
                   type="primary"
@@ -154,7 +154,7 @@
                   style="margin-left: 8px"
                   :disabled="localDataSource.length==0"
                   @click.stop="handleDel('', 'all')"
-                  id="chainTransferOutEdit-del-all-btn">清空列表</a-button>
+                  id="coe-choosed-del-all-btn">清空列表</a-button>
               </a-col>
             </a-row>
             <!-- 列表 -->
@@ -170,7 +170,7 @@
               bordered>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="chainTransferOutEdit-del-btn">删除</a-button>
+                <a-button size="small" type="link" class="button-error" @click="handleDel(record)" :id="'coe-choosed-del-btn-'+record.id">删除</a-button>
               </template>
             </s-table>
           </a-collapse-panel>
@@ -196,14 +196,17 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import { getOperationalPrecision } from '@/libs/tools.js'
-import { allocLinkageOutDetailSn, allocLinkageOutDetailList, allocLinkageOutDetailSave, allocLinkageOutDetailDel, allocLinkageOutDetailCount, allocLinkageOutSubmit, allocLinkageOutDetailDelAll, allocLinkageOutDetailPrint, importProductInsertBatch } from '@/api/allocLinkageOut'
-import { productQuery } from '@/api/allocWarehouse'
+import { hdPrint } from '@/libs/JGPrint'
+// 组件
+import Print from '@/views/common/print.vue'
+import importGuideModal from './importGuideModal.vue'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
+// 接口
 import { warehouseAllList } from '@/api/warehouse'
-import Print from '@/views/common/print.vue'
-import { hdPrint } from '@/libs/JGPrint'
-import importGuideModal from './importGuideModal.vue'
+import { productQuery } from '@/api/allocWarehouse'
+import { allocLinkageOutDetailSn, allocLinkageOutDetailList, allocLinkageOutDetailSave, allocLinkageOutDetailDel, allocLinkageOutDetailCount, allocLinkageOutSubmit, allocLinkageOutDetailDelAll, allocLinkageOutDetailPrint, importProductInsertBatch } from '@/api/allocLinkageOut'
+
 export default {
   name: 'AllocLinkageOutEdit',
   components: { STable, VSelect, Print, ProductType, ProductBrand, importGuideModal },
@@ -212,20 +215,20 @@ export default {
     return {
       spinning: false,
       queryParam: {
-        productCode: '',
-        productName: '',
-        productOrigCode: '',
-        warehouseSn: undefined,
-        brandSn: undefined,
-        productTypeSn1: undefined,
-        productTypeSn2: undefined,
-        productTypeSn3: undefined
+        productCode: '', // 产品编码
+        productName: '', // 产品名称
+        productOrigCode: '', //  原厂编码
+        warehouseSn: undefined, // 仓库sn
+        brandSn: undefined, // 品牌sn
+        productTypeSn1: undefined, // 产品类型1
+        productTypeSn2: undefined, // 产品类型2
+        productTypeSn3: undefined// 产品类型3
       },
-      productType: [],
+      productType: [], // 产品分类默认值
       warehouseList: [], //  仓库  下拉数据
       disabled: false, //  查询、重置按钮是否可操作
-      chooseDisabled: false,
-      openGuideModal: false,
+      chooseDisabled: false, // 按钮禁用
+      openGuideModal: false, // 打开导入产品弹框
       advanced: false, // 高级搜索 展开/关闭
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -244,8 +247,8 @@ export default {
         })
       },
       chooseQueryParam: {
-        productCode: '',
-        productName: ''
+        productCode: '', // 产品编码
+        productName: ''// 产品名称
       },
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
@@ -267,7 +270,7 @@ export default {
       },
       basicInfoData: null, //  基本信息
       productTotal: null, //  合计
-      localDataSource: []
+      localDataSource: [] // 原始数据
     }
   },
   computed: {
@@ -292,6 +295,7 @@ export default {
       }
       return arr
     },
+    // 已选列
     chooseColumns () {
       const _this = this
       const arr = [
@@ -308,6 +312,7 @@ export default {
         // { title: '成本小计', dataIndex: 'costSubtotal', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
+      // 成本价权限
       if (this.$hasPermissions('M_ShowAllCost')) {
         arr.splice(8, 0, { title: '成本价', dataIndex: 'outCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
         arr.splice(10, 0, { title: '成本小计', dataIndex: 'costSubtotal', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
@@ -321,6 +326,7 @@ export default {
       this.resetData()
       this.$refs.table.refresh(true)
     },
+    // 重置数据
     resetData () {
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
@@ -439,12 +445,7 @@ export default {
     },
     //  返回列表
     handleBack () {
-      this.$router.push({ path: '/allocationManagement/chainTransferOut/list' })
-    },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
+      this.$router.push({ name: 'chainTransferOutList' })
     },
     // 合计
     getDetailCount (params) {
@@ -483,6 +484,7 @@ export default {
         _this.spinning = false
       })
     },
+    // 页面初始化
     pageInit () {
       this.resetData()
       this.chooseResetSearchForm()

+ 3 - 3
src/views/allocationManagement/chainTransferOut/importGuideModal.vue

@@ -17,7 +17,7 @@
           <ul>
             <li>1)导入的Excel文件中必须包含名为“产品编码”、“仓库”、“仓位”、“调出数量”的列,且名称必须相同,其他列可自定义,不影响数据导入</li>
             <li>2)如果导入的产品已经存在,则不会导入该行</li>
-            <li><a :href="templUrl"><a-icon type="download" />下载导入模板</a></li>
+            <li><a :href="templUrl" id="importGuide-tpl-link"><a-icon type="download" />下载导入模板</a></li>
           </ul>
         </div>
         <div class="explain-item">
@@ -72,7 +72,7 @@ export default {
       type: Boolean,
       default: false
     },
-    params: {
+    params: { // 参数
       type: Object,
       default: null
     }
@@ -86,7 +86,7 @@ export default {
       uploadParams: {
         savePathType: 'local'
       },
-      templUrl: location.protocol + '//' + location.host + '/templ/连锁调出产品导入模板.xlsx'
+      templUrl: location.protocol + '//' + location.host + '/templ/连锁调出产品导入模板.xlsx' // 模板地址
     }
   },
   methods: {

+ 36 - 34
src/views/allocationManagement/chainTransferOut/list.vue

@@ -7,17 +7,17 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate id="chainTransferOutList-time" ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="审核时间">
-                <rangeDate ref="auditRangeDate" v-model="auditTime" @change="auditDateChange" />
+                <rangeDate id="chainTransferOutList-auditTime" ref="auditRangeDate" v-model="auditTime" @change="auditDateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="出库时间">
-                <rangeDate ref="outWareRangeDate" v-model="outWareTime" @change="outWareDateChange" />
+                <rangeDate id="chainTransferOutList-outWareTime" ref="outWareRangeDate" v-model="outWareTime" @change="outWareDateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -77,7 +77,7 @@
                 :disabled="disabled"
                 :loading="exportLoading"
                 id="chainTransferOutList-export">导出</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 8px">
+              <a @click="advanced=!advanced" style="margin-left: 8px" id="chainTransferOutList-advanced">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -136,28 +136,28 @@
             v-if="record.state == 'WAIT_AUDIT'&&$hasPermissions('B_allocLinkageOutAudit')"
             class="button-primary"
             @click="handleExamine(record)"
-            id="chainTransferOutList-examine-btn">审核</a-button>
+            :id="'chainTransferOutList-examine-'+record.id">审核</a-button>
           <a-button
             size="small"
             type="link"
             v-if="(record.state == 'WAIT_SUBMIT' || record.state == 'WAIT_AUDIT') &&$hasPermissions('B_allocLinkageOutEdit')"
             class="button-primary"
             @click="handleEdit(record)"
-            id="chainTransferOutList-edit-btn">编辑</a-button>
+            :id="'chainTransferOutList-edit-'+record.id">编辑</a-button>
           <a-button
             size="small"
             type="link"
             v-if="record.state == 'WAIT_OUT_WAREHOUSE'&&$hasPermissions('B_allocLinkageOutStock')"
             class="button-primary"
             @click="handleOut(record)"
-            id="chainTransferOutList-out-btn">出库</a-button>
+            :id="'chainTransferOutList-out-'+record.id">出库</a-button>
           <a-button
             size="small"
             type="link"
             v-if="(record.state == 'WAIT_SUBMIT' || record.state == 'WAIT_AUDIT' || record.state == 'WAIT_OUT_WAREHOUSE') &&$hasPermissions('B_allocLinkageOutDel')"
             class="button-error"
             @click="handleDel(record)"
-            id="chainTransferOutList-del-btn">删除</a-button>
+            :id="'chainTransferOutList-del-'+record.id">删除</a-button>
           <span v-if="(record.state != 'WAIT_SUBMIT' && record.state != 'WAIT_AUDIT' && record.state != 'WAIT_OUT_WAREHOUSE')|| (!(record.state == 'WAIT_AUDIT'&&$hasPermissions('B_allocLinkageOutAudit')) && !((record.state == 'WAIT_SUBMIT' || record.state == 'WAIT_AUDIT') &&$hasPermissions('B_allocLinkageOutEdit')) && !(record.state == 'WAIT_OUT_WAREHOUSE'&&$hasPermissions('B_allocLinkageOutStock')))">--</span>
         </template>
       </s-table>
@@ -185,26 +185,26 @@ export default {
     return {
       spinning: false,
       exportLoading: false,
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       advanced: true, // 高级搜索 展开/关闭
-      time: [
+      time: [ // 时间默认值
         getDate.getCurrMonthDays().starttime,
         getDate.getCurrMonthDays().endtime
       ],
-      auditTime: [],
-      outWareTime: [],
+      auditTime: [], // 审核时间
+      outWareTime: [], // 出库时间
       queryParam: { //  查询条件
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        auditBeginDate: '',
-        auditEndDate: '',
-        outWarehouseBeginDate: '',
-        outWarehouseEndDate: '',
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束时间
+        auditBeginDate: '', // 审核开始时间
+        auditEndDate: '', // 审核结束时间
+        outWarehouseBeginDate: '', // 出库开始时间
+        outWarehouseEndDate: '', // 出库结束时间
         allocationLinkageOutNo: undefined, //  连锁调出单号
         putTenantSn: undefined, //  调往对象
         allocationType: undefined, //  调出产品类型
         state: undefined, //  业务状态
-        settleState: undefined
+        settleState: undefined // 财务状态
       },
       disabled: false, //  查询、重置按钮是否可操作
       // 加载数据方法 必须为 Promise 对象
@@ -252,6 +252,7 @@ export default {
         { title: '收款', scopedSlots: { customRender: 'financial' }, width: '3%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
+      // 成本价权限
       if (this.$hasPermissions('M_ShowAllCost')) {
         arr.splice(6, 0, { title: '总成本', dataIndex: 'productTotalCost', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
       }
@@ -259,6 +260,14 @@ export default {
     }
   },
   methods: {
+    //  详情
+    handleDetail (row) {
+      this.$router.push({ name: 'chainTransferOutDetail', params: { sn: row.allocationLinkageOutSn } })
+    },
+    //  新增/编辑
+    handleEdit (row) {
+      this.$router.push({ name: 'chainTransferOutEdit', params: { id: row.id, sn: row.allocationLinkageOutSn } })
+    },
     // 统计
     getCount (params) {
       allocLinkageOutQueryCount(params).then(res => {
@@ -269,20 +278,22 @@ export default {
         }
       })
     },
-    //  时间  change
+    //  选择时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    // 审核时间
     auditDateChange (date) {
       this.queryParam.auditBeginDate = date[0]
       this.queryParam.auditEndDate = date[1]
     },
+    // 出库时间
     outWareDateChange (date) {
       this.queryParam.outWarehouseBeginDate = date[0]
       this.queryParam.outWarehouseEndDate = date[1]
     },
-    //  导出
+    // 导出
     handleExport () {
       const _this = this
       const params = this.queryParam
@@ -323,20 +334,19 @@ export default {
       this.$refs.outWareRangeDate.resetDate('')
       this.queryParam.outWarehouseBeginDate = ''
       this.queryParam.outWarehouseEndDate = ''
-
       this.queryParam.allocationLinkageOutNo = undefined
       this.queryParam.putTenantSn = undefined
       this.queryParam.allocationType = undefined
       this.queryParam.state = undefined
       this.queryParam.settleState = undefined
 	    if (!flag) {
-	      this.setIsHomeNav(this.$route.name, null)
+        this.setIsHomeNav(this.$route.name, null)
 	    }
     },
     //  基本信息  保存
     handleOk (data) {
       this.resetData()
-      this.$router.push({ path: `/allocationManagement/chainTransferOut/add/${data.id}/${data.allocationLinkageOutSn}` })
+      this.$router.push({ name: 'chainTransferOutAdd', params: { id: data.id, sn: data.allocationLinkageOutSn } })
     },
     //  删除
     handleDel (row) {
@@ -401,14 +411,7 @@ export default {
         }
       })
     },
-    //  详情
-    handleDetail (row) {
-      this.$router.push({ path: `/allocationManagement/chainTransferOut/detail/${row.allocationLinkageOutSn}` })
-    },
-    //  新增/编辑
-    handleEdit (row) {
-      this.$router.push({ path: `/allocationManagement/chainTransferOut/edit/${row.id}/${row.allocationLinkageOutSn}` })
-    },
+    // 初始化页面
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -422,7 +425,6 @@ export default {
       const b = this.$store.state.app.updateList
       // 是否从首页点击进入
       const isHomeNav = this.getIsHomeNav()[this.$route.name]
-      console.log(a, b, this.getIsHomeNav(), isHomeNav, this.$route.name)
 
       // 从首页进入,判断式新建还式待办查询
       if (isHomeNav) {
@@ -449,6 +451,7 @@ export default {
         }
       }
     },
+    // 表格高度计算
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 273
@@ -465,7 +468,6 @@ export default {
       this.setTableH()
     }
   },
-  mounted () {},
   activated () {
     this.pageInit()
   },

+ 11 - 12
src/views/allocationManagement/storeTransferOut/basicInfoModal.vue

@@ -18,17 +18,17 @@
         :wrapper-col="formItemLayout.wrapperCol"
       >
         <a-form-model-item label="调往对象" prop="putPersonType">
-          <a-radio-group v-model="form.putPersonType" @change="putPersonTypeChange">
-            <a-radio v-for="(item,index) in putPersonTypeList" :key="index" :value="item.code">{{ item.dispName }}</a-radio>
+          <a-radio-group id="storeTransferOut-basicInfo-putPersonType" v-model="form.putPersonType" @change="putPersonTypeChange">
+            <a-radio v-for="(item,index) in putPersonTypeList" :id="'putPersonType-'+item.code" :key="index" :value="item.code">{{ item.dispName }}</a-radio>
           </a-radio-group>
         </a-form-model-item>
         <a-form-model-item label="调往对象名称" :prop="isCustomer ? 'putPersonSn' : 'putPersonName'">
-          <selectCust ref="custList" :isValidateEnabled="true" v-if="isCustomer" @change="custChange"></selectCust>
+          <selectCust id="storeTransferOut-basicInfo-putPersonSn" ref="custList" :isValidateEnabled="true" v-if="isCustomer" @change="custChange"></selectCust>
           <a-input v-if="!isCustomer" v-model.trim="form.putPersonName" placeholder="请输入调往对象名称(最多30个字符)" allowClear :maxLength="30" />
         </a-form-model-item>
         <a-form-model-item label="调拨类型" prop="callOutType">
-          <a-select v-model="form.callOutType" placeholder="请选择调拨类型" allowClear >
-            <a-select-option v-for="item in storeCallOutTypeList" :key="item.storeCallOutTypeSn" :value="item.storeCallOutTypeSn">{{ item.name }}</a-select-option>
+          <a-select id="storeTransferOut-basicInfo-callOutType" v-model="form.callOutType" placeholder="请选择调拨类型" allowClear >
+            <a-select-option v-for="item in storeCallOutTypeList" :id="'callOutType-'+item.storeCallOutTypeSn" :key="item.storeCallOutTypeSn" :value="item.storeCallOutTypeSn">{{ item.name }}</a-select-option>
           </a-select>
         </a-form-model-item>
         <a-form-model-item label="备注" prop="remark">
@@ -46,9 +46,9 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { VSelect } from '@/components'
+import selectCust from '@/views/common/selectCust.vue'
 import { storeCallOutSave } from '@/api/storeCallOut'
 import { getLookUpData } from '@/api/data'
-import selectCust from '@/views/common/selectCust.vue'
 import { storeCallOutTypeAllList } from '@/api/storeCallOutType'
 export default {
   name: 'StoreTransferOutBasicInfoModal',
@@ -70,11 +70,11 @@ export default {
         wrapperCol: { span: 18 }
       },
       form: {
-        putPersonType: 'CUSTOMER',
-        putPersonSn: undefined,
-        putPersonName: '',
-        callOutType: undefined,
-        remark: ''
+        putPersonType: 'CUSTOMER', // 调往对象类型
+        putPersonSn: undefined, // 调往对象sn
+        putPersonName: '', // 调往对象名称
+        callOutType: undefined, // 调拨类型
+        remark: ''// 备注
       },
       rules: {
         putPersonType: [{ required: true, message: '请选择调往对象', trigger: 'change' }],
@@ -113,7 +113,6 @@ export default {
             }
           })
         } else {
-          console.log('error submit!!')
           return false
         }
       })

+ 5 - 3
src/views/allocationManagement/storeTransferOut/chooseImportModal.vue

@@ -87,7 +87,7 @@ export default {
       type: Boolean,
       default: false
     },
-    paramsData: {
+    paramsData: {// 参数
       type: Object,
       default: () => {
         return {}
@@ -95,9 +95,9 @@ export default {
     }
   },
   data () {
-    const _this = this
     return {
       isShow: this.openModal, //  是否打开弹框
+      // 可导入列
       nowColumns: [
         { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -108,6 +108,7 @@ export default {
         { title: '调出数量', dataIndex: 'qtyStr', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       loadData: [],
+      // 错误数据列
       nowUnColumns: [
         { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '22%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -125,10 +126,12 @@ export default {
       const paramsData = JSON.parse(JSON.stringify(this.paramsData))
       this.loadData = paramsData.rightList || []
       this.unLoadData = paramsData.errorList || []
+      // 可导入列
       this.loadData.map((item, index) => {
         item.no = index + 1
         item.storeCallOutSn = paramsData.storeCallOutSn
       })
+      // 错误数据列
       this.unLoadData.map((item, index) => {
         item.no = index + 1
         item.storeCallOutSn = paramsData.storeCallOutSn
@@ -141,7 +144,6 @@ export default {
         this.$message.warning('无可导入的产品!')
       } else {
         const data = this.paramsData.rightList
-        
         this.$emit('ok', data)
         this.isShow = false
       }

+ 4 - 2
src/views/allocationManagement/storeTransferOut/detail.vue

@@ -142,12 +142,14 @@ export default {
     }
   },
   computed: {
+    // 是否可编辑
     isEdit () {
       return (
         ((this.basicInfoData && this.basicInfoData.state == 'WAIT_SUBMIT') || (this.basicInfoData && this.basicInfoData.state == 'WAIT_AUDIT')) &&
         this.$hasPermissions('B_storeCallOutEdit')
       )
     },
+    // 列定义
     columns () {
       const _this = this
       const arr = [
@@ -228,7 +230,7 @@ export default {
   methods: {
     //  返回列表
     handleBack () {
-      this.$router.push({ path: '/allocationManagement/storeTransferOut/list' })
+      this.$router.push({ name: 'storeTransferOutList' })
     },
     // 打印预览/快捷打印
     handlePrint (type, printerType) {
@@ -276,7 +278,7 @@ export default {
     },
     //  编辑
     handleEdit () {
-      this.$router.push({ path: `/allocationManagement/storeTransferOut/edit/${this.basicInfoData.id}/${this.basicInfoData.storeCallOutSn}` })
+      this.$router.push({ name: 'storeTransferOutEdit', params: { id: this.basicInfoData.id, sn: this.basicInfoData.storeCallOutSn } })
     }
   },
   mounted () {

+ 34 - 29
src/views/allocationManagement/storeTransferOut/edit.vue

@@ -64,14 +64,14 @@
                     </a-col>
                     <a-col :md="6" :sm="24">
                       <a-form-item label="">
-                        <a-checkbox style="margin-left:10px;" v-model="enableFlag" :checked="enableFlag" id="sales-byCustQuery">包括禁用产品</a-checkbox>
+                        <a-checkbox style="margin-left:10px;" v-model="enableFlag" :checked="enableFlag" id="storeTransferOutEdit-byCustQuery">包括禁用产品</a-checkbox>
                       </a-form-item>
                     </a-col>
                   </template>
                   <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                    <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutList-refresh">查询</a-button>
-                    <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
-                    <a @click="advanced=!advanced" style="margin-left: 5px">
+                    <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutEdit-refresh">查询</a-button>
+                    <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutEdit-reset">重置</a-button>
+                    <a @click="advanced=!advanced" style="margin-left: 5px" id="storeTransferOutEdit-advanced">
                       {{ advanced ? '收起' : '展开' }}
                       <a-icon :type="advanced ? 'up' : 'down'"/>
                     </a>
@@ -105,6 +105,7 @@
                 <div @dblclick.stop>
                   <a-input-number
                     size="small"
+                    :id="`storeTransferOutEdit-outQty-${record.stockDetailSn}`"
                     v-if="record.currentQty"
                     v-model="record.outQty"
                     :precision="0"
@@ -123,7 +124,7 @@
                   type="link"
                   class="button-primary"
                   @click="handleAdd(record)"
-                  id="storeTransferOutEdit-add-btn">添加</a-button>
+                  :id="`storeTransferOutEdit-add-${record.stockDetailSn}`">添加</a-button>
                 <span v-else>--</span>
               </template>
             </s-table>
@@ -152,17 +153,17 @@
                     <a-row :gutter="15">
                       <a-col :md="8" :sm="24">
                         <a-form-item label="产品编码" prop="productCode">
-                          <a-input id="storeTransferOutEdit-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
+                          <a-input id="stoChoose-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
                         </a-form-item>
                       </a-col>
                       <a-col :md="8" :sm="24">
                         <a-form-item label="产品名称" prop="productName">
-                          <a-input id="storeTransferOutEdit-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
+                          <a-input id="stoChoose-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
                         </a-form-item>
                       </a-col>
                       <a-col :md="8" :sm="24" style="margin-bottom: 10px;">
-                        <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="storeTransferOutList-refresh">查询</a-button>
-                        <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="storeTransferOutList-reset">重置</a-button>
+                        <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="stoChoose-refresh">查询</a-button>
+                        <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="stoChoose-reset">重置</a-button>
                       </a-col>
                     </a-row>
                   </a-form>
@@ -173,7 +174,7 @@
                   type="default"
                   @click="openGuideModal=true"
                   style="margin-right:5px;"
-                  id="salesEdit-import">导入产品</a-button>
+                  id="stoChoose-import-product">导入产品</a-button>
               </a-col>
             </a-row>
             <!-- 列表 -->
@@ -199,7 +200,7 @@
               <template slot="outQty" slot-scope="text, record">
                 <a-input-number
                   size="small"
-                  id="storeTransferOutEdit-outQty"
+                  :id="'stoChoose-outQty-'+record.id"
                   v-model="record.outQty"
                   :precision="0"
                   :min="1"
@@ -210,8 +211,8 @@
               </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="link" class="button-primary" @click="handleViewDetail(record)">出库明细</a-button>
-                <a-button size="small" type="link" class="button-error" @click="handleDel(record)">删除</a-button>
+                <a-button :id="'stoChoose-detail-'+record.id" size="small" type="link" class="button-primary" @click="handleViewDetail(record)">出库明细</a-button>
+                <a-button :id="'stoChoose-del-'+record.id" size="small" type="link" class="button-error" @click="handleDel(record)">删除</a-button>
               </template>
             </s-table>
           </a-collapse-panel>
@@ -255,23 +256,23 @@ export default {
   data () {
     return {
       spinning: false,
-      showOutInModal: false,
-      openGuideModal: false,
+      showOutInModal: false, // 出入库明细
+      openGuideModal: false, // 打开导入产品弹框
       queryParam: {
-        productCode: '',
-        productName: '',
-        warehouseSn: undefined,
-        brandSn: undefined,
-        productTypeSn1: undefined,
-        productTypeSn2: undefined,
-        productTypeSn3: undefined,
-        existStockFlag: undefined,
+        productCode: '', // 产品编码
+        productName: '', // 产品名称
+        warehouseSn: undefined, // 仓库sn
+        brandSn: undefined, // 品牌sn
+        productTypeSn1: undefined, // 分类1
+        productTypeSn2: undefined, // 分类2
+        productTypeSn3: undefined, // 分类3
+        existStockFlag: undefined, // 是否有库存
         enableFlag: undefined // 是否包含禁用产品
       },
-      enableFlag: true,
+      enableFlag: true, // 启用禁用
       chooseQueryParam: {
-        productCode: '',
-        productName: ''
+        productCode: '', // 产品编码
+        productName: ''// 产品名称
       },
       disabled: false, //  查询、重置按钮是否可操作
       loading: false, //  表格加载中
@@ -279,7 +280,7 @@ export default {
       advanced: false, // 高级搜索 展开/关闭
       productBrandList: [], //  产品品牌  下拉数据
       productTypeList: [], //  产品分类  下拉数据
-      productType: [],
+      productType: [], // 产品分类
       warehouseList: [], //  仓库  下拉数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -310,12 +311,13 @@ export default {
             // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
             data.list[i].costSubtotal = getOperationalPrecision(data.list[i].outCost, data.list[i].outQty)
           }
+          // 保存原始数据
           this.chooseLoadDataSource = data.list || []
           this.chooseDisabled = false
           return data
         })
       },
-      chooseLoadDataSource: [],
+      chooseLoadDataSource: [], // 已选产品列表
       basicInfoData: null, //  基本信息
       productTotal: null, //  合计
       printCostChecked: true //  打印成本
@@ -341,6 +343,7 @@ export default {
       }
       return arr
     },
+    // 已选表格列
     chooseColumns () {
       const _this = this
       const arr = [
@@ -355,6 +358,7 @@ export default {
         // { slots: { title: 'costTitle' }, dataIndex: 'totalOutCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
+      // 成本价权限
       if (this.$hasPermissions('M_ShowAllCost')) {
         arr.splice(7, 0, { slots: { title: 'costTitle' }, dataIndex: 'totalOutCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
       }
@@ -509,7 +513,7 @@ export default {
     },
     //  返回列表
     handleBack () {
-      this.$router.push({ path: '/allocationManagement/storeTransferOut/list' })
+      this.$router.push({ name: 'storeTransferOutList' })
     },
     // 已选产品 调出数量  blur
     outQtyBlur (val, record) {
@@ -534,6 +538,7 @@ export default {
         }
       })
     },
+    // 页面初始化和
     pageInit () {
       this.printCostChecked = true
       this.getDetail()

+ 38 - 34
src/views/allocationManagement/storeTransferOut/list.vue

@@ -7,17 +7,17 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate id="storeTransferOutList-time" ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="审核时间">
-                <rangeDate ref="auditRangeDate" :value="auditTime" @change="auditDateChange" />
+                <rangeDate id="storeTransferOutList-auditTime" ref="auditRangeDate" :value="auditTime" @change="auditDateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="出库时间">
-                <rangeDate ref="outWareRangeDate" :value="outWareTime" @change="outWareDateChange" />
+                <rangeDate id="storeTransferOutList-outWareTime" ref="outWareRangeDate" :value="outWareTime" @change="outWareDateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -67,7 +67,7 @@
             <a-col :md="24" :sm="24" style="margin-bottom: 10px;text-align: center;">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutList-refresh">查询</a-button>
               <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 8px">
+              <a @click="advanced=!advanced" style="margin-left: 8px" id="storeTransferOutList-advanced">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -103,18 +103,18 @@
         bordered>
         <!-- 店内调出单号 -->
         <template slot="storeCallOutNo" slot-scope="text, record">
-          <span class="table-td-link" v-if="$hasPermissions('B_storeCallOutDetail')" @click="handleDetail(record)">{{ record.storeCallOutNo }}</span>
+          <span :id="'storeTransferOutList-detail-'+record.id" class="table-td-link" v-if="$hasPermissions('B_storeCallOutDetail')" @click="handleDetail(record)">{{ record.storeCallOutNo }}</span>
           <span v-else>{{ record.storeCallOutNo }}</span>
         </template>
-        <!-- 审核 -->
+        <!-- 审核icon -->
         <template slot="audit" slot-scope="text, record">
           <stateIcon :title="record.stateDictValue" :state="record.state == 'FINISH'||record.state == 'WAIT_OUT_WAREHOUSE'?'1':'2'"></stateIcon>
         </template>
-        <!-- 结算 -->
+        <!-- 结算icon -->
         <template slot="financial" slot-scope="text, record">
           <stateIcon :title="record.settleStateDictValue" :state="record.settleState == 'FINISH'?'1':'2'"></stateIcon>
         </template>
-        <!-- 出库 -->
+        <!-- 出库icon -->
         <template slot="waitOut" slot-scope="text, record">
           <stateIcon :state="record.state == 'FINISH'?'1':'2'"></stateIcon>
         </template>
@@ -126,28 +126,29 @@
             v-if="record.state == 'WAIT_AUDIT'&&$hasPermissions('B_storeCallOutAudit')"
             class="button-primary"
             @click="handleExamine(record)"
-            id="storeTransferOutList-examine-btn">审核</a-button>
+            :id="'storeTransferOutList-audit-'+record.id"
+          >审核</a-button>
           <a-button
             size="small"
             type="link"
             v-if="((record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT')) &&$hasPermissions('B_storeCallOutEdit')"
             class="button-primary"
             @click="handleEdit(record)"
-            id="storeTransferOutList-edit-btn">编辑</a-button>
+            :id="'storeTransferOutList-edit-'+record.id">编辑</a-button>
           <a-button
             size="small"
             type="link"
             v-if="record.state == 'WAIT_OUT_WAREHOUSE'&&$hasPermissions('B_storeCallStockOut')"
             class="button-primary"
             @click="handleOut(record)"
-            id="storeTransferOutList-out-btn">出库</a-button>
+            :id="'storeTransferOutList-out-'+record.id">出库</a-button>
           <a-button
             size="small"
             type="link"
             v-if="((record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT') || (record.state == 'WAIT_OUT_WAREHOUSE'))&&$hasPermissions('B_storeCallOutDel')"
             class="button-error"
             @click="handleDel(record)"
-            id="storeTransferOutList-del-btn">删除</a-button>
+            :id="'storeTransferOutList-del-'+record.id">删除</a-button>
           <span v-if="!(record.state == 'WAIT_AUDIT'&&$hasPermissions('B_storeCallOutAudit')) && !(((record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT')) &&$hasPermissions('B_storeCallOutEdit')) && !(record.state == 'WAIT_OUT_WAREHOUSE'&&$hasPermissions('B_storeCallStockOut')) && !(((record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT') || (record.state == 'WAIT_OUT_WAREHOUSE'))&&$hasPermissions('B_storeCallOutDel'))">--</span>
         </template>
       </s-table>
@@ -175,22 +176,22 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      time: [
+      tableHeight: 0, // 表格高度
+      time: [// 时间默认值
         getDate.getCurrMonthDays().starttime,
         getDate.getCurrMonthDays().endtime
       ],
-      auditTime: [],
-      outWareTime: [],
+      auditTime: [], // 审核时间默认值
+      outWareTime: [], // 出库时间默认值
       queryParam: { //  查询条件
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        auditBeginDate: '',
-        auditEndDate: '',
-        outWarehouseBeginDate: '',
-        outWarehouseEndDate: '',
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束时间
+        auditBeginDate: '', // 审核开始时间
+        auditEndDate: '', // 审核结束时间
+        outWarehouseBeginDate: '', // 出库开始时间
+        outWarehouseEndDate: '', // 出库结束时间
         customerNameCurrent: undefined, //  调往对象
-        customerSnCurrent: undefined,
+        customerSnCurrent: undefined, // 调往对象sn
         storeCallOutNo: undefined, // 店内调出单号
         callOutType: undefined, //  调拨类型
         state: undefined, //  业务状态
@@ -250,8 +251,8 @@ export default {
     }
   },
   methods: {
+    // 选择调往对象
     custChange (v, row) {
-      console.log(v, row)
       if (row && row.customerSn) {
         this.queryParam.customerSnCurrent = row.customerSn
         this.queryParam.customerNameCurrent = undefined
@@ -275,10 +276,12 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    // 审核时间选择
     auditDateChange (date) {
       this.queryParam.auditBeginDate = date[0]
       this.queryParam.auditEndDate = date[1]
     },
+    // 出库时间选择
     outWareDateChange (date) {
       this.queryParam.outWarehouseBeginDate = date[0]
       this.queryParam.outWarehouseEndDate = date[1]
@@ -316,7 +319,15 @@ export default {
     //  基本信息  保存
     handleOk (data) {
       this.resetData()
-      this.$router.push({ path: `/allocationManagement/storeTransferOut/add/${data.id}/${data.storeCallOutSn}` })
+      this.$router.push({ name: 'storeTransferOutAdd', params: { id: data.id, sn: data.storeCallOutSn } })
+    },
+    //  详情
+    handleDetail (row) {
+      this.$router.push({ name: 'storeTransferOutDetail', params: { sn: row.storeCallOutSn } })
+    },
+    //  新增/编辑
+    handleEdit (row) {
+      this.$router.push({ name: 'storeTransferOutEdit', params: { id: row.id, sn: row.storeCallOutSn } })
     },
     //  删除
     handleDel (row) {
@@ -381,14 +392,6 @@ export default {
         }
       })
     },
-    //  详情
-    handleDetail (row) {
-      this.$router.push({ path: `/allocationManagement/storeTransferOut/detail/${row.storeCallOutSn}` })
-    },
-    //  新增/编辑
-    handleEdit (row) {
-      this.$router.push({ path: `/allocationManagement/storeTransferOut/edit/${row.id}/${row.storeCallOutSn}` })
-    },
     //  调拨类型
     getStoreCallOutTypeAllList () {
       storeCallOutTypeAllList().then(res => {
@@ -399,6 +402,7 @@ export default {
         }
       })
     },
+    // 页面初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -413,7 +417,6 @@ export default {
       const b = this.$store.state.app.updateList
       // 是否从首页点击进入
       const isHomeNav = this.getIsHomeNav()[this.$route.name]
-      console.log(a, b, this.getIsHomeNav(), isHomeNav, this.$route.name, '店内调出')
 
       // 从首页进入,判断式新建还式待办查询
       if (isHomeNav) {
@@ -440,6 +443,7 @@ export default {
         }
       }
     },
+    // 表格设置高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 273

+ 2 - 6
src/views/allocationManagement/warehouseAllocation/basicInfoModal.vue

@@ -18,14 +18,14 @@
         :wrapper-col="formItemLayout.wrapperCol" >
         <a-form-model-item required label="调出仓库" prop="outWarehouseSn">
           <a-select id="warehouseAllocation-basicInfo-outWarehouseSn" allowClear placeholder="请选择调出仓库" v-model="form.outWarehouseSn" >
-            <a-select-option v-for="(item, index) in warehouseList" :key="index" :value="item.warehouseSn">
+            <a-select-option v-for="(item, index) in warehouseList" :id="'basicInfo-outWarehouseSn-'+item.warehouseSn" :key="index" :value="item.warehouseSn">
               {{ item.name }}
             </a-select-option>
           </a-select>
         </a-form-model-item>
         <a-form-model-item required label="调入仓库" prop="putWarehouseSn">
           <a-select id="warehouseAllocation-basicInfo-putWarehouseSn" allowClear placeholder="请选择调入仓库" v-model="form.putWarehouseSn" >
-            <a-select-option v-for="(item, index) in warehouseList" :key="index" :value="item.warehouseSn">
+            <a-select-option v-for="(item, index) in warehouseList" :id="'basicInfo-putWarehouseSn-'+item.warehouseSn" :key="index" :value="item.warehouseSn">
               {{ item.name }}
             </a-select-option>
           </a-select>
@@ -124,13 +124,9 @@ export default {
             }
           })
         } else {
-          console.log('error submit!!')
           return false
         }
       })
-    },
-    filterOption (input, option) {
-      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
     }
   }
 

+ 5 - 4
src/views/allocationManagement/warehouseAllocation/chooseImportModal.vue

@@ -85,7 +85,7 @@ export default {
       type: Boolean,
       default: false
     },
-    paramsData: {
+    paramsData: { // 参数
       type: Object,
       default: () => {
         return {}
@@ -93,7 +93,6 @@ export default {
     }
   },
   data () {
-    const _this = this
     return {
       isShow: this.openModal, //  是否打开弹框
       nowColumns: [ //  可导入
@@ -113,8 +112,8 @@ export default {
         { title: '调出数量', dataIndex: 'allocationQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '错误原因', scopedSlots: { customRender: 'errorMsg' }, width: '10%', align: 'center' }
       ],
-      loadData: [],
-      unLoadData: [],
+      loadData: [], // 正确数据列表
+      unLoadData: [], // 错误数据列表
       loading: false
     }
   },
@@ -125,11 +124,13 @@ export default {
       importProduct(this.paramsData).then(res => {
         this.loading = false
         if (res.status == 200) {
+          // 正确数据
           if (res.data.rightList && res.data.rightList.length > 0) {
             res.data.rightList.map((item, index) => {
               item.no = index + 1
             })
           }
+          // 错误数据
           if (res.data.errorList && res.data.errorList.length > 0) {
             res.data.errorList.map((item, index) => {
               item.no = index + 1

+ 4 - 6
src/views/allocationManagement/warehouseAllocation/detail.vue

@@ -86,7 +86,7 @@ export default {
       spinning: false,
       exportLoading: false, // 导出loading
       warehouse: null, // 基础信息
-      productTotal: null,
+      productTotal: null, // 统计信息
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -123,6 +123,7 @@ export default {
         { title: '调出仓位', dataIndex: 'outWarehouseLocationName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '调入仓位', dataIndex: 'putWarehouseLocationName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
+      // 成本价权限
       if (this.$hasPermissions('M_ShowAllCost')) {
         arr.splice(5, 0, { title: '成本价', dataIndex: 'allocationCost', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
         arr.splice(8, 0, { title: '成本小计', dataIndex: 'totalAllocationCost', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
@@ -133,18 +134,17 @@ export default {
   methods: {
     //  返回列表
     handleBack () {
-      this.$router.push({ path: '/allocationManagement/warehouseAllocation/list' })
+      this.$router.push({ name: 'warehouseAllocationList' })
     },
     //  新增/编辑
     handleEdit () {
-      this.$router.push({ path: `/allocationManagement/warehouseAllocation/edit/${this.warehouse.id}/${this.warehouse.allocationWarehouseSn}` })
+      this.$router.push({ name: `warehouseAllocationEdit`, params: { id: this.warehouse.id, sn: this.warehouse.allocationWarehouseSn } })
     },
     // 查询基础信息
     getHouse () {
       allocWarehouseDetailSn({ sn: this.outBizSn || this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.warehouse = res.data
-          // this.queryParam.outWarehouseSn = res.data.outWarehouseSn
         } else {
           this.warehouse = null
         }
@@ -163,14 +163,12 @@ export default {
   },
   mounted () {
     if (!this.$store.state.app.isNewTab || this.outBizSn) { // 页签刷新 或 为弹框时调用
-      // this.$refs.table.refresh(true)
       this.getHouse()
     }
   },
   activated () {
     // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
     if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
-      // this.$refs.table.refresh(true)
       this.getHouse()
     }
   },

+ 19 - 19
src/views/allocationManagement/warehouseAllocation/edit.vue

@@ -47,15 +47,15 @@
                     <a-col :md="6" :sm="24">
                       <a-form-item label="调出仓位" prop="warehouseLocationSn">
                         <a-select id="warehouseAllocationEdit-warehouseLocationSn" placeholder="请选择" allowClear v-model="queryParam.warehouseLocationSn" style="width: 100%;">
-                          <a-select-option v-for="item in warehouseOutLocData" :key="item.warehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</a-select-option>
+                          <a-select-option v-for="item in warehouseOutLocData" :key="item.warehouseLocationSn" :id="'warehouseLocationSn-'+item.warehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-item>
                     </a-col>
                   </template>
                   <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                    <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="warehouseAllocationList-refresh">查询</a-button>
-                    <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="warehouseAllocationList-reset">重置</a-button>
-                    <a @click="advanced=!advanced" style="margin-left: 5px">
+                    <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="warehouseAllocationEdit-refresh">查询</a-button>
+                    <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="warehouseAllocationEdit-reset">重置</a-button>
+                    <a @click="advanced=!advanced" style="margin-left: 5px" id="warehouseAllocationEdit-advanced">
                       {{ advanced ? '收起' : '展开' }}
                       <a-icon :type="advanced ? 'up' : 'down'"/>
                     </a>
@@ -84,8 +84,8 @@
               <!-- 调入仓位 -->
               <template slot="putWarehouseLocationSn" slot-scope="text, record">
                 <div @dblclick.stop>
-                  <a-select size="small" id="warehouseAllocationEdit-putWarehouseLocationSn" placeholder="请选择" v-model="record.putWarehouseLocationSn" style="width: 100%;">
-                    <a-select-option v-for="item in warehousePutLocData" :key="item.warehouseLocationSn" :disabled="item.warehouseLocationSn==record.warehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</a-select-option>
+                  <a-select size="small" :id="'edit-putWarehouseLocationSn-'+record.stockDetailSn" placeholder="请选择" v-model="record.putWarehouseLocationSn" style="width: 100%;">
+                    <a-select-option v-for="item in warehousePutLocData" :id="'editsn-'+item.warehouseLocationSn+'-'+record.stockDetailSn" :key="item.warehouseLocationSn" :disabled="item.warehouseLocationSn==record.warehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</a-select-option>
                   </a-select>
                 </div>
               </template>
@@ -94,7 +94,7 @@
                 <div @dblclick.stop>
                   <a-input-number
                     size="small"
-                    id="warehouseAllocationEdit-outQty"
+                    :id="'edit-outQty-'+record.stockDetailSn"
                     v-model="record.outQty"
                     :precision="0"
                     :min="1"
@@ -105,7 +105,7 @@
               </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="link" class="button-primary" @click="handleAdd(record)" id="warehouseAllocationEdit-add-btn">添加</a-button>
+                <a-button size="small" type="link" class="button-primary" @click="handleAdd(record)" :id="'add-'+record.stockDetailSn">添加</a-button>
               </template>
             </s-table>
           </a-collapse-panel>
@@ -131,17 +131,17 @@
                     <a-row :gutter="15">
                       <a-col :md="9" :sm="24">
                         <a-form-item label="产品编码" prop="productCode">
-                          <a-input id="warehouseAllocationEdit-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
+                          <a-input id="choosePc-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
                         </a-form-item>
                       </a-col>
                       <a-col :md="9" :sm="24">
                         <a-form-item label="产品名称" prop="productName">
-                          <a-input id="warehouseAllocationEdit-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
+                          <a-input id="choosePc-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
                         </a-form-item>
                       </a-col>
                       <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                        <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="warehouseAllocationList-refresh">查询</a-button>
-                        <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="warehouseAllocationList-reset">重置</a-button>
+                        <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="choosePc-refresh">查询</a-button>
+                        <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="choosePc-reset">重置</a-button>
                       </a-col>
                     </a-row>
                   </a-form>
@@ -155,14 +155,14 @@
                     size="small"
                     @click="openGuideModal=true"
                     style="margin-right: 5px"
-                    id="chainTransferOutEdit-import-btn">导入产品</a-button>
+                    id="choosePc-import-btn">导入产品</a-button>
                   <a-button
                     size="small"
                     type="danger"
                     style="margin-left: 8px"
                     @click.stop="handleDel('', 'all')"
                     :disabled="chooseLoadDataSource.length==0"
-                    id="warehouseAllocationEdit-del-all-btn">清空列表</a-button>
+                    id="choosePc-del-all-btn">清空列表</a-button>
                 </div>
               </a-col>
             </a-row>
@@ -186,19 +186,19 @@
               <template slot="putWarehouseLocationSn" slot-scope="text, record">
                 <a-select
                   size="small"
-                  id="warehouseAllocationEdit-putWarehouseLocationSn"
+                  :id="'choosePc-putWarehouseLocationSn-'+record.id"
                   @change="chooseWarehouseLocChange(record)"
                   placeholder="请选择"
                   v-model="record.putWarehouseLocationSn"
                   style="width: 100%;">
-                  <a-select-option v-for="item in warehousePutLocData" :key="item.warehouseLocationSn" :disabled="item.warehouseLocationSn==record.outWarehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</a-select-option>
+                  <a-select-option v-for="item in warehousePutLocData" :id="'choosePc-putWarehouseLocationSn-'+record.id+'-'+item.warehouseLocationSn" :key="item.warehouseLocationSn" :disabled="item.warehouseLocationSn==record.outWarehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</a-select-option>
                 </a-select>
               </template>
               <!-- 调出数量 -->
               <template slot="outQty" slot-scope="text, record">
                 <a-input-number
                   size="small"
-                  id="warehouseAllocationEdit-outQty"
+                  :id="'choosePc-outQty-'+record.id"
                   v-model="record.outQty"
                   :precision="0"
                   :min="1"
@@ -209,7 +209,7 @@
               </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="warehouseAllocationEdit-del-btn">删除</a-button>
+                <a-button size="small" type="link" class="button-error" @click="handleDel(record)" :id="'choosePc-del-'+record.id">删除</a-button>
               </template>
             </s-table>
           </a-collapse-panel>
@@ -512,7 +512,7 @@ export default {
     },
     //  返回列表
     handleBack () {
-      this.$router.push({ path: '/allocationManagement/warehouseAllocation/list' })
+      this.$router.push({ name: 'warehouseAllocationList' })
     },
     // 已选产品 调出数量  blur
     outQtyBlur (val, record) {

+ 5 - 5
src/views/allocationManagement/warehouseAllocation/importGuideModal.vue

@@ -17,7 +17,7 @@
           <ul>
             <li>1)导入的Excel文件中必须包含名为“产品编码”、“调出仓位”、“调入仓位”、“调出数量”的列,且名称必须相同,其他列可自定义,不影响数据导入</li>
             <li>2)如果导入的产品已经存在,则不会导入该行</li>
-            <li><a :href="templUrl"><a-icon type="download" />下载导入模板</a></li>
+            <li><a :href="templUrl" id="importGuide-tpl-link"><a-icon type="download" />下载导入模板</a></li>
           </ul>
         </div>
         <div class="explain-item">
@@ -72,7 +72,7 @@ export default {
       type: Boolean,
       default: false
     },
-    params: {
+    params: { // 参数
       type: Object,
       default: null
     }
@@ -81,12 +81,12 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       openImportModal: false, //  导入
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
-      paramsData: null,
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload', // 接口
+      paramsData: null, // 参数
       uploadParams: {
         savePathType: 'local'
       },
-      templUrl: location.protocol + '//' + location.host + '/templ/仓库调拨产品导入模板.xlsx'
+      templUrl: location.protocol + '//' + location.host + '/templ/仓库调拨产品导入模板.xlsx' // 模板地址
     }
   },
   methods: {

+ 21 - 17
src/views/allocationManagement/warehouseAllocation/list.vue

@@ -7,7 +7,7 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate id="warehousingAuditList-time" ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -18,7 +18,7 @@
             <a-col :md="6" :sm="24">
               <a-form-item label="调出仓库">
                 <a-select id="warehouseAllocation-basicInfo-outWarehouseSn" allowClear placeholder="请选择调出仓库" v-model="queryParam.outWarehouseSn">
-                  <a-select-option v-for="(item, index) in warehouseList" :key="index" :value="item.warehouseSn">{{ item.name }}</a-select-option>
+                  <a-select-option v-for="(item, index) in warehouseList" :id="'warehouseAllocation-outWarehouseSn-'+item.warehouseSn" :key="index" :value="item.warehouseSn">{{ item.name }}</a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
@@ -26,7 +26,7 @@
               <a-col :md="6" :sm="24">
                 <a-form-item label="调入仓库">
                   <a-select id="warehouseAllocation-basicInfo-putWarehouseSn" allowClear placeholder="请选择调入仓库" v-model="queryParam.putWarehouseSn">
-                    <a-select-option v-for="(item, index) in warehouseList" :key="index" :value="item.warehouseSn">{{ item.name }}</a-select-option>
+                    <a-select-option v-for="(item, index) in warehouseList" :id="'warehouseAllocation-putWarehouseSn-'+item.warehouseSn" :key="index" :value="item.warehouseSn">{{ item.name }}</a-select-option>
                   </a-select>
                 </a-form-item>
               </a-col>
@@ -56,7 +56,7 @@
                 class="button-warning"
                 v-if="$hasPermissions('B_allocWarehouseExport')"
                 id="warehouseAllocation-export-btn">导出</a-button>
-              <a @click="advanced = !advanced" style="margin-left: 8px">
+              <a @click="advanced = !advanced" style="margin-left: 8px" id="warehouseAllocation-advanced">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'" />
               </a>
@@ -90,7 +90,7 @@
         bordered>
         <!-- 单号 -->
         <template slot="allocationWarehouseNo" slot-scope="text, record">
-          <span class="table-td-link" v-if="$hasPermissions('B_warehouseAllocationDetail')" @click="handleDetail(record)">{{ record.allocationWarehouseNo }}</span>
+          <span class="table-td-link" v-if="$hasPermissions('B_warehouseAllocationDetail')" :id="'warehouseAllocationList-detail-'+record.id" @click="handleDetail(record)">{{ record.allocationWarehouseNo }}</span>
           <span v-else>{{ record.allocationWarehouseNo }}</span>
         </template>
         <!-- 审核 -->
@@ -105,7 +105,8 @@
             type="link"
             class="button-primary"
             @click="handleExamine(record)"
-            id="warehouseAllocationList-examine-btn">
+            :id="'warehouseAllocationList-audit-'+record.id"
+          >
             审核
           </a-button>
           <a-button
@@ -114,7 +115,7 @@
             type="link"
             class="button-primary"
             @click="handleEdit(record,1)"
-            id="warehouseAllocationList-edit-btn">
+            :id="'warehouseAllocationList-edit-'+record.id">
             编辑
           </a-button>
           <a-button
@@ -123,7 +124,7 @@
             type="link"
             class="button-error"
             @click="handleDel(record)"
-            id="warehouseAllocationList-del-btn">
+            :id="'warehouseAllocationList-del-'+record.id">
             删除
           </a-button>
           <span v-if="((record.state != 'WAIT_SUBMIT') && (record.state != 'WAIT_AUDIT')) || (!(record.state == 'WAIT_AUDIT'&&$hasPermissions('B_allocWarehouseAudit')) && !(((record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT')) && $hasPermissions('B_warehouseAllocationEdit')) &&!(((record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT')) && $hasPermissions('B_warehouseAllocationDel'))) ">--</span>
@@ -153,15 +154,15 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       warehouseList: [], // 仓库列表
-      time: [
+      time: [ // 时间默认值
         getDate.getCurrMonthDays().starttime,
         getDate.getCurrMonthDays().endtime
       ],
       queryParam: { //  查询条件
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束时间
         outWarehouseSn: undefined, //  调出仓库
         putWarehouseSn: undefined, //  调入仓库
         state: undefined, //  审核状态
@@ -210,6 +211,7 @@ export default {
         { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
+      // 成本价权限
       if (this.$hasPermissions('M_ShowAllCost')) {
         arr.splice(7, 0, { title: '总成本', dataIndex: 'productTotalCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
       }
@@ -227,7 +229,7 @@ export default {
         }
       })
     },
-    //  时间  change
+    //  选择时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
@@ -304,19 +306,20 @@ export default {
     },
     //  详情
     handleDetail (row) {
-      this.$router.push({ path: `/allocationManagement/warehouseAllocation/detail/${row.allocationWarehouseSn}` })
+      this.$router.push({ name: `warehouseAllocationDetail`, params: { sn: row.allocationWarehouseSn } })
     },
     //  新增/编辑
     handleEdit (row, flag) {
       if (!flag) {
         this.resetData()
       }
-      this.$router.push({ path: `/allocationManagement/warehouseAllocation/edit/${row.id}/${row.allocationWarehouseSn}` })
+      this.$router.push({ name: `warehouseAllocationEdit`, params: { id: row.id, sn: row.allocationWarehouseSn } })
     },
-    // 导出
+    // 导出仓库调拨列表
     handleExport () {
       const _this = this
       const params = _this.queryParam
+      // 是否导出成本
       params.showCost = _this.$hasPermissions('M_ShowAllCost') ? 1 : 0
       _this.exportLoading = true
       _this.spinning = true
@@ -326,6 +329,7 @@ export default {
         _this.spinning = false
       })
     },
+    // 页面初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -339,7 +343,6 @@ export default {
       const b = this.$store.state.app.updateList
       // 是否从首页点击进入
       const isHomeNav = this.getIsHomeNav()[this.$route.name]
-      console.log(a, b, this.getIsHomeNav(), isHomeNav, this.$route.name)
 
       // 从首页进入,判断式新建还式待办查询
       if (isHomeNav) {
@@ -366,6 +369,7 @@ export default {
         }
       }
     },
+    // 表格高度计算
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 273