chenrui преди 11 месеца
родител
ревизия
a291121cc1
променени са 30 файла, в които са добавени 809 реда и са изтрити 553 реда
  1. 55 45
      src/views/allocationManagement/matchSendOutOrder/list.vue
  2. 5 5
      src/views/allocationManagement/transferOut/basicInfoModal.vue
  3. 6 3
      src/views/allocationManagement/transferOut/chooseImportModal.vue
  4. 20 9
      src/views/allocationManagement/transferOut/detail.vue
  5. 25 19
      src/views/allocationManagement/transferOut/dsModal.vue
  6. 58 36
      src/views/allocationManagement/transferOut/edit.vue
  7. 14 5
      src/views/allocationManagement/transferOut/importGuideModal.vue
  8. 55 44
      src/views/allocationManagement/transferOut/list.vue
  9. 31 23
      src/views/allocationManagement/transferOut/printModal.vue
  10. 20 15
      src/views/allocationManagement/transferOut/printStatusModal.vue
  11. 49 29
      src/views/allocationManagement/transferReturn/basicInfoModal.vue
  12. 37 29
      src/views/allocationManagement/transferReturn/check.vue
  13. 5 3
      src/views/allocationManagement/transferReturn/chooseImportModal.vue
  14. 15 7
      src/views/allocationManagement/transferReturn/detail.vue
  15. 52 38
      src/views/allocationManagement/transferReturn/edit.vue
  16. 13 12
      src/views/allocationManagement/transferReturn/editGrp.vue
  17. 34 24
      src/views/allocationManagement/transferReturn/list.vue
  18. 65 49
      src/views/allocationManagement/transfersPrint/list.vue
  19. 9 3
      src/views/allocationManagement/transfersPrint/recordModal.vue
  20. 19 12
      src/views/power/OperateJournal/OperateJournal.vue
  21. 36 26
      src/views/power/dataDictionary/codeItemModal.vue
  22. 23 17
      src/views/power/dataDictionary/codeModal.vue
  23. 35 25
      src/views/power/dataDictionary/dataDictionary.vue
  24. 30 15
      src/views/setting/bigScreenSet/index.vue
  25. 5 4
      src/views/setting/checkDingTask/list.vue
  26. 10 4
      src/views/setting/erpAllotSettings/list.vue
  27. 28 19
      src/views/setting/erpMessageManagement/list.vue
  28. 18 12
      src/views/setting/noticeManagement/detailModal.vue
  29. 19 11
      src/views/setting/noticeManagement/editModal.vue
  30. 18 10
      src/views/setting/noticeManagement/list.vue

+ 55 - 45
src/views/allocationManagement/matchSendOutOrder/list.vue

@@ -3,40 +3,40 @@
     <a-card size="small" :bordered="false" class="searchBoxNormal">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" id="matchSendOutOrderList-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate ref="rangeDate" id="matchSendOutOrderList-time" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="调往对象">
-                <a-input id="allocateBillList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调往对象"/>
+                <a-input id="matchSendOutOrderList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调往对象"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="收货客户名称">
-                <dealerSearchList ref="receiverSn" @change="custChange" />
+                <dealerSearchList id="matchSendOutOrderList-receiverSn" ref="receiverSn" @change="custChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24" v-show="isShowWarehouse">
+              <a-form-item label="调出仓库">
+                <warehouse
+                  v-model="queryParam.warehouseSn"
+                  isPermission
+                  id="matchSendOutOrderList-warehouseSn"
+                  placeholder="请选择调出仓库"
+                />
               </a-form-item>
             </a-col>
             <template v-if="advanced">
-              <a-col :md="6" :sm="24" v-show="isShowWarehouse">
-                <a-form-item label="调出仓库">
-                  <warehouse
-                    v-model="queryParam.warehouseSn"
-                    isPermission
-                    id="allocateBillList-warehouseSn"
-                    placeholder="请选择调出仓库"
-                  />
-                </a-form-item>
-              </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="业务状态">
                   <v-select
                     v-model="queryParam.state"
                     ref="state"
-                    id="allocateBillList-state"
+                    id="matchSendOutOrderList-state"
                     code="ALLOCATE_STATUS"
                     placeholder="请选择业务状态"
                     allowClear
@@ -45,7 +45,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="调拨单号">
-                  <a-input id="allocateBillList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
+                  <a-input id="matchSendOutOrderList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -53,7 +53,7 @@
                   <v-select
                     v-model="queryParam.checkStatus"
                     ref="checkStatus"
-                    id="allocateBillList-checkStatus"
+                    id="matchSendOutOrderList-checkStatus"
                     code="CHECK_STATUS"
                     placeholder="请选择对单状态"
                     allowClear
@@ -62,19 +62,19 @@
               </a-col>
               <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
                 <a-form-item label="客服">
-                  <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
+                  <customerService ref="customerName" id="matchSendOutOrderList-bizUserSn" v-model="queryParam.bizUserSn"></customerService>
                 </a-form-item>
               </a-col>
             </template>
             <a-col :md="isShowCustomerSearch?24:6" :sm="24" :style="{textAlign: isShowCustomerSearch?'center':''}">
-             <div class="table-page-search-submitButtons">
-               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="allocateBillList-refresh">查询</a-button>
-               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="allocateBillList-reset">重置</a-button>
-               <a @click="advanced=!advanced" style="margin-left: 5px">
-                 {{ advanced ? '收起' : '展开' }}
-                 <a-icon :type="advanced ? 'up' : 'down'"/>
-               </a>
-             </div>
+              <div class="table-page-search-submitButtons">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="matchSendOutOrderList-refresh">查询</a-button>
+                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="matchSendOutOrderList-reset">重置</a-button>
+                <a @click="advanced=!advanced" style="margin-left: 5px" id="matchSendOutOrderList-advanced">
+                  {{ advanced ? '收起' : '展开' }}
+                  <a-icon :type="advanced ? 'up' : 'down'"/>
+                </a>
+              </div>
             </a-col>
           </a-row>
         </a-form>
@@ -97,7 +97,7 @@
           bordered>
           <!-- 单号 -->
           <template slot="allocateNo" slot-scope="text, record">
-            <span v-if="$hasPermissions('M_transferOut_detail')" class="link-bule" @click="handleDetail(record)">{{ record.allocateNo }}</span>
+            <span v-if="$hasPermissions('M_transferOut_detail')" :id="'matchSendOutOrderList-allocateNo'+record.id" class="link-bule" @click="handleDetail(record)">{{ record.allocateNo }}</span>
             <span v-else>{{ record.allocateNo }}</span>
           </template>
           <!-- 操作 -->
@@ -108,7 +108,7 @@
               v-if="record.checkStatus == 'WAIT'&&$hasPermissions('B_YxAudit')"
               class="button-warning"
               @click="handleYxAudit(record)"
-              id="allocateBillList-checkStatus">对单通过</a-button>
+              :id="'matchSendOutOrderList-checkStatus'+record.id">对单通过</a-button>
             <span v-else>--</span>
           </template>
         </s-table>
@@ -131,6 +131,7 @@
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import commonModal from '@/views/common/commonModal.vue'
@@ -138,43 +139,48 @@ import dealerSearchList from '@/views/common/dealerSearchList.vue'
 import customerService from '@/views/common/customerService.vue'
 import allocationDetailModal from '@/views/allocationManagement/transferOut/detail.vue'
 import warehouse from '@/views/common/chooseWarehouse.js'
+// 接口
 import { allocateBillList, allocateBillCheck } from '@/api/allocateBill'
 export default {
   name: 'MatchSendOutOrderAllocationList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, dealerSearchList, commonModal, allocationDetailModal, warehouse,customerService },
+  components: { STable, VSelect, rangeDate, dealerSearchList, commonModal, allocationDetailModal, warehouse, customerService },
   data () {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
+      // 创建时间 默认值
       time: [
         moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ],
-      queryParam: { //  查询条件
-        beginDate: getDate.getThreeMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
+      //  查询条件
+      queryParam: {
+        beginDate: getDate.getThreeMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束时间
         targetName: '', //  调往对象
         state: undefined, //  业务状态
         allocateNo: '', //  调拨单号
-        warehouseSn: undefined,
-        receiverSn: undefined,
-        checkStatus: undefined,
-        printState: undefined,
-        bizUserSn:undefined
+        warehouseSn: undefined, // 出库仓库
+        receiverSn: undefined, // 收货客户名称
+        checkStatus: undefined, // 对单状态
+        printState: undefined, // 打印状态
+        bizUserSn: undefined// 客服
       },
-      showDetailModal: false,
+      showDetailModal: false, // 详情弹窗
       disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
+      exportLoading: false, // 导出按钮加载状态
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据  有分页
         return allocateBillList(Object.assign(parameter, this.queryParam, { authWarehouseFlag: 1 })).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -185,15 +191,14 @@ export default {
           return data
         })
       },
-      visibleAudit: false,
-      auditInfo: null,
-      bizSn: '',
-      spinningAudit: false,
+      bizSn: '', // 调拨sn
+      spinningAudit: false, // 审核按钮加载状态
       openModal: false //  新增编辑  弹框
-      
+
     }
   },
   computed: {
+    // 表头
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -218,6 +223,7 @@ export default {
     }
   },
   methods: {
+    // 收货客户名称 change
     custChange (val) {
       if (val.row) {
         this.queryParam.receiverSn = val.row.dealerSn
@@ -275,11 +281,13 @@ export default {
       this.bizSn = row.allocateSn
       this.showDetailModal = true
     },
+    // 关闭详情弹窗
     cancelDetail () {
       this.$store.state.app.curActionPermission = ''
       this.showDetailModal = false
       this.bizSn = null
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -287,12 +295,14 @@ export default {
       })
       this.openModal = false
     },
+    // 表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 200
     }
   },
   watch: {
+    // 展开关闭  监听表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 5 - 5
src/views/allocationManagement/transferOut/basicInfoModal.vue

@@ -207,8 +207,8 @@ export default {
       })
     },
     departementChange (v, row) {
-       console.log(v,row)
-       this.form.targetName = row.name
+      console.log(v, row)
+      this.form.targetName = row.name
     },
     // 调拨类别 change
     allocateTypeChange (val, opt) {
@@ -257,9 +257,9 @@ export default {
       const ind = this.dealerData.findIndex(item => item.dealerSn == value)
       this.form.targetName = this.dealerData[ind].dealerName
       const wsn = this.dealerData[ind].defaultWarehouseSn
-      if(this.$refs.warehouse.hasWarehouse(wsn)){
+      if (this.$refs.warehouse.hasWarehouse(wsn)) {
         this.form.warehouseSn = wsn
-      }else{
+      } else {
         this.form.warehouseSn = undefined
       }
     },
@@ -349,7 +349,7 @@ export default {
         // 编辑
         if (this.detailData) {
           this.isEdit = true
-          this.form = Object.assign(this.form, this.detailData)
+          // this.form = Object.assign(this.form, this.detailData)
           // 获取附件列表
           this.form.attachmentList = ''
           this.attachList = this.detailData.attachmentList

+ 6 - 3
src/views/allocationManagement/transferOut/chooseImportModal.vue

@@ -68,6 +68,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { allocateBillParseProducts, allocateBillFailExcel } from '@/api/allocateBill'
 export default {
   name: 'TransferOutChooseImportModal',
@@ -104,15 +105,17 @@ export default {
         { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备注', dataIndex: 'errorDesc', width: 180, align: 'center', customRender: function (text) { return text || '--' } }
       ],
-      loadData: [],
-      unLoadData: [],
-      loading: false
+      loadData: [], // 可导入数据
+      unLoadData: [], // 错误数据
+      loading: false// 表格加载状态
     }
   },
   methods: {
+    // 获取表格数据
     getData () {
       const _this = this
       this.loading = true
+      // 获取列表数据  无分页
       allocateBillParseProducts(this.paramsData).then(res => {
         this.loading = false
         if (res.status == 200) {

+ 20 - 9
src/views/allocationManagement/transferOut/detail.vue

@@ -14,7 +14,7 @@
             @click.stop="handleEdit">
             <a-icon type="edit"/>编辑
           </a-button>
-          <a-button type="link" class="button-default" @click="showDetail=!showDetail">
+          <a-button id="allocateBillDetail-showDetail-btn" type="link" class="button-default" @click="showDetail=!showDetail">
             <a-icon :type="showDetail ? 'eye-invisible' : 'eye'"/> {{ showDetail?'隐藏':'查看' }}信息
           </a-button>
         </template>
@@ -25,7 +25,7 @@
             type="primary"
             class="button-info"
             v-if="$hasPermissions('B_transferOut_print')"
-            id="allocateBillDetail-db-print-btn"
+            id="allocateBillDetail-dbPrint-btn"
             :disabled="localDataSource.length==0"
             @click="handlePrint('dbPrint')">调拨打印</a-button>
           <a-button
@@ -33,7 +33,7 @@
             type="primary"
             class="button-info"
             v-if="$hasPermissions('B_transferOutType_print')"
-            id="allocateBillDetail-dbfl-print-btn"
+            id="allocateBillDetail-dbflPrint-btn"
             :disabled="localDataSource.length==0"
             @click="handlePrint('dbflPrint')">调拨分类打印</a-button>
           <a-divider type="vertical" />
@@ -50,7 +50,7 @@
             type="default"
             class="button-info"
             v-if="$hasPermissions('B_transferOutType_export')"
-            id="allocateBillDetail-export-btn"
+            id="allocateBillDetail-exportType-btn"
             :disabled="localDataSource.length==0"
             @click="handlePrint('dbflExport')">调拨分类导出</a-button>
         </template>
@@ -96,6 +96,7 @@
                 <div v-if="basicInfoData&&basicInfoData.attachmentList&&basicInfoData.attachmentList.length">
                   <a
                     target="_blank"
+                    id="allocateBillDetail-attachmentList"
                     style="color: #00aaff;text-decoration: underline;margin-right: 15px;"
                     :href="item.filePath"
                     v-for="item in basicInfoData.attachmentList"
@@ -149,6 +150,7 @@
                 <div v-if="basicInfoData&&basicInfoData.attachmentList&&basicInfoData.attachmentList.length">
                   <a
                     target="_blank"
+                    id="allocateBillDetail-attachmentList"
                     style="color: #00aaff;text-decoration: underline;margin-right: 15px;"
                     :href="item.filePath"
                     v-for="item in basicInfoData.attachmentList"
@@ -202,9 +204,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import printModal from './printModal.vue'
 import { printBase64Fun, exportExcel } from '@/libs/JGPrint.js'
+// 接口
 import { allocateBillDetailList, allocateBillDetail, allocateBillDetailCount, allocateBillDetailPrint, allocateBillDetailExcel } from '@/api/allocateBill'
 export default {
   name: 'TransferOutDetail',
@@ -222,10 +226,12 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
+        // 获取列表数据  有分页
         return allocateBillDetailList(Object.assign(parameter, { allocateSn: this.outBizSn || this.$route.params.sn })).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -238,17 +244,19 @@ export default {
       },
       basicInfoData: null, //  基本信息
       productTotal: null, //  合计
-      localDataSource: [],
-      openModal: false,
-      nowType: null,
-      showDetail: false,
-      tableHeight: 0
+      localDataSource: [], // 表格数据
+      openModal: false, // 打印导出弹窗
+      nowType: null, // dbflExport 调拨分类 dbPrint调拨
+      showDetail: false, // 显示隐藏基础信息
+      tableHeight: 0// 计算表格高度
     }
   },
   computed: {
+    // 是否显示基础信息编辑按钮
     isEdit () {
       return this.basicInfoData && ((this.basicInfoData.state == 'WAIT_SUBMIT') || (this.basicInfoData.state == 'WAIT_AUDIT') || (this.basicInfoData.state == 'AUDIT_REJECT')) && this.$hasPermissions('M_transferOut_edit')
     },
+    // 表头
     columns () {
       const _this = this
       const arr = [
@@ -278,6 +286,7 @@ export default {
     }
   },
   watch: {
+    // 基础信息显示关闭  表格高度变化
     showDetail (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -356,12 +365,14 @@ export default {
           printType: taskName + '打印'
         }, !this.basicInfoData.printState || this.basicInfoData.printState == 'UNABLE_PRINT' || this.basicInfoData.printState == 'CANCEL_PRINT')
     },
+    // 初始化
     pageInit () {
       this.$refs.table.refresh(true)
       this.getDetail()
       this.getDetailCount()
       this.setTableH()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 280

+ 25 - 19
src/views/allocationManagement/transferOut/dsModal.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     centered
-    class="dealerAccountEdit-modal"
+    class="transferOutDs-modal"
     :footer="null"
     :maskClosable="false"
     title="提交调拨单"
@@ -12,7 +12,7 @@
     <div>
       <a-spin :spinning="spinning" tip="Loading...">
         <a-form-model
-          id="dealerAccountEdit-form"
+          id="transferOutDs-form"
           ref="ruleForm"
           :model="form"
           :rules="rules"
@@ -20,11 +20,11 @@
           :wrapper-col="formItemLayout.wrapperCol"
         >
           <a-form-model-item label="收货客户名称" v-if="dealerLevel != 'OTHER'">
-            <dealerSubareaScopeList ref="custList" defValKey="buyerSn" @change="custChange" v-model="form.receiverSn" />
+            <dealerSubareaScopeList id="transferOutDs-custList" ref="custList" defValKey="buyerSn" @change="custChange" v-model="form.receiverSn" />
           </a-form-model-item>
           <a-form-model-item label="收货客户名称" v-else>
             <a-input
-              id="dealerAccountEdit-receiverName"
+              id="transferOutDs-receiverName"
               :maxLength="30"
               v-model.trim="form.receiverName"
               placeholder="请输入收货客户名称"
@@ -32,7 +32,7 @@
           </a-form-model-item>
           <a-form-model-item label="发货编号" prop="sendNo">
             <a-input
-              id="dealerAccountEdit-phone"
+              id="transferOutDs-sendNo"
               :maxLength="10"
               v-model.trim="form.sendNo"
               placeholder="请输入发货编号"
@@ -43,29 +43,29 @@
           </a-form-model-item>
           <a-form-model-item label="发货说明">
             <a-input
-              id="dealerAccountEdit-explainInfo"
+              id="transferOutDs-explainInfo"
               type="textarea"
               :maxLength="630"
               v-model.trim="form.explainInfo"
               placeholder="请输入发货说明"/>
           </a-form-model-item>
           <a-form-model-item label="备货打印" prop="printState">
-            <a-radio-group v-model="form.printState">
-              <a-radio value="NO_PRINT">
+            <a-radio-group id="transferOutDs-printState" v-model="form.printState">
+              <a-radio value="NO_PRINT" id="transferOutDs-printState1">
                 允许打印
               </a-radio>
-              <a-radio value="UNABLE_PRINT">
+              <a-radio value="UNABLE_PRINT" id="transferOutDs-printState2">
                 暂不打印
               </a-radio>
-              <a-radio value="CANCEL_PRINT">
+              <a-radio value="CANCEL_PRINT" id="transferOutDs-printState3">
                 取消打印
               </a-radio>
             </a-radio-group>
           </a-form-model-item>
         </a-form-model>
         <div class="btn-cont">
-          <a-button type="primary" id="dealerAccountEdit-save" @click="handleSave">确定</a-button>
-          <a-button id="dealerAccountEdit-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+          <a-button type="primary" id="transferOutDs-save" @click="handleSave">确定</a-button>
+          <a-button id="transferOutDs-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
         </div>
       </a-spin>
     </div>
@@ -74,9 +74,10 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 export default {
-  name: 'DealerAccountEditModal',
+  name: 'TransferOutDsModal',
   mixins: [commonMixin],
   components: { dealerSubareaScopeList },
   props: {
@@ -93,17 +94,20 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      // form表单label布局
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 18 }
       },
+      // 提交参数
       form: {
-        sendNo: '',
-        printState: '',
-        receiverSn: '',
-        receiverName: '',
-        explainInfo: ''
+        sendNo: '', // 发货编号
+        printState: '', // 备货打印状态
+        receiverSn: '', // 收货客户sn
+        receiverName: '', // 收货客户名称
+        explainInfo: ''// 发货说明
       },
+      // 表单验证规则
       rules: {
         sendNo: [{ required: true, message: '请输入发货编号', trigger: 'change' }],
         printState: [{ required: true, message: '请选择备货打印', trigger: 'change' }]
@@ -112,10 +116,12 @@ export default {
     }
   },
   methods: {
+    // 获取常用发货编号
     setSendNo (i) {
       this.form.sendNo = i
       this.$refs.ruleForm.validateField('sendNo')
     },
+    // 收货客户名称
     custChange (val) {
       this.form.receiverSn = val.key || ''
       this.form.receiverName = val.name || ''
@@ -171,7 +177,7 @@ export default {
 </script>
 
 <style lang="less">
-  .dealerAccountEdit-modal{
+  .transferOutDs-modal{
     .ant-modal-body {
       padding: 40px 40px 24px;
     }

+ 58 - 36
src/views/allocationManagement/transferOut/edit.vue

@@ -6,7 +6,7 @@
         <template slot="subTitle">
           <a id="allocateBillEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ basicInfoData&&basicInfoData.allocateNo }}</span>
-          <a-button type="link" class="button-default" @click="showDetail=!showDetail">
+          <a-button type="link" id="allocateBillEdit-showDetail" class="button-default" @click="showDetail=!showDetail">
             <a-icon :type="showDetail ? 'eye-invisible' : 'eye'"/> {{ showDetail?'隐藏':'查看' }}信息
           </a-button>
         </template>
@@ -17,7 +17,7 @@
             type="primary"
             class="button-info"
             v-if="$hasPermissions('B_transferOut_print')"
-            id="allocateBillEdit-db-print-btn"
+            id="allocateBillEdit-dbPrint-btn"
             :disabled="localDataSource.length==0"
             @click="handlePrint('dbPrint')">调拨打印</a-button>
           <a-button
@@ -25,7 +25,7 @@
             type="default"
             class="button-info"
             v-if="$hasPermissions('B_transferOutType_print')"
-            id="allocateBillEdit-dbfl-print-btn"
+            id="allocateBillEdit-dbflPrint-btn"
             :disabled="localDataSource.length==0"
             @click="handlePrint('dbflPrint')">调拨分类打印</a-button>
           <a-divider type="vertical" />
@@ -42,7 +42,7 @@
             type="default"
             class="button-info"
             v-if="$hasPermissions('B_transferOutType_export')"
-            id="allocateBillDetail-export-btn"
+            id="allocateBillDetail-exportType-btn"
             :disabled="localDataSource.length==0"
             @click="handlePrint('dbflExport')">调拨分类导出</a-button>
         </template>
@@ -91,6 +91,7 @@
               <div v-if="basicInfoData&&basicInfoData.attachmentList&&basicInfoData.attachmentList.length">
                 <a
                   target="_blank"
+                  id="allocateBillDetail-attachmentList"
                   style="color: #00aaff;text-decoration: underline;margin-right: 15px;"
                   :href="item.filePath"
                   v-for="item in basicInfoData.attachmentList"
@@ -107,7 +108,7 @@
       <a-card size="small" title="选择产品" :bordered="false" class="allocateBillEdit-cont">
         <!-- 筛选条件 -->
         <div class="table-page-search-wrapper">
-          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-form layout="inline" id="allocateBillDetail-form" @keyup.enter.native="$refs.table.refresh(true)">
             <a-row :gutter="15">
               <a-col :md="6" :sm="24">
                 <a-form-item label="产品编码" prop="productCode">
@@ -125,8 +126,8 @@
                 </a-form-item>
               </a-col>
               <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: 8px" @click="resetSearchForm(0)" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="allocateBillEdit-refresh">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm(0)" :disabled="disabled" id="allocateBillEdit-reset">重置</a-button>
               </a-col>
             </a-row>
           </a-form>
@@ -138,7 +139,7 @@
           size="small"
           index="0"
           tableId="table1"
-          :rowKey="(record) => record.stockSn"
+          :rowKey="(record) => record.id"
           :columns="columns"
           :customRow="handleClickRow"
           :data="loadData"
@@ -158,6 +159,7 @@
             <div v-else>
               <span v-if="record.powerFlag!=0">{{ record.priceLevelDictValue }}</span>
               <v-select
+                :id="'allocateBillEdit-priceLevelDictValue'+record.id"
                 v-else
                 style="width:90%;"
                 size="small"
@@ -172,6 +174,7 @@
           <template slot="qty" slot-scope="text, record">
             <a-input-number
               size="small"
+              :id="'allocateBillEdit-qty'+record.id"
               v-model="record.qty"
               :precision="0"
               :min="1"
@@ -182,6 +185,7 @@
           <!-- 操作 -->
           <template slot="action1" slot-scope="text, record">
             <a-button
+              :id="'allocateBillEdit-add-btn'+record.id"
               size="small"
               type="link"
               class="button-primary"
@@ -205,21 +209,21 @@
         <a-row :gutter="15">
           <a-col :span="16">
             <div class="table-page-search-wrapper">
-              <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
+              <a-form id="allocateBillEdit-form-search" layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
                 <a-row :gutter="15">
                   <a-col :md="9" :sm="24">
                     <a-form-item label="产品编码" prop="productCode">
-                      <a-input id="allocateBillEdit-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
+                      <a-input id="allocateBillEdit-select-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="allocateBillEdit-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
+                      <a-input id="allocateBillEdit-select-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="storeTransferOutList-refresh">查询</a-button>
-                    <a-button style="margin-left: 8px" @click="chooseResetSearchForm(0)" :disabled="chooseDisabled" id="storeTransferOutList-reset">重置</a-button>
+                    <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="allocateBillEdit-select-refresh">查询</a-button>
+                    <a-button style="margin-left: 8px" @click="chooseResetSearchForm(0)" :disabled="chooseDisabled" id="allocateBillEdit-select-reset">重置</a-button>
                   </a-col>
                 </a-row>
               </a-form>
@@ -229,10 +233,10 @@
             <span v-if="selNums">已选{{ selNums }}项</span>
             <a-button
               style="margin:0 10px;"
-              id="salesEdit-plDel-btn"
+              id="allocateBillEdit-plDel-btn"
               @click="openPlSet">批量设置费用归属</a-button>
             <a-button id="allocateBillEdit-import-btn" @click="openGuideModal=true">导入产品</a-button>
-            <a-button type="danger" style="margin-left: 10px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button>
+            <a-button type="danger" style="margin-left: 10px" @click.stop="handleDel('', 'all')" id="allocateBillEdit-del-all-btn">整单删除</a-button>
           </a-col>
         </a-row>
         <!-- 列表 -->
@@ -258,7 +262,7 @@
             <div v-if="$route.params.dealerLevel == 'OTHER'">
               <a-select
                 size="small"
-                id="allocateBillEdit-price"
+                :id="'allocateBillEdit-select-price'+record.id"
                 option-label-prop="label"
                 v-model="record.price"
                 placeholder="请选择"
@@ -277,7 +281,7 @@
           <template slot="qty" slot-scope="text, record">
             <a-input-number
               size="small"
-              id="allocateBillEdit-qty"
+              :id="'allocateBillEdit-select-qty'+record.id"
               v-model="record.qty"
               :precision="0"
               :min="1"
@@ -291,6 +295,7 @@
             <a-select
               style="width:100%"
               placeholder="请选择部门"
+              :id="'allocateBillEdit-departmentSn'+record.id"
               size="small"
               allowClear
               v-model="record.departmentSn"
@@ -298,7 +303,7 @@
               @change="e => handleChange(e, record)"
               option-filter-prop="children"
               :filter-option="filterOption">
-              <a-select-option v-for="item in departmentList" :key="item.departmentSn" :value="item.departmentSn">{{ item.name }}</a-select-option>
+              <a-select-option :id="'allocateBillEdit-departmentSn'+item.departmentSn" v-for="item in departmentList" :key="item.departmentSn" :value="item.departmentSn">{{ item.name }}</a-select-option>
             </a-select>
           </template>
           <!-- 操作 -->
@@ -309,7 +314,7 @@
               class="button-error"
               :loading="spinning"
               @click="handleDel(record)"
-              id="allocateBillEdit-del-btn">删除</a-button>
+              :id="'allocateBillEdit-del-btn'+record.id">删除</a-button>
           </template>
         </s-table>
       </a-card>
@@ -363,6 +368,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import ImportGuideModal from './importGuideModal.vue'
 import basicInfoModal from './basicInfoModal.vue'
@@ -370,6 +376,7 @@ import printModal from './printModal.vue'
 import dsModal from './dsModal.vue'
 import commonModal from '@/views/common/commonModal.vue'
 import { printBase64Fun, exportExcel } from '@/libs/JGPrint.js'
+// 接口
 import { queryStockProductForOtherPage } from '@/api/stock'
 import { productPriceInfo } from '@/api/product'
 import { departmentQueryList } from '@/api/expenseManagement'
@@ -382,33 +389,37 @@ export default {
   data () {
     return {
       spinning: false,
-      showDsModal: false,
-      editRemark: false,
-      showPlModal: false,
+      showDsModal: false, // 提交调拨单弹窗
+      editRemark: false, // 编辑基础信息弹窗
+      showPlModal: false, // 批量设置部门弹窗
       showDetail: false, // 基础信息
+      // 查询条件
       queryParam: {
-        productCode: '',
-        productName: '',
-        productOrigCode: ''
+        productCode: '', // 产品编码
+        productName: '', // 产品名称
+        productOrigCode: ''// 原厂编码
       },
+      // 已选产品查询条件
       chooseQueryParam: {
-        productCode: '',
-        productName: ''
+        productCode: '', // 产品编码
+        productName: ''// 产品名称
       },
       disabled: false, //  查询、重置按钮是否可操作
-      loading: false,
+      loading: false, // 表格加载状态
       chooseDisabled: false, //  查询、重置按钮是否可操作
       advanced: false, // 高级搜索 展开/关闭
       departmentList: [], // 部门列表
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        // 获取列表数据 有分页
         const dealerLevel = this.dealerLevel == 'OTHER' ? undefined : this.dealerLevel
         const warehouseSn = this.basicInfoData.warehouseSn
         const fun = this.dealerLevel == 'OTHER' ? queryStockProductForOtherPage : queryStockProductPage
         const dealerSnInfo = this.dealerLevel != 'OTHER' ? this.basicInfoData.dealerInfo.dealerSn : undefined
         return fun(Object.assign(parameter, this.queryParam, { zeroQtyFlag: '0', dealerLevel: dealerLevel, warehouseSn: warehouseSn, dealerSn: dealerSnInfo })).then(res => {
           const data = res.data
+          // 计算表格序号
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
@@ -420,14 +431,16 @@ export default {
           return data
         })
       },
-      loadDataSource: [],
-      localDataSource: [],
+      loadDataSource: [], // 调拨列表数据
+      localDataSource: [], // 调拨已选数据
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
         this.chooseDisabled = true
+        // 获取已选列表数据  有分页
         const params = Object.assign(parameter, this.chooseQueryParam, { allocateSn: this.allocateSn })
         return allocateBillDetailList(params).then(res => {
           const data = res.data
+          // 计算表格序号
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
@@ -444,18 +457,20 @@ export default {
       productTotal: null, //  合计
       basicInfoData: null, // 基本信息
       openGuideModal: false, //  导入产品引导
-      openModal: false,
-      nowType: null,
-      rowSelectionInfo: null,
-      plSetVal: undefined,
-      dealerLevel: undefined,
-      allocateSn: undefined
+      openModal: false, // 打印预览/快捷打印弹窗
+      nowType: null, // 打印预览/快捷打印 类型
+      rowSelectionInfo: null, // 已选数据集合
+      plSetVal: undefined, // 部门sn
+      dealerLevel: undefined, // 经销商等级
+      allocateSn: undefined// 调拨sn
     }
   },
   computed: {
+    // 计算已选产品条数
     selNums () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
     },
+    // 表头
     columns () {
       const _this = this
       const arr = [
@@ -483,6 +498,7 @@ export default {
       }
       return arr
     },
+    // 已选列表表头
     chooseColumns () {
       const _this = this
       const arr = [
@@ -536,10 +552,12 @@ export default {
         this.$message.warning('请先选择产品!')
       }
     },
+    // 关闭批量设置费用归属部门弹窗
     closePlSet () {
       this.showPlModal = false
       this.plSetVal = undefined
     },
+    // 批量设置费用归属部门成功
     setPlSetOk () {
       if (!this.plSetVal) {
         this.$message.warning('请选择费用归属部门!')
@@ -700,6 +718,7 @@ export default {
         this.$message.warning('请选择产品')
       }
     },
+    // 提交
     handleSubmit (params) {
       const _this = this
       const data = Object.assign({ allocateSn: this.$route.params.sn }, params || {})
@@ -791,6 +810,7 @@ export default {
         _this.$store.state.app.curActionPermission = ''
       })
     },
+    // 打印导出
     exportFl (data) {
       this.handleExcel(data.printType, '调拨分类', data)
     },
@@ -799,6 +819,7 @@ export default {
       this.nowType = type
       this.openModal = true
     },
+    // 打印调拨分类、调拨 成功
     handleOk (objs) {
       const _this = this
       const params = JSON.parse(JSON.stringify(objs))
@@ -828,6 +849,7 @@ export default {
       this.$refs.chooseTable.clearSelected()
       this.$refs.chooseTable.refresh()
     },
+    // 初始化
     pageInit () {
       this.dealerLevel = this.$route.params.dealerLevel
       this.allocateSn = this.$route.params.sn

+ 14 - 5
src/views/allocationManagement/transferOut/importGuideModal.vue

@@ -19,7 +19,13 @@
             <li>2) 除了“产品编码”、“数量”两列,其他列可自定义,不影响数据导入</li>
             <li>3) 如果导入的产品已经存在,则不会导入该行</li>
           </ul>
-          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" :loading="exportLoading" @click="handleExport">下载导入模板</a-button>
+          <a-button
+            id="importGuide-download"
+            type="link"
+            icon="download"
+            style="padding: 0 0 0 23px;"
+            :loading="exportLoading"
+            @click="handleExport">下载导入模板</a-button>
         </div>
         <div class="explain-item">
           <div class="explain-tit">
@@ -64,8 +70,10 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import ChooseImportModal from './chooseImportModal.vue'
 import { Upload } from '@/components'
+// 接口
 import { allocateBillDownload } from '@/api/allocateBill'
 export default {
   name: 'TransferOutImportGuideModal',
@@ -85,12 +93,12 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       openImportModal: false, //  导入
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
-      paramsData: null,
-      uploadParams: {
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload', // 上传文件路径
+      paramsData: null, // 上传参数
+      uploadParams: { // 上传参数
         savePathType: 'local'
       },
-      exportLoading: false
+      exportLoading: false// 导出按钮加载状态
     }
   },
   methods: {
@@ -146,6 +154,7 @@ export default {
         }
       })
     },
+    // 下载模板
     download (data) {
       if (!data) { return }
       const url = window.URL.createObjectURL(new Blob([data]))

+ 55 - 44
src/views/allocationManagement/transferOut/list.vue

@@ -3,27 +3,27 @@
     <a-card size="small" :bordered="false" class="searchBoxNormal">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" id="transferOutList-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate ref="rangeDate" id="transferOutList-time" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="调往对象">
-                <a-input id="allocateBillList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调往对象"/>
+                <a-input id="transferOutList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调往对象"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="费用/调拨类型">
-                <AllocateType id="allocateBillList-costTypeName" v-model="allocateTypeVal" :changeOnSelect="true" placeholder="请选择费用/调拨类型" @change="changeAllocatype"></AllocateType>
+                <AllocateType id="transferOutList-costTypeName" v-model="allocateTypeVal" :changeOnSelect="true" placeholder="请选择费用/调拨类型" @change="changeAllocatype"></AllocateType>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-item label="收货客户名称">
-                  <dealerSearchList ref="receiverSn" @change="custChange" />
+                  <dealerSearchList id="transferOutList-receiverName" ref="receiverSn" @change="custChange" />
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -31,7 +31,7 @@
                   <v-select
                     v-model="queryParam.state"
                     ref="state"
-                    id="allocateBillList-state"
+                    id="transferOutList-state"
                     code="ALLOCATE_STATUS"
                     placeholder="请选择业务状态"
                     allowClear
@@ -40,7 +40,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="调拨单号">
-                  <a-input id="allocateBillList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
+                  <a-input id="transferOutList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -48,7 +48,7 @@
                   <warehouse
                     isPermission
                     v-model="queryParam.warehouseSn"
-                    id="allocateBillList-warehouseSn"
+                    id="transferOutList-warehouseSn"
                     placeholder="请选择调出仓库"
                   />
                 </a-form-item>
@@ -58,7 +58,7 @@
                   <v-select
                     v-model="queryParam.printState"
                     ref="printState"
-                    id="allocateBillList-printState"
+                    id="transferOutList-printState"
                     code="PRINT_STATUS"
                     placeholder="请选择打印状态"
                     allowClear
@@ -70,7 +70,7 @@
                   <v-select
                     v-model="queryParam.checkStatus"
                     ref="checkStatus"
-                    id="allocateBillList-checkStatus"
+                    id="transferOutList-checkStatus"
                     code="CHECK_STATUS"
                     placeholder="请选择对单状态"
                     allowClear
@@ -79,13 +79,13 @@
               </a-col>
               <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
                 <a-form-item label="客服">
-                  <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
+                  <customerService id="transferOutList-bizUserSn" ref="customerName" v-model="queryParam.bizUserSn"></customerService>
                 </a-form-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="allocateBillList-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="allocateBillList-reset">重置</a-button>
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="transferOutList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="transferOutList-reset">重置</a-button>
               <a-button
                 style="margin-left: 5px"
                 type="primary"
@@ -94,8 +94,8 @@
                 @click="handleExport"
                 :disabled="disabled"
                 :loading="exportLoading"
-                id="allocateBillList-export">导出</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 5px">
+                id="transferOutList-export">导出</a-button>
+              <a @click="advanced=!advanced" id="transferOutList-advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -108,7 +108,7 @@
       <a-spin :spinning="spinning" tip="Loading...">
         <!-- 操作按钮 -->
         <div class="table-operator">
-          <a-button v-if="$hasPermissions('B_transferOut_add')" id="allocateBillList-add" type="primary" @click="openModal=true">新增</a-button>
+          <a-button v-if="$hasPermissions('B_transferOut_add')" id="transferOutList-add" type="primary" @click="openModal=true">新增</a-button>
         </div>
         <!-- 列表 -->
         <s-table
@@ -124,7 +124,7 @@
           bordered>
           <!-- 单号 -->
           <template slot="allocateNo" slot-scope="text, record">
-            <span v-if="$hasPermissions('M_transferOut_detail')" class="link-bule" @click="handleDetail(record)">{{ record.allocateNo }}</span>
+            <span v-if="$hasPermissions('M_transferOut_detail')" :id="'transferOutList-detail'+record.id" class="link-bule" @click="handleDetail(record)">{{ record.allocateNo }}</span>
             <span v-else>{{ record.allocateNo }}</span>
           </template>
           <!-- 起止时间 -->
@@ -144,7 +144,7 @@
           <template slot="printStateWord" slot-scope="text, record">
             <span v-if="record.printState">
               <span v-if="record.printState=='NO_PRINT'||record.printState=='PRINT'">{{ record.printStateDictValue }}</span>
-              <span @click="handlePrint(record)" class="link-bule" v-else>{{ record.printStateDictValue }}</span>
+              <span :id="'transferOutList-print'+record.id" @click="handlePrint(record)" class="link-bule" v-else>{{ record.printStateDictValue }}</span>
             </span>
             <span v-else>--</span>
           </template>
@@ -156,28 +156,28 @@
             v-if="record.state == 'WAIT_AUDIT' && record.printState!='UNABLE_PRINT' && record.printState!='NO_PRINT' && $hasPermissions('B_tfo_yxPrint')"
             class="button-warning"
             @click="handleYxPrint(record)"
-            id="allocateBillList-examine-btn">允许打印</a-button> -->
+            id="transferOutList-examine-btn">允许打印</a-button> -->
             <a-button
               size="small"
               type="link"
               v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_transferOut_audit')"
               class="button-warning"
               @click="handleExamine(record)"
-              id="allocateBillList-examine-btn">审核</a-button>
+              :id="'transferOutList-audit-btn'+record.id">审核</a-button>
             <a-button
               size="small"
               type="link"
               v-if="((record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT') || (record.state == 'AUDIT_REJECT')) && $hasPermissions('M_transferOut_edit')"
               class="button-info"
               @click="handleEdit(record)"
-              id="allocateBillList-edit-btn">编辑</a-button>
+              :id="'transferOutList-edit-btn'+record.id">编辑</a-button>
             <a-button
               size="small"
               type="link"
               v-if="((record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT') || (record.state == 'AUDIT_REJECT')) && $hasPermissions('B_transferOut_del')"
               class="button-error"
               @click="handleDel(record)"
-              id="allocateBillList-del-btn">删除</a-button>
+              :id="'transferOutList-del-btn'+record.id">删除</a-button>
             <span v-if="((record.state != 'WAIT_SUBMIT') && (record.state != 'WAIT_AUDIT') && (record.state != 'AUDIT_REJECT'))||(!$hasPermissions('B_transferOut_audit') && !$hasPermissions('M_transferOut_edit') && !$hasPermissions('B_transferOut_del'))">--</span>
           </template>
         </s-table>
@@ -202,6 +202,8 @@
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import basicInfoModal from './basicInfoModal.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
@@ -209,10 +211,10 @@ import auditModal from '@/views/common/auditModal.vue'
 import warehouse from '@/views/common/chooseWarehouse.js'
 import customerService from '@/views/common/customerService'
 import dealerSearchList from '@/views/common/dealerSearchList.vue'
-import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport, allocateBillAblePrint } from '@/api/allocateBill'
 import AllocateType from '@/views/common/allocateType.js'
-import { hdExportExcel } from '@/libs/exportExcel'
 import printModal from './printStatusModal.vue'
+// 接口
+import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport, allocateBillAblePrint } from '@/api/allocateBill'
 export default {
   name: 'TransferOutList',
   mixins: [commonMixin],
@@ -221,38 +223,42 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      // 创建时间
       time: [
         moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ],
-      allocateTypeVal: [],
-      queryParam: { //  查询条件
-        beginDate: getDate.getThreeMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
+      allocateTypeVal: [], // 费用/调拨类型
+      //  查询条件
+      queryParam: {
+        beginDate: getDate.getThreeMonthDays().starttime, // 开始创建时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束创建时间
         targetName: '', //  调往对象
         costTypeSn: undefined, // 费用类型
         allocateSortSn: undefined, //  调拨类型1
         allocateTypeSn: undefined, //  调拨类型2
         state: undefined, //  业务状态
         allocateNo: '', //  调拨单号
-        receiverSn: undefined,
-        checkStatus: undefined,
-        printState: undefined,
-        warehouseSn: undefined,
-        bizUserSn: undefined
+        receiverSn: undefined, // 收货客户名称
+        checkStatus: undefined, // 对单状态
+        printState: undefined, // 打印状态
+        warehouseSn: undefined, // 出库仓库
+        bizUserSn: undefined // 客服
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
-      printIsShow: false,
+      printIsShow: false, // 打印弹窗
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据 有分页
         return allocateBillList(Object.assign(parameter, this.queryParam, { authWarehouseFlag: 1 })).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -263,16 +269,15 @@ export default {
           return data
         })
       },
-      visibleAudit: false,
-      auditInfo: null,
-      spinningAudit: false,
+      visibleAudit: false, // 审核弹窗
+      auditInfo: null, // 审核当前行数据
+      spinningAudit: false, // 审核按钮加载状态
       openModal: false, //  新增编辑  弹框
-      printInfo: null
+      printInfo: null// 打印当前行信息
     }
   },
   computed: {
-    // dataIndex: 'printStateDictValue',
-    columns () {
+    columns () { // 表头
       const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', width: '3.5%', align: 'center' },
@@ -311,6 +316,7 @@ export default {
       this.printIsShow = false
       this.$refs.table.refresh(true)
     },
+    // 收货客户名称
     custChange (val) {
       if (val.row) {
         this.queryParam.receiverSn = val.row.dealerSn
@@ -325,6 +331,7 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    // 费用/调拨类型
     changeAllocatype (val, opts) {
       this.allocateTypeVal = val || []
       this.queryParam.costTypeSn = val && val[0] ? val[0] : ''
@@ -398,7 +405,7 @@ export default {
         }
       })
     },
-    //  审核
+    //  打开审核弹窗
     handleExamine (row) {
       this.auditInfo = row
       this.visibleAudit = true
@@ -442,6 +449,7 @@ export default {
         _this.$store.state.app.curActionPermission = ''
       })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -449,10 +457,12 @@ export default {
       })
       this.openModal = false
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 240
     },
+    // 打印
     handlePrint (item) {
       const obj = {
         no: item.allocateNo,
@@ -467,6 +477,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭  监听表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 31 - 23
src/views/allocationManagement/transferOut/printModal.vue

@@ -22,7 +22,7 @@
         <a-form-model-item style="margin-bottom: 0;" label="发货编号">{{ itemData&&itemData.sendNo || '--' }}</a-form-model-item>
         <a-form-model-item style="margin-bottom: 0;" label="收货客户名称">{{ itemData&&itemData.receiverName || '--' }}</a-form-model-item>
         <a-form-model-item style="margin-bottom: 0;" label="产品分类" prop="id" v-if="nowType=='dbflPrint'||nowType=='dbflExport'">
-          <a-select id="allocateBill-print-form" v-model="form.id" placeholder="请选择产品分类">
+          <a-select id="allocateBill-print-typeList" v-model="form.id" placeholder="请选择产品分类">
             <a-select-option v-for="item in typeList" :value="item.id" :key="item.id">
               <span v-if="item.id != 'all'">{{ item.productBrandName }} - {{ item.productTypeName3 }}</span>
               <span v-else>全部</span>
@@ -30,37 +30,37 @@
           </a-select>
         </a-form-model-item>
         <a-form-model-item label="货位编号" prop="orderBy" v-if="nowType=='dbflPrint'">
-          <a-radio-group v-model="form.orderBy">
-            <a-radio value="ASC">打印(↑升序)</a-radio>
-            <a-radio value="DESC">打印(↓降序)</a-radio>
-            <a-radio value="-1">不打印</a-radio>
+          <a-radio-group v-model="form.orderBy" id="allocateBill-print-orderBy">
+            <a-radio value="ASC" id="allocateBill-print-orderBy-asc">打印(↑升序)</a-radio>
+            <a-radio value="DESC" id="allocateBill-print-orderBy-desc">打印(↓降序)</a-radio>
+            <a-radio value="-1" id="allocateBill-print-orderBy-1">不打印</a-radio>
           </a-radio-group>
         </a-form-model-item>
         <a-form-model-item label="产品价格" style="margin-bottom: 0;" prop="priceType" v-if="nowType=='dbPrint'">
-          <a-radio-group v-model="form.priceType">
-            <a-radio value="ALLOCATE_BILL_PRICE" v-if="$hasPermissions('B_transferOut_print_salesPrice')">销售价</a-radio>
-            <a-radio value="ALLOCATE_BILL_COST" v-if="$hasPermissions('B_transferOut_print_costPrice')">成本价</a-radio>
-            <a-radio value="ALLOCATE_BILL">不打印</a-radio>
+          <a-radio-group v-model="form.priceType" id="allocateBill-print-priceType">
+            <a-radio value="ALLOCATE_BILL_PRICE" id="allocateBill-print-priceType1" v-if="$hasPermissions('B_transferOut_print_salesPrice')">销售价</a-radio>
+            <a-radio value="ALLOCATE_BILL_COST" id="allocateBill-print-priceType2" v-if="$hasPermissions('B_transferOut_print_costPrice')">成本价</a-radio>
+            <a-radio value="ALLOCATE_BILL" id="allocateBill-print-priceType3">不打印</a-radio>
           </a-radio-group>
         </a-form-model-item>
         <a-form-model-item label="产品价格" style="margin-bottom: 0;" prop="priceType" v-if="nowType=='dbExport'">
-          <a-radio-group v-model="form.priceType">
-            <a-radio value="ALLOCATE_BILL_PRICE" v-if="$hasPermissions('B_transferOut_detail_export_salesPrice')">销售价</a-radio>
-            <a-radio value="ALLOCATE_BILL_COST" v-if="$hasPermissions('B_transferOut_detail_export_costPrice')">成本价</a-radio>
-            <a-radio value="ALLOCATE_BILL">不导出</a-radio>
+          <a-radio-group v-model="form.priceType" id="allocateBill-print-priceType">
+            <a-radio value="ALLOCATE_BILL_PRICE" id="allocateBill-print-priceType1" v-if="$hasPermissions('B_transferOut_detail_export_salesPrice')">销售价</a-radio>
+            <a-radio value="ALLOCATE_BILL_COST" id="allocateBill-print-priceType2" v-if="$hasPermissions('B_transferOut_detail_export_costPrice')">成本价</a-radio>
+            <a-radio value="ALLOCATE_BILL" id="allocateBill-print-priceType3">不导出</a-radio>
           </a-radio-group>
         </a-form-model-item>
         <a-form-model-item label="备注" v-if="nowType=='dbPrint'">
-          <a-checkbox @change="onChangeRemark" :checked="remarkFlag">
+          <a-checkbox @change="onChangeRemark" :checked="remarkFlag" id="allocateBill-print-remark">
             打印
           </a-checkbox>
         </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
-        <a-button id="allocateBill-print-close" @click="handleClose('preview')">取消</a-button>
+        <a-button id="allocateBill-printcancel" @click="handleClose('preview')">取消</a-button>
         <a-button
           v-if="nowType=='dbflPrint'||nowType=='dbPrint'"
-          id="allocateBill-print-save"
+          id="allocateBill-print-dbflPrint"
           type="primary"
           class="button-info"
           @click="handleSave('preview')"
@@ -68,13 +68,13 @@
         <a-button
           v-if="hidePrint&&(nowType=='dbflPrint'||nowType=='dbPrint')"
           type="primary"
-          id="allocateBill-print-back"
+          id="allocateBill-print-dbflPrint"
           @click="handleSave('print')"
           style="margin-left: 15px;">确定打印</a-button>
         <a-button
           v-if="nowType=='dbflExport'||nowType=='dbExport'"
           type="primary"
-          id="allocateBill-print-back"
+          id="allocateBill-print-export"
           @click="handleSave('export')"
           style="margin-left: 15px;">确定导出</a-button>
       </div>
@@ -104,27 +104,32 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
+      // 提交参数
       form: {
-        id: 'all',
-        priceType: 'ALLOCATE_BILL',
-        orderBy: undefined,
+        id: 'all', // 产品分类
+        priceType: 'ALLOCATE_BILL', // 产品价格
+        orderBy: undefined, // 排序
         remarkFlag: 1// 备货打印  1打印 0不打印
       },
-      remarkFlag: true,
+      //
+      remarkFlag: true, // 备货打印
+      // 表单验证规则
       rules: {
         id: [{ required: true, message: '请选择产品分类', trigger: 'change' }],
         priceType: [{ required: true, message: '请选择产品价格', trigger: 'change' }],
         orderBy: [{ required: true, message: '请选择货位编号', trigger: 'change' }]
       },
+      // form表单label布局
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 16 }
       },
       spinning: false,
-      typeList: []
+      typeList: []// 产品分类列表数据
     }
   },
   computed: {
+    // 弹窗标题
     modalTit () {
       let title = ''
       if (this.nowType == 'dbPrint') {
@@ -138,11 +143,13 @@ export default {
       }
       return title
     },
+    // 打印状态
     hidePrint () {
       return this.itemData && this.itemData.printState && this.itemData.printState != 'UNABLE_PRINT' && this.itemData.printState != 'CANCEL_PRINT'
     }
   },
   methods: {
+    // 打印
     onChangeRemark (e) {
       this.remarkFlag = e.target.checked
       this.form.remarkFlag = e.target.checked ? 1 : 0
@@ -214,6 +221,7 @@ export default {
         }
       })
     },
+    // 关闭
     handleClose () {
       this.$emit('close')
       this.$refs.ruleForm.resetFields()

+ 20 - 15
src/views/allocationManagement/transferOut/printStatusModal.vue

@@ -9,7 +9,7 @@
     width="40%">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model
-        id="chooseCustom-form"
+        id="printStatusModal-form"
         ref="ruleForm"
         :model="form"
         :rules="rules"
@@ -22,14 +22,14 @@
           <span>{{ form.targetName }}</span>
         </a-form-model-item>
         <a-form-model-item label="调拨打印:" prop="printStateInfo">
-          <a-radio-group v-model="form.printStateInfo">
-            <a-radio value="NO_PRINT">允许打印</a-radio>
-            <a-radio value="CANCEL_PRINT" v-if="form.printState == 'UNABLE_PRINT'">取消打印</a-radio>
+          <a-radio-group id="printStatusModal-printStateInfo" v-model="form.printStateInfo">
+            <a-radio value="NO_PRINT" id="printStatusModal-printStateInfo1">允许打印</a-radio>
+            <a-radio value="CANCEL_PRINT" v-if="form.printState == 'UNABLE_PRINT'" id="printStatusModal-printStateInfo0">取消打印</a-radio>
           </a-radio-group>
         </a-form-model-item>
         <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;margin-top: 50px;">
-          <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
-          <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">确定</a-button>
+          <a-button @click="cancel" style="margin-right: 15px" id="printStatusModal-cancel-btn">取消</a-button>
+          <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="printStatusModal-submit-btn">确定</a-button>
         </a-form-model-item>
       </a-form-model>
     </a-spin>
@@ -37,6 +37,7 @@
 </template>
 
 <script>
+// 接口
 import { updatePrintState } from '@/api/allocateBill.js'
 export default {
   name: 'PrintModal',
@@ -51,11 +52,11 @@ export default {
   },
   data () {
     return {
-      opened: this.show,
+      opened: this.show, // 打开弹窗
       spinning: false,
-      title: '调拨打印状态',
-
-      confirmLoading: false,
+      title: '调拨打印状态', // 弹窗标题
+      confirmLoading: false, // 确定按钮加载状态
+      // form表单label布局
       formItemLayout: {
         labelCol: {
           span: 6
@@ -64,18 +65,20 @@ export default {
           span: 18
         }
       },
+      // 提交参数
       form: {
-        no: undefined,
+        no: undefined, //
         payerName: undefined,
-        printStatus: '',
-        allocateSn: '',
-        printStateInfo: ''
+        printStatus: '', // 打印状态
+        allocateSn: '', // 调拨单号
+        printStateInfo: ''// 调拨打印状态
       },
+      // 表单验证规则
       rules: { printStateInfo: [{ required: true, message: '请选择调拨打印状态', trigger: 'change' }] }
     }
   },
   methods: {
-    //  保存
+    // 确定保存验证
     handleSubmit () {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
@@ -86,6 +89,7 @@ export default {
         }
       })
     },
+    // 确定保存
     handleSave () {
       const _this = this
       const ajax_form = {
@@ -105,6 +109,7 @@ export default {
         _this.confirmLoading = false
       })
     },
+    // 关闭
     cancel () {
       this.opened = false
       this.$emit('cancel')

+ 49 - 29
src/views/allocationManagement/transferReturn/basicInfoModal.vue

@@ -1,16 +1,17 @@
 <template>
   <a-modal
     centered
-    class="allocateBill-basicInfo-modal"
+    class="transferReturn-basicInfo-modal"
     :footer="null"
     :maskClosable="false"
     title="新增调拨退货"
     v-model="isShow"
     @cancel="isShow = false"
     :width="800">
+    <!-- 搜索条件 -->
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model
-        id="allocateBill-basicInfo-form"
+        id="transferReturn-basicInfo-form"
         ref="ruleForm"
         :model="form"
         :rules="rules"
@@ -21,7 +22,7 @@
           <v-select
             code="TARGET_TYPE"
             showType="radio"
-            id="allocateBill-basicInfo-targetType"
+            id="transferReturn-basicInfo-targetType"
             v-model="form.targetType"
             @change="targetTypeChange"
             allowClear
@@ -31,7 +32,7 @@
           <a-select
             v-if="isDealer"
             show-search
-            id="allocateBill-basicInfo-dealerName"
+            id="transferReturn-basicInfo-dealerName"
             v-model="form.targetSn"
             placeholder="请输入名称搜索经销商"
             :filter-option="false"
@@ -40,20 +41,32 @@
             @change="handleChange"
           >
             <a-spin v-if="fetching" slot="notFoundContent" size="small" />
-            <a-select-option v-for="item in dealerData" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
+            <a-select-option v-for="item in dealerData" :id="'basicInfo-dealerName'+item.dealerSn" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
           </a-select>
-          <department v-else-if="isDepartment" style="width: 100%;" placeholder="请选择部门" @change="departementChange" v-model="form.targetSn"></department>
-          <a-input v-else v-model.trim="form.targetName" placeholder="请输入调拨退货对象名称(最多30个字符)" allowClear :maxLength="30" />
+          <department
+            v-else-if="isDepartment"
+            id="transferReturn-basicInfo-targetSn"
+            style="width: 100%;"
+            placeholder="请选择部门"
+            @change="departementChange"
+            v-model="form.targetSn"></department>
+          <a-input
+            id="transferReturn-basicInfo-targetName"
+            v-else
+            v-model.trim="form.targetName"
+            placeholder="请输入调拨退货对象名称(最多30个字符)"
+            allowClear
+            :maxLength="30" />
         </a-form-model-item>
         <a-form-model-item label="费用/调拨退货类型" prop="costTypeSn">
-          <AllocateType id="allocateBill-basicInfo-allocateTypeSn" v-model="allocateTypeVal" placeholder="请选择费用/调拨退货类型" @change="allocateTypeChange"></AllocateType>
+          <AllocateType id="transferReturn-basicInfo-allocateTypeVal" v-model="allocateTypeVal" placeholder="请选择费用/调拨退货类型" @change="allocateTypeChange"></AllocateType>
         </a-form-model-item>
         <a-form-model-item label="是否抓单" prop="grabFlag">
           <v-select
             code="FLAG"
             showType="radio"
             :disabled="form.targetType !== 'DEALER'"
-            id="allocateBill-basicInfo-grabFlag"
+            id="transferReturn-basicInfo-grabFlag"
             v-model="form.grabFlag"
             allowClear
             placeholder="请选择"></v-select>
@@ -61,17 +74,17 @@
         <a-form-model-item label="调入仓库" prop="warehouseSn">
           <warehouse
             v-model="form.warehouseSn"
-            id="allocateBill-basicInfo-warehouseSn"
+            id="transferReturn-basicInfo-warehouseSn"
             placeholder="请选择调入仓库"
           />
         </a-form-model-item>
         <a-form-model-item label="备注" prop="remark">
-          <a-textarea id="allocateBill-basicInfo-remark" :maxLength="120" v-model="form.remarks" placeholder="请输入备注(最多120个字符)" allowClear />
+          <a-textarea id="transferReturn-basicInfo-remark" :maxLength="120" v-model="form.remarks" placeholder="请输入备注(最多120个字符)" allowClear />
         </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
-        <a-button type="primary" id="allocateBill-basicInfo-modal-save" @click="handleSave">保存</a-button>
-        <a-button id="allocateBill-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+        <a-button type="primary" id="transferReturn-basicInfo-modal-save" @click="handleSave">保存</a-button>
+        <a-button id="transferReturn-basicInfo-modal-cancel" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
       </div>
     </a-spin>
   </a-modal>
@@ -80,12 +93,14 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import debounce from 'lodash/debounce'
+// 组件
 import { VSelect } from '@/components'
-import { allocateReturnSave, allocateReturnQueryBySn } from '@/api/allocateReturn'
 import department from '@/views/expenseManagement/expenseReimbursement/department.js'
 import warehouse from '@/views/common/chooseWarehouse.js'
-import { dealerSubareaScopeList } from '@/api/dealer'
 import AllocateType from '@/views/common/allocateType.js'
+// 接口
+import { dealerSubareaScopeList } from '@/api/dealer'
+import { allocateReturnSave, allocateReturnQueryBySn } from '@/api/allocateReturn'
 export default {
   name: 'TransferOutBasicInfoModal',
   components: { VSelect, AllocateType, department, warehouse },
@@ -102,22 +117,25 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      // form表单label布局
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 20 }
       },
-      allocateTypeVal: [],
+      allocateTypeVal: [], // 费用/调拨退货类型  下拉数据
+      // 提交参数
       form: {
-        targetType: 'DEALER',
-        targetSn: undefined,
-        targetName: '',
-        costTypeSn: undefined,
-        allocateSortSn: undefined,
-        allocateReturnTypeSn: undefined,
-        warehouseSn: undefined,
-        grabFlag: '1',
-        remarks: ''
+        targetType: 'DEALER', // 调往对象
+        targetSn: undefined, // 调往对象sn
+        targetName: '', // 调往对象名称
+        costTypeSn: undefined, // 费用/调拨退货类型sn
+        allocateSortSn: undefined, // 调拨对象sn
+        allocateReturnTypeSn: undefined, // 调拨类别sn
+        warehouseSn: undefined, // 出库仓库
+        grabFlag: '1', // 是否抓单 1是 0否
+        remarks: ''// 备注
       },
+      // 表单验证规则
       rules: {
         targetType: [{ required: true, message: '请选择调往对象', trigger: 'change' }],
         targetSn: [{ required: true, message: '请选择调往对象名称', trigger: 'change' }],
@@ -126,7 +144,7 @@ export default {
         grabFlag: [{ required: true, message: '请选择是否抓单', trigger: 'change' }],
         warehouseSn: [{ required: true, message: '请选择调入仓库', trigger: 'change' }]
       },
-      fetching: false,
+      fetching: false, // 经销商名称搜索 状态
       dealerData: [] //  经销商  下拉数据
     }
   },
@@ -160,9 +178,10 @@ export default {
       this.form.targetName = this.dealerData[ind].dealerName
       this.form.warehouseSn = this.dealerData[ind].defaultWarehouseSn
     },
+    // 选择部门
     departementChange (v, row) {
-       console.log(v,row)
-       this.form.targetName = row.name
+      console.log(v, row)
+      this.form.targetName = row.name
     },
     // 调拨类别 change
     allocateTypeChange (val, opt) {
@@ -221,6 +240,7 @@ export default {
       this.form.targetType = val
       this.form.grabFlag = val != 'DEALER' ? '0' : '1'
     },
+    // 重置
     resetForm () {
       this.$refs.ruleForm.resetFields()
       this.form = {
@@ -254,7 +274,7 @@ export default {
 </script>
 
 <style lang="less">
-.allocateBill-basicInfo-modal {
+.transferReturn-basicInfo-modal {
 	.ant-modal-body {
 		padding: 40px 40px 24px;
 	}

+ 37 - 29
src/views/allocationManagement/transferReturn/check.vue

@@ -1,17 +1,24 @@
 <template>
-  <div class="salesReturnCheck-wrap">
+  <div class="transferReturnCheck-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
-      <a-page-header :ghost="false" :backIcon="false" class="salesReturnCheck-back" >
+      <a-page-header :ghost="false" :backIcon="false" class="transferReturnCheck-back" >
         <!-- 自定义的二级文字标题 -->
         <template slot="subTitle">
-          <a id="salesReturnCheck-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <a id="transferReturnCheck-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <span style="margin: 0 15px;color: #666;">调拨退货对象名称:{{ ordeDetail&&ordeDetail.targetName || '--' }} ({{ ordeDetail&&ordeDetail.grabFlag==1 ? '抓单' : '不抓单' }})</span>
         </template>
       </a-page-header>
       <a-card size="small" :bordered="false" class="salesReturnCheck-cont">
         <div>
-          <a-button type="primary" :loading="loading" class="button-info" @click="backStock('BATCH_BACK','批量返库')">批量返库</a-button>
-          <a-button v-if="grabFlag==1" type="default" :loading="loading" style="margin-right: 15px;" @click="backStock('BATCH_BAD','批量坏件')">批量坏件</a-button>
+          <!-- 操作按钮 -->
+          <a-button type="primary" id="transferReturnCheck-backStock" :loading="loading" class="button-info" @click="backStock('BATCH_BACK','批量返库')">批量返库</a-button>
+          <a-button
+            v-if="grabFlag==1"
+            id="transferReturnCheck-badStock"
+            type="default"
+            :loading="loading"
+            style="margin-right: 15px;"
+            @click="backStock('BATCH_BAD','批量坏件')">批量坏件</a-button>
           <span>已选 {{ rowSelectionInfo&&rowSelectionInfo.selectedRows.length }} 项</span>
         </div>
         <!-- 已选配件列表 -->
@@ -37,6 +44,7 @@
               v-model="record.backStockQty"
               :precision="0"
               :min="0"
+              :id="'transferReturnCheck-returnQty'+record.ids"
               :max="record.returnQty"
               placeholder="请输入"
               @blur="e => onCellBlur(e.target.value, record)"
@@ -54,55 +62,52 @@
         type="primary"
         class="button-primary"
         @click="handleSubmit()"
-        id="salesReturn-handleSubmit">提交</a-button>
+        id="transferReturnCheck-handleSubmit">提交</a-button>
     </div>
   </div>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
-import {
-  allocReturnDetailQueryPage,
-  allocateReturnQueryBySn,
-  allocateReturnCheckSubmit,
-  allocateReturnCheck
-} from '@/api/allocateReturn'
+import { allocReturnDetailQueryPage, allocateReturnQueryBySn, allocateReturnCheckSubmit, allocateReturnCheck } from '@/api/allocateReturn'
 export default {
   name: 'TransferReturnCheck',
   mixins: [commonMixin],
-  components: {
-    STable,
-    VSelect
-  },
+  components: { STable, VSelect },
   data () {
     return {
       spinning: false,
       tableHeight: 0, // 表格高度
-      orderSn: null,
-      grabFlag: null,
-      disabled: false,
+      orderSn: null, // 调拨退货sn
+      grabFlag: null, // 是否抓单 0否 1是
+      disabled: false, // 查询、重置按钮是否可操作
       isInster: false, // 是否正在添加产品
-      ordeDetail: { discountAmount: 0 },
-      loading: false,
-      // 已选产品
-      dataSource: [],
+      ordeDetail: {
+        discountAmount: 0 // 折扣金额
+      }, // 单据详细数据
+      loading: false, // 操作按钮加载状态
+      dataSource: [], // 已选产品
+      // 产品信息数据
       productForm: {
-        allocateReturnSn: ''
+        allocateReturnSn: '' // 调拨退货sn
       },
-      chooseLoadData: [],
+      chooseLoadData: [], // 已选列表数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // 查询总计
+        // 获取列表数据 有分页
         this.productForm.allocateReturnSn = this.$route.params.sn
         return allocReturnDetailQueryPage(Object.assign(parameter, this.productForm)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
+              // 重组列表数据名称
               data.list[i].ids = data.list[i].no + '-' + data.list[i].productSn
               data.list[i].badQty = (data.list[i].badQty || data.list[i].badQty == 0) ? data.list[i].badQty : data.list[i].returnQty
               data.list[i].backStockQty = data.list[i].backStockQty || 0
@@ -114,10 +119,11 @@ export default {
           return data
         })
       },
-      rowSelectionInfo: null
+      rowSelectionInfo: null// 已选数据
     }
   },
   computed: {
+    // 表头
     columns () {
       const _this = this
       const arr = [
@@ -133,8 +139,8 @@ export default {
       if (this.grabFlag == 1) { //  抓单
         arr.splice(1, 0, { title: '调拨单号', dataIndex: 'allocateNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } })
       }
-      if(this.$hasPermissions('M_transferReturnCheck_salesPrice')){
-        arr.splice(this.grabFlag == 1?8:7,0,{ title: '退货单价', dataIndex: 'price', align: 'right', width: '10%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      if (this.$hasPermissions('M_transferReturnCheck_salesPrice')) {
+        arr.splice(this.grabFlag == 1 ? 8 : 7, 0, { title: '退货单价', dataIndex: 'price', align: 'right', width: '10%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }
@@ -233,6 +239,7 @@ export default {
         }
       })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -243,6 +250,7 @@ export default {
       this.$refs.table.clearTable()
       this.getOrderDetail()
     },
+    // 计算表格高度
     setTableH () {
       this.tableHeight = window.innerHeight - 340
     }

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

@@ -68,6 +68,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { allocateBillParseProducts, allocateBillFailExcel } from '@/api/allocateBill'
 export default {
   name: 'TransferReturnImportModal',
@@ -104,12 +105,13 @@ export default {
         { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备注', dataIndex: 'errorDesc', width: 180, align: 'center', customRender: function (text) { return text || '--' } }
       ],
-      loadData: [],
-      unLoadData: [],
-      loading: false
+      loadData: [], // 可导入数据
+      unLoadData: [], // 导入错误数据
+      loading: false// 表格加载状态
     }
   },
   methods: {
+    // 获取导入数据
     getData () {
       const _this = this
       this.loading = true

+ 15 - 7
src/views/allocationManagement/transferReturn/detail.vue

@@ -96,8 +96,10 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import print from './print.vue'
+// 接口
 import { allocReturnDetailQueryPage, allocateReturnQueryBySn } from '@/api/allocateReturn'
 export default {
   name: 'TransferReturnDetail',
@@ -108,11 +110,11 @@ export default {
       type: [Number, String],
       default: ''
     },
-    showPrice: {
+    showPrice: {// 是否显示价格
       type: Boolean,
       default: false
     },
-    pageType: {
+    pageType: {// 页面类型
       type: String,
       default: 'pages'
     }
@@ -123,10 +125,12 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
+        // 获取列表数据 有分页
         return allocReturnDetailQueryPage(Object.assign(parameter, { allocateReturnSn: this.outBizSn || this.$route.params.sn })).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -138,17 +142,17 @@ export default {
         })
       },
       basicInfoData: null, //  基本信息
-      localDataSource: [],
-      openModal: false,
-      nowType: null,
-      showDetail: true,
-      tableHeight: 0
+      localDataSource: [], // 表格数据
+      showDetail: true, // 显示隐藏基础信息
+      tableHeight: 0// 表格高度
     }
   },
   computed: {
+    // 是否可编辑基础信息
     isEdit () {
       return this.basicInfoData && ((this.basicInfoData.state == 'WAIT_SUBMIT') || (this.basicInfoData.state == 'FINANCIAL_REJECT') || (this.basicInfoData.state == 'AUDIT_REJECT')) && this.$hasPermissions('B_transferReturnEdit')
     },
+    // 表头
     columns () {
       const _this = this
       const arr = [
@@ -173,6 +177,7 @@ export default {
     }
   },
   watch: {
+    // 显示隐藏基础信息  监听表格高度变化
     showDetail (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -182,6 +187,7 @@ export default {
     '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
       this.setTableH()
     },
+    // 根据页面类型计算表格高度
     outBizSn (newValue, oldValue) {
       if (newValue) {
         this.pageInit()
@@ -208,6 +214,7 @@ export default {
       const row = this.basicInfoData
       this.$router.push({ name: row.grabFlag == 1 ? 'transferReturnGrpEdit' : 'transferReturnEdit', params: { sn: row.allocateReturnSn, targetType: row.targetType, dealerLevel: row.dealerLevel } })
     },
+    // 初始化
     pageInit () {
       if (this.outBizSn || this.$route.params.sn) {
         this.$refs.table.refresh(true)
@@ -215,6 +222,7 @@ export default {
         this.setTableH()
       }
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 285

+ 52 - 38
src/views/allocationManagement/transferReturn/edit.vue

@@ -1,13 +1,13 @@
 <template>
-  <div class="allocateBillEdit-wrap">
+  <div class="transferReturnEdit-wrap">
     <!-- <a-spin :spinning="spinning" tip="Loading..."> -->
     <div class="ant-spin-nested-loading">
-      <a-page-header :ghost="false" :backIcon="false" class="allocateBillEdit-back" >
+      <a-page-header :ghost="false" :backIcon="false" class="transferReturnEdit-back" >
         <!-- 自定义的二级文字标题 -->
         <template slot="subTitle">
-          <a id="allocateBillEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <a id="transferReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ basicInfoData&&basicInfoData.allocateReturnNo }}</span>
-          <a-button type="link" class="button-default" @click="showDetail=!showDetail">
+          <a-button id="transferReturnEdit-showDetail" type="link" class="button-default" @click="showDetail=!showDetail">
             <a-icon :type="showDetail ? 'eye-invisible' : 'eye'"/> {{ showDetail?'隐藏':'查看' }}信息
           </a-button>
         </template>
@@ -16,7 +16,7 @@
           <print :params="{allocateReturnSn: allocateReturnSn}" :basicInfoData="basicInfoData" :disabled="localDataSource.length==0" @loading="spinning=true" @unloading="spinning=false"></print>
         </template>
       </a-page-header>
-      <a-card size="small" :bordered="false" v-if="basicInfoData" class="allocateBillEdit-cont" v-show="showDetail">
+      <a-card size="small" :bordered="false" v-if="basicInfoData" class="transferReturnEdit-cont" v-show="showDetail">
         <a-descriptions :column="3">
           <a-descriptions-item label="调拨退货单号">{{ (basicInfoData&&basicInfoData.allocateReturnNo) || '--' }}</a-descriptions-item>
           <a-descriptions-item label="调拨退货对象">{{ (basicInfoData&&basicInfoData.targetTypeDictValue) || '--' }}</a-descriptions-item>
@@ -34,7 +34,7 @@
           </a-descriptions-item>
           <a-descriptions-item label="费用/调拨退货类型">
             <AllocateType
-              id="allocateEdit-allocateReturnTypeSn"
+              id="transferReturnEdit-allocateTypeVal"
               style="width: 220px;"
               v-model="allocateTypeVal"
               :allowClear="false"
@@ -50,24 +50,24 @@
         </a-descriptions>
       </a-card>
       <!-- 选择产品 -->
-      <a-card size="small" title="选择产品" :bordered="false" class="allocateBillEdit-cont">
+      <a-card size="small" title="选择产品" :bordered="false" class="transferReturnEdit-cont">
         <!-- 筛选条件 -->
         <div class="table-page-search-wrapper">
-          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-form layout="inline" id="transferReturnEdit-form" @keyup.enter.native="$refs.table.refresh(true)">
             <a-row :gutter="15">
               <a-col :md="6" :sm="24">
                 <a-form-item label="产品编码" prop="productCode">
-                  <a-input id="allocateBillEdit-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
+                  <a-input id="transferReturnEdit-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="产品名称" prop="productName">
-                  <a-input id="allocateBillEdit-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
+                  <a-input id="transferReturnEdit-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
                 </a-form-item>
               </a-col>
               <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: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="transferReturnEdit-refresh">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="transferReturnEdit-reset">重置</a-button>
               </a-col>
             </a-row>
           </a-form>
@@ -80,6 +80,7 @@
           index="0"
           tableId="table1"
           :rowKey="(record) => record.stockSn"
+          rowKeyName="stockSn"
           :columns="columns"
           :customRow="handleClickRow"
           :data="loadData"
@@ -97,6 +98,7 @@
               v-model="record.priceLevel"
               allowClear
               placeholder="请选择价格级别"
+              :id="'transferReturnEdit-priceLevel'+record.stockSn"
               @change="e => handlePriceLevel(e,index)"></v-select>
           </template>
           <!-- 退货单价 -->
@@ -113,6 +115,7 @@
                 :min="1"
                 :max="99999999"
                 placeholder="请输入"
+                :id="'transferReturnEdit-qty'+record.stockSn"
                 style="width: 100%;" />
             </div>
           </template>
@@ -124,13 +127,13 @@
               v-if="record.lastStockCost"
               class="button-primary"
               @click="handleAdd(record)"
-              id="allocateBillEdit-add-btn">添加</a-button>
+              :id="'transferReturnEdit-add-btn'+record.stockSn">添加</a-button>
             <span v-else>--</span>
           </template>
         </s-table>
       </a-card>
       <!-- 已选产品 -->
-      <a-card size="small" title="已选产品" :bordered="false" class="allocateBillEdit-cont">
+      <a-card size="small" title="已选产品" :bordered="false" class="transferReturnEdit-cont">
         <!-- 总计 -->
         <a-alert type="info" style="margin-bottom:10px">
           <div slot="message">
@@ -155,8 +158,8 @@
                     </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="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="editGrap-refresh">查询</a-button>
+                    <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="editGrap-reset">重置</a-button>
                   </a-col>
                 </a-row>
               </a-form>
@@ -185,6 +188,7 @@
             <a-input-number
               size="small"
               v-model="record.returnQty"
+              :id="'editGrap-returnQty'+record.id"
               :precision="0"
               :min="1"
               :max="99999999"
@@ -194,7 +198,7 @@
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
-            <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="allocateBillEdit-del-btn">删除</a-button>
+            <a-button size="small" type="link" class="button-error" @click="handleDel(record)" :id="'transferReturnEdit-del-btn'+record.id">删除</a-button>
           </template>
         </s-table>
       </a-card>
@@ -203,7 +207,7 @@
     <div class="affix-cont">
       <a-button
         type="primary"
-        id="allocateBillEdit-submit"
+        id="transferReturnEdit-submit"
         size="large"
         :disabled="spinning"
         class="button-primary"
@@ -224,14 +228,15 @@
       @cancel="editRemark = false"
       :width="600">
       <a-textarea
+        id="transferReturnEdit-remarks"
         v-model="basicInfoData.remarks"
         placeholder="请输入备注(最多120个字符)"
         :maxLength="120"
         :auto-size="{ minRows: 3, maxRows: 5 }"
       />
       <div class="btn-cont">
-        <a-button type="primary" id="allocateBill-basicInfo-modal-save" @click="handleEditRemark">保存</a-button>
-        <a-button id="allocateBill-basicInfo-modal-back" @click="editRemark = false" style="margin-left: 15px;">取消</a-button>
+        <a-button type="primary" id="transferReturnEdit-save" @click="handleEditRemark">保存</a-button>
+        <a-button id="transferReturnEdit-cancel" @click="editRemark = false" style="margin-left: 15px;">取消</a-button>
       </div>
     </a-modal>
   </div>
@@ -239,11 +244,13 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 // import ImportGuideModal from './importGuideModal.vue'
 import print from './print.vue'
 import warehouse from '@/views/common/chooseWarehouse.js'
 import AllocateType from '@/views/common/allocateType.js'
+// 接口
 import {
   allocateReturnSave,
   allocReturnDetailQueryPage,
@@ -264,21 +271,23 @@ export default {
     const _this = this
     return {
       spinning: false,
+      // 查询条件
       queryParam: {
-        productCode: '',
-        productName: '',
-        productOrigCode: ''
+        productCode: '', // 产品编码
+        productName: '', // 产品名称
+        productOrigCode: ''// 原厂编码
       },
+      // 已选列表查询条件
       chooseQueryParam: {
-        productCode: '',
-        productName: ''
+        productCode: '', // 产品编码
+        productName: '' // 产品名称
       },
-      editRemark: false,
+      editRemark: false, // 编辑备注
       disabled: false, //  查询、重置按钮是否可操作
-      loading: false,
+      loading: false, // 加载状态
       chooseDisabled: false, //  查询、重置按钮是否可操作
       advanced: false, // 高级搜索 展开/关闭
-      dealerLevel: '',
+      dealerLevel: '', // 经销商等级
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -286,8 +295,10 @@ export default {
         const dealerLevel = _this.dealerLevel == 'OTHER' ? undefined : _this.dealerLevel
         const dealerSnInfo = _this.dealerLevel != 'OTHER' ? _this.basicInfoData.dealerEntity.dealerSn : undefined
         const ajaxName = _this.basicInfoData.targetType === 'DEALER' ? queryStockProductPage : stockQueryStockProductPage
+        // 获取列表数据  有分页
         return ajaxName(Object.assign(parameter, this.queryParam, { dealerLevel: dealerLevel === '0' ? '' : dealerLevel, warehouseSn: warehouseSn, dealerSn: dealerSnInfo })).then(res => {
           const data = res.data
+          // 计算表格序号
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
@@ -303,15 +314,17 @@ export default {
           return data
         })
       },
-      loadDataSource: [],
-      localDataSource: [],
-      allocateReturnSn: '',
+      loadDataSource: [], // 列表数据
+      localDataSource: [], // 已选列表数据
+      allocateReturnSn: '', // 调拨退货sn
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
         this.chooseDisabled = true
+        // 获取已选列表数据  有分页
         const params = Object.assign(parameter, { product: { name: this.chooseQueryParam.productName, code: this.chooseQueryParam.productCode }, allocateReturnSn: this.allocateReturnSn })
         return allocReturnDetailQueryPage(params).then(res => {
           const data = res.data
+          // 计算表格序号
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
@@ -325,13 +338,12 @@ export default {
       },
       basicInfoData: null, // 基本信息
       openGuideModal: false, //  导入产品引导
-      openModal: false,
-      nowType: null,
-      allocateTypeVal: [],
-      showDetail: false
+      allocateTypeVal: [], // 费用/调拨退货类型 列表数据
+      showDetail: false// 显示隐藏基础信息
     }
   },
   computed: {
+    // 表头
     columns () {
       const _this = this
       const arr = [
@@ -349,6 +361,7 @@ export default {
       }
       return arr
     },
+    // 已选数据表头
     chooseColumns () {
       const _this = this
       const arr = [
@@ -582,6 +595,7 @@ export default {
       this.getDetail(true)
       this.$refs.chooseTable.refresh()
     },
+    // 初始化
     pageInit () {
       this.allocateReturnSn = this.$route.params.sn
       this.refashPage()
@@ -605,7 +619,7 @@ export default {
 </script>
 
 <style lang="less">
-  .allocateBillEdit-wrap{
+  .transferReturnEdit-wrap{
     position: relative;
     height: 100%;
     box-sizing: border-box;
@@ -614,13 +628,13 @@ export default {
       height: 100%;
       padding-bottom: 51px;
     }
-    .allocateBillEdit-back{
+    .transferReturnEdit-back{
       margin-bottom: 6px;
       .ant-page-header-heading-sub-title{
         margin:0;
       }
     }
-    .allocateBillEdit-cont{
+    .transferReturnEdit-cont{
       margin-bottom: 6px;
       .sub-title{
         font-size: 12px;

+ 13 - 12
src/views/allocationManagement/transferReturn/editGrp.vue

@@ -7,7 +7,7 @@
         <template slot="subTitle">
           <a id="editGrap-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ basicInfoData&&basicInfoData.allocateReturnNo }}</span>
-          <a-button type="link" class="button-default" @click="showDetail=!showDetail">
+          <a-button type="link" id="editGrap-showDetail" class="button-default" @click="showDetail=!showDetail">
             <a-icon :type="showDetail ? 'eye-invisible' : 'eye'"/> {{ showDetail?'隐藏':'查看' }}信息
           </a-button>
         </template>
@@ -35,7 +35,7 @@
             </a-descriptions-item>
             <a-descriptions-item label="费用/调拨退货类型">
               <AllocateType
-                id="allocateEdit-allocateReturnTypeSn"
+                id="editGrap-allocateTypeVal"
                 style="width: 220px;"
                 v-model="allocateTypeVal"
                 placeholder="请选择费用/调拨退货类型"
@@ -58,7 +58,7 @@
             <a-button
               type="primary"
               class="button-info"
-              id="salesEdit-plDel-btn"
+              id="editGrap-plAdd"
               @click="handleBatchAdd">批量添加</a-button>
             <span>已选{{ selectTotal }}项</span>
           </div>
@@ -80,8 +80,8 @@
                 </a-form-item>
               </a-col>
               <a-col :md="4" :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: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="editGrap-refresh">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="editGrap-reset">重置</a-button>
               </a-col>
             </a-row>
           </a-form>
@@ -116,13 +116,14 @@
                 </div>
               </template> -->
           <!-- 本次可退数量 -->
-          <template slot="returnNumber" slot-scope="text, record,index">
+          <template slot="returnNumber" slot-scope="text, record">
             <a-input-number
               v-if="record.refundableQty!=0"
               size="small"
               v-model="record.returnableQty"
               :precision="0"
               :min="0"
+              :id="'editGrap-refundableQty-'+record.allocateNo +'-'+ record.productSn"
               :max="record.refundableQty"
               placeholder="请输入"
               style="width: 100%;" />
@@ -135,8 +136,8 @@
               v-if="record.refundableQty"
               type="link"
               class="button-primary"
-              @click="handleAdd(record)"
-              id="editGrap-add-btn">添加</a-button>
+              :id="'editGrap-add-btn-'+record.allocateNo +'-'+ record.productSn"
+              @click="handleAdd(record)">添加</a-button>
             <span v-else>--</span>
           </template>
         </s-table>
@@ -158,17 +159,17 @@
                 <a-row :gutter="15">
                   <a-col :md="9" :sm="24">
                     <a-form-item label="产品编码" prop="productCode">
-                      <a-input id="editGrap-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
+                      <a-input id="editGrap-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="editGrap-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
+                      <a-input id="editGrap-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="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="editGrap-choosed-refresh">查询</a-button>
+                    <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="editGrap-choosed-reset">重置</a-button>
                   </a-col>
                 </a-row>
               </a-form>

+ 34 - 24
src/views/allocationManagement/transferReturn/list.vue

@@ -3,11 +3,11 @@
     <a-card size="small" :bordered="false" class="searchBoxNormal">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" id="transferReturn-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate ref="rangeDate" id="transferReturn-time" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -49,7 +49,7 @@
               </a-col>
               <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
                 <a-form-item label="客服">
-                  <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
+                  <customerService id="transferReturn-bizUserSn" ref="customerName" v-model="queryParam.bizUserSn"></customerService>
                 </a-form-item>
               </a-col>
             </template>
@@ -65,7 +65,7 @@
               :disabled="disabled"
               :loading="exportLoading"
               id="transferReturn-export">导出</a-button> -->
-              <a @click="advanced=!advanced" style="margin-left: 5px">
+              <a @click="advanced=!advanced" style="margin-left: 5px" id="transferReturn-advanced">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -95,7 +95,7 @@
           bordered>
           <!-- 单号 -->
           <template slot="allocateReturnNo" slot-scope="text, record">
-            <span v-if="$hasPermissions('M_transferReturnDetail')" class="link-bule" @click="handleDetail(record)">{{ record.allocateReturnNo }}</span>
+            <span v-if="$hasPermissions('M_transferReturnDetail')" :id="'transferReturn-allocateReturnNo'+record.id" class="link-bule" @click="handleDetail(record)">{{ record.allocateReturnNo }}</span>
             <span v-else>{{ record.allocateReturnNo }}</span>
           </template>
           <!-- 调拨类型 -->
@@ -114,28 +114,28 @@
               v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_transferReturnAudit')"
               class="button-warning"
               @click="handleExamine(record)"
-              id="transferReturn-examine-btn">审核</a-button>
+              :id="'transferReturn-audit-btn'+record.id">审核</a-button>
             <a-button
               size="small"
               type="link"
               class="button-warning"
               v-if="record.state=='WAIT_CHECK' && $hasPermissions('M_transferReturnCheck')"
               @click="handleCheck(record)"
-              id="transferReturn-examine-btn">品检</a-button>
+              :id="'transferReturn-check-btn'+record.id">品检</a-button>
             <a-button
               size="small"
               type="link"
               v-if="((record.state == 'WAIT_SUBMIT') || (record.state == 'FINANCIAL_REJECT') || (record.state == 'AUDIT_REJECT')) && $hasPermissions('B_transferReturnEdit')"
               class="button-info"
               @click="handleEdit(record)"
-              id="transferReturn-edit-btn">编辑</a-button>
+              :id="'transferReturn-edit-btn'+record.id">编辑</a-button>
             <a-button
               size="small"
               type="link"
               v-if="((record.state == 'WAIT_SUBMIT') || (record.state == 'FINANCIAL_REJECT') || (record.state == 'AUDIT_REJECT')) && $hasPermissions('B_transferReturnDel')"
               class="button-error"
               @click="handleDel(record)"
-              id="transferReturn-del-btn">删除</a-button>
+              :id="'transferReturn-del-btn'+record.id">删除</a-button>
             <!-- 带财务确认或已完结 -->
             <span v-if="record.state == 'WAIT_FINANCIAL_AUDIT'||record.state == 'FINISH'">--</span>
           </template>
@@ -157,15 +157,17 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import basicInfoModal from './basicInfoModal.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
 import auditModal from '@/views/common/auditModal.vue'
-import { allocateReturnQueryPage, allocateReturnAudit, allocateReturnDelete } from '@/api/allocateReturn'
 import AllocateType from '@/views/common/allocateType.js'
 import warehouse from '@/views/common/chooseWarehouse.js'
 import customerService from '@/views/common/customerService'
-import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
+import { allocateReturnQueryPage, allocateReturnAudit, allocateReturnDelete } from '@/api/allocateReturn'
 export default {
   name: 'TransferReturnList',
   mixins: [commonMixin],
@@ -174,31 +176,34 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      time: [],
-      allocateTypeVal: [],
-      queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
+      tableHeight: 0, // 表格高度
+      time: [], // 创建时间
+      allocateTypeVal: [], // 费用/调拨退货类型
+      //  查询条件
+      queryParam: {
+        beginDate: '', // 开始时间
+        endDate: '', // 结束时间
         targetName: '', //  调往对象
         costTypeSn: undefined, // 费用类型
         allocateSortSn: undefined, //  调拨类别
         allocateReturnTypeSn: undefined, // 调拨退货类型2
         state: undefined, //  业务状态
-        warehouseSn: undefined,
+        warehouseSn: undefined, // 出库仓库
         allocateReturnNo: '', //  调拨单号
-        bizUserSn: undefined
+        bizUserSn: undefined// 客服
       },
       disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
+      exportLoading: false, // 导出按钮加载状态
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据  有分页
         return allocateReturnQueryPage(Object.assign(parameter, this.queryParam, { authWarehouseFlag: 0 })).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -209,13 +214,14 @@ export default {
           return data
         })
       },
-      visibleAudit: false,
-      auditInfo: null,
-      spinningAudit: false,
+      visibleAudit: false, // 审核弹窗
+      auditInfo: null, // 审核当前行数据
+      spinningAudit: false, // 审核按钮加载状态
       openModal: false //  新增编辑  弹框
     }
   },
   computed: {
+    // 表头
     columns () {
       const _this = this
       const arr = [
@@ -247,6 +253,7 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    // 选择费用/调拨退货类型
     changeAllocatype (val, opts) {
       this.allocateTypeVal = val || []
       this.queryParam.costTypeSn = val && val[0] ? val[0] : ''
@@ -295,7 +302,7 @@ export default {
       this.auditInfo = row
       this.visibleAudit = true
     },
-    // 审核
+    // 审核成功
     auditOrder (state) {
       const _this = this
       _this.spinningAudit = true
@@ -334,6 +341,7 @@ export default {
         _this.spinning = false
       })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -341,12 +349,14 @@ export default {
       })
       this.openModal = false
     },
+    // 表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 255
     }
   },
   watch: {
+    // 展开关闭  监听表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 65 - 49
src/views/allocationManagement/transfersPrint/list.vue

@@ -1,23 +1,23 @@
 <template>
-  <div class="allocateBillList-wrap">
+  <div class="transfersPrintList-wrap">
     <a-card size="small" :bordered="false" :class="currentTab==2 ? 'searchBox' : 'searchBoxNormal'">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" id="transfersPrintList-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate id="transfersPrintList-time" ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="调往对象">
-                <a-input id="allocateBillList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调往对象"/>
+                <a-input id="transfersPrintList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调往对象"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="收货客户名称">
-                <dealerSearchList ref="receiverSn" @change="custChange"/>
+                <dealerSearchList id="transfersPrintList-receiver" ref="receiverSn" @change="custChange"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24" v-if="currentTab==2&&!isShowCustomerSearch">
@@ -25,7 +25,7 @@
                 <v-select
                   v-model="queryParam.state"
                   ref="state"
-                  id="allocateBillList-state"
+                  id="transfersPrintList-state"
                   code="ALLOCATE_STATUS"
                   placeholder="请选择业务状态"
                   allowClear
@@ -38,7 +38,7 @@
                   <v-select
                     v-model="queryParam.state"
                     ref="state"
-                    id="allocateBillList-state"
+                    id="transfersPrintList-state"
                     code="ALLOCATE_STATUS"
                     placeholder="请选择业务状态"
                     allowClear
@@ -47,7 +47,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="调拨单号">
-                  <a-input id="allocateBillList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
+                  <a-input id="transfersPrintList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24" v-if="currentTab == 1">
@@ -55,7 +55,7 @@
                   <v-select
                     v-model="queryParam.printState"
                     ref="printState"
-                    id="allocateBillList-printState"
+                    id="transfersPrintList-printState"
                     code="PRINT_STATUS"
                     placeholder="请选择打印状态"
                     allowClear
@@ -67,31 +67,31 @@
                   <warehouse
                     v-model="queryParam.warehouseSn"
                     isPermission
-                    id="allocateBillList-warehouseSn"
+                    id="transfersPrintList-warehouseSn"
                     placeholder="请选择调出仓库"
                   />
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="所在区域">
-                  <subarea id="allocateBillList-subarea" ref="subarea" @change="subareaChange"></subarea>
+                  <subarea id="transfersPrintList-subarea" ref="subarea" @change="subareaChange"></subarea>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="地区">
-                  <Area id="allocateBillList-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
+                  <Area id="transfersPrintList-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
                 <a-form-item label="客服">
-                  <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
+                  <customerService ref="customerName" id="transfersPrintList-bizUserSn" v-model="queryParam.bizUserSn"></customerService>
                 </a-form-item>
               </a-col>
             </template>
             <a-col :md="currentTab==2&&!isShowCustomerSearch ?24:6" :sm="24" :style="{textAlign: (currentTab==2&&!isShowCustomerSearch)?'center':''}">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="allocateBillList-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="allocateBillList-reset">重置</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 5px">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="transfersPrintList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="transfersPrintList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px" id="transfersPrintList-advanced">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -101,10 +101,10 @@
       </div>
     </a-card>
     <div style="background-color: #fff;">
-      <a-tabs v-model="currentTab" @change="changeTab">
-        <a-tab-pane :key="1" tab="全部">
+      <a-tabs v-model="currentTab" @change="changeTab" id="transfersPrintList-tabs">
+        <a-tab-pane :key="1" tab="全部" id="transfersPrintList-tabs1">
         </a-tab-pane>
-        <a-tab-pane :key="2" tab="待打印">
+        <a-tab-pane :key="2" tab="待打印" id="transfersPrintList-tabs2">
         </a-tab-pane>
       </a-tabs>
     </div>
@@ -124,12 +124,12 @@
           bordered>
           <!-- 单号 -->
           <template slot="allocateNo" slot-scope="text, record">
-            <span v-if="$hasPermissions('M_transferOut_detail')" class="link-bule" @click="handleDetail(record)">{{ record.allocateNo }}</span>
+            <span v-if="$hasPermissions('M_transferOut_detail')" :id="'transfersPrintList-allocateNo'+record.id" class="link-bule" @click="handleDetail(record)">{{ record.allocateNo }}</span>
             <span v-else>{{ record.allocateNo }}</span>
           </template>
           <!-- 打印状态 -->
           <template slot="printStatus" slot-scope="text, record">
-            <span v-if="record.printState=='NO_PRINT'" class="link-bule" @click="editPrintStatus(record)">{{ record.printStateDictValue }}</span>
+            <span v-if="record.printState=='NO_PRINT'" :id="'transfersPrintList-printStatus'+record.id" class="link-bule" @click="editPrintStatus(record)">{{ record.printStateDictValue }}</span>
             <span v-else>{{ record.printStateDictValue }}</span>
           </template>
           <div slot="costTitle">
@@ -148,14 +148,14 @@
               v-if="record.printState == 'NO_PRINT'&&$hasPermissions('B_transferOut_type_print')"
               class="button-warning"
               @click="handlePrint(record)"
-              id="allocateBillList-printState">调拨分类打印</a-button>
+              :id="'transfersPrintList-printState-btn'+record.id">调拨分类打印</a-button>
             <a-button
               size="small"
               type="link"
               v-else-if="record.printState == 'PRINT'&&$hasPermissions('B_tfoPrint_record')"
               class="button-success"
               @click="handlePrintRecord(record)"
-              id="allocateBillList-printRecord">打印记录</a-button>
+              :id="'transfersPrintList-printRecord-btn'+record.id">打印记录</a-button>
             <span v-else>--</span>
           </template>
         </s-table>
@@ -198,6 +198,8 @@
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
+import { printBase64Fun } from '@/libs/JGPrint.js'
+// 组件
 import { STable, VSelect } from '@/components'
 import subarea from '@/views/common/subarea.js'
 import Area from '@/views/common/area.js'
@@ -209,8 +211,8 @@ import warehouse from '@/views/common/chooseWarehouse.js'
 import customerService from '@/views/common/customerService'
 import allocationDetailModal from '@/views/allocationManagement/transferOut/detail.vue'
 import recordModal from './recordModal.vue'
+// 接口
 import { allocateBillList, allocateBillDetailPrint, updatePrintState } from '@/api/allocateBill'
-import { printBase64Fun } from '@/libs/JGPrint.js'
 export default {
   name: 'TransfersPrintList',
   mixins: [commonMixin],
@@ -219,44 +221,48 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      itemData: null,
-      bizSn: '',
-      showRecordModal: false,
-      showPrintModal: false,
-      showDetailModal: false,
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      itemData: null, // 当前行数据
+      bizSn: '', // 调拨sn
+      showRecordModal: false, // 打印记录弹窗
+      showPrintModal: false, // 打印弹窗
+      showDetailModal: false, // 调拨单详情弹窗
+      // 创建时间默认值
       time: [
-        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
-        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'), // 开始时间
+        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')// 几位数使劲
       ],
-      queryParam: { //  查询条件
-        beginDate: getDate.getThreeMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
+      //  查询条件
+      queryParam: {
+        beginDate: getDate.getThreeMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束时间
         targetName: '', //  调往对象
         state: undefined, //  业务状态
         allocateNo: '', //  调拨单号
-        receiverSn: undefined,
-        checkStatus: undefined,
-        warehouseSn: undefined,
-        printState: 'NO_PRINT',
+        receiverSn: undefined, // 收货客户名称
+        checkStatus: undefined, // 选中状态
+        warehouseSn: undefined, // 调出仓库
+        printState: 'NO_PRINT', // 打印状态
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined// 分区
         },
-        shippingAddrProvinceSn: undefined,
-        bizUserSn: undefined
+        shippingAddrProvinceSn: undefined, // 选中省份
+        bizUserSn: undefined// 客服
       },
-      currentTab: 2,
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
+      currentTab: 2, // tabs默认值
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据  有分页
         return allocateBillList(Object.assign(parameter, this.queryParam, { authWarehouseFlag: 1 })).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -267,12 +273,13 @@ export default {
           return data
         })
       },
-      visibleAudit: false,
+      visibleAudit: false, // 审核弹窗
       openModal: false, //  打印弹框
-      tipData: null
+      tipData: null// 操作提示回显数据
     }
   },
   computed: {
+    // 表头
     columns () {
       const _this = this
       const arr = [
@@ -305,6 +312,7 @@ export default {
     }
   },
   methods: {
+    // 收货客户名称 change
     custChange (val) {
       if (val.row) {
         this.queryParam.receiverSn = val.row.dealerSn
@@ -314,6 +322,7 @@ export default {
         this.queryParam.receiverName = val.key
       }
     },
+    // tabs事件
     changeTab (v) {
       this.currentTab = v
       this.resetSearchForm()
@@ -323,6 +332,7 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    // 区域分区
     subareaChange (val) {
       this.queryParam.subareaArea = {
         subareaSn: val[0] ? val[0] : undefined,
@@ -396,11 +406,13 @@ export default {
       this.bizSn = row.allocateSn
       this.showDetailModal = true
     },
+    // 关闭详情弹窗
     cancelDetail () {
       this.showDetailModal = false
       this.$store.state.app.curActionPermission = ''
       this.bizSn = null
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -408,6 +420,7 @@ export default {
       })
       this.openModal = false
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 266
@@ -419,10 +432,12 @@ export default {
         this.showPrintModal = true
       })
     },
+    // 关闭操作提示弹窗
     canselModal () {
       this.showPrintModal = false
       this.resetSearchForm()
     },
+    // 操作提示成功呢
     updatePrintStatus () {
       const _this = this
       _this.spinning = true
@@ -440,6 +455,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭 监听表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -474,7 +490,7 @@ export default {
 }
 </script>
 <style lang="less">
-  .allocateBillList-wrap{
+  .transfersPrintList-wrap{
     .ant-tabs-bar{
       margin: 0;
     }

+ 9 - 3
src/views/allocationManagement/transfersPrint/recordModal.vue

@@ -52,7 +52,9 @@
 </template>
 
 <script>
+// 组件
 import { STable, VSelect } from '@/components'
+// 接口
 import { printLogQueryPage } from '@/api/data'
 export default {
   name: 'RecordModal',
@@ -78,10 +80,11 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      disabled: false,
+      disabled: false, // 查询、重置按钮是否可操作
       spinning: false,
-      tipData: null,
-      params: null,
+      tipData: null, // 调拨当前数据
+      params: null, // 提交数据
+      // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '打印时间', dataIndex: 'printDate', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -93,10 +96,12 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据 有分页
         return printLogQueryPage(Object.assign(parameter, this.params || {})).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -110,6 +115,7 @@ export default {
     }
   },
   methods: {
+    // 赋值
     setData (data, params) {
       this.tipData = data
       this.params = params

+ 19 - 12
src/views/power/OperateJournal/OperateJournal.vue

@@ -3,21 +3,21 @@
     <a-card size="small" :bordered="false" class="searchBoxNormal">
       <!-- 搜索框 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" id="operateJournal-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="操作时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate id="operateJournal-rangeDate" ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="操作信息">
-                <a-input allowClear v-model.trim="queryParam.actDesc" placeholder="请输入操作信息" />
+                <a-input id="operateJournal-actDesc" allowClear v-model.trim="queryParam.actDesc" placeholder="请输入操作信息" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="操作人">
-                <a-input allowClear v-model.trim="queryParam.actorName" placeholder="请输入操作人" />
+                <a-input id="operateJournal-actorName" allowClear v-model.trim="queryParam.actorName" placeholder="请输入操作人" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -52,10 +52,12 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import getDate from '@/libs/getDate'
+// 组件
 import { STable } from '@/components'
-import { journalList } from '@/api/OperateJournal.js'
+import getDate from '@/libs/getDate'
 import rangeDate from '@/views/common/rangeDate.vue'
+// 接口
+import { journalList } from '@/api/OperateJournal.js'
 export default {
   name: 'PowerOperateJournal',
   mixins: [commonMixin],
@@ -64,18 +66,19 @@ export default {
     return {
       advanced: false, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
+      // 操作时间
       time: [
         getDate.getThreeday().starttime,
         getDate.getThreeday().endtime
       ],
       queryParam: {
-        beginDate: getDate.getThreeday().starttime, // 查询的开始时间
-        endDate: getDate.getThreeday().endtime, // 查询的结束时间
-        actDesc: '',
-        actorName: ''
+        beginDate: getDate.getThreeday().starttime, // 操作开始时间
+        endDate: getDate.getThreeday().endtime, // 操作结束时间
+        actDesc: '', // 操作信息
+        actorName: ''// 操作人
       },
-      dateFormat: 'YYYY-MM-DD',
+      dateFormat: 'YYYY-MM-DD', // 操作时间显示格式
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '操作时间', dataIndex: 'actDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
@@ -86,10 +89,12 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        // 获取列表数据 有分页
         return journalList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -116,12 +121,14 @@ export default {
       this.queryParam.actorName = ''
       this.$refs.table.refresh(true)
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 210

+ 36 - 26
src/views/power/dataDictionary/codeItemModal.vue

@@ -1,11 +1,11 @@
 <template>
   <div>
     <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancel="cancel">
-      <a-form :form="form" @submit="handleSubmit">
+      <a-form :form="form" id="codeItemModal-form" @submit="handleSubmit">
         <a-row :gutter="24">
           <a-col :span="24">
             <!-- code -->
-            <a-form-item label="字典码" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
+            <a-form-item label="字典码" id="codeItemModal-lookupCode" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
               <a-input
                 disabled
                 placeholder=""
@@ -22,6 +22,7 @@
             <!-- 名称 -->
             <a-form-item label="名称" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
+                id="codeItemModal-dispName"
                 placeholder="请输入名称(最多30个字符)"
                 :maxLength="30"
                 v-decorator="['formData.dispName', {
@@ -34,6 +35,7 @@
             <!-- 项编码 -->
             <a-form-item label="项编码" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
+                id="codeItemModal-code"
                 placeholder="请输入项编码"
                 v-decorator="['formData.code', {
                   initialValue: formData.code,
@@ -46,6 +48,7 @@
           <a-col :span="12" style="padding-right: 0px;">
             <a-form-item label="启用" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-radio-group
+                id="codeItemModal-isEnable"
                 name="radioGroup"
                 v-decorator="[
                   'formData.isEnable',
@@ -54,8 +57,8 @@
                     rules: [] },
                 ]"
               >
-                <a-radio :value="1">是</a-radio>
-                <a-radio :value="0">否</a-radio>
+                <a-radio :value="1" id="codeItemModal-isEnable1">是</a-radio>
+                <a-radio :value="0" id="codeItemModal-isEnable0">否</a-radio>
               </a-radio-group>
             </a-form-item>
           </a-col>
@@ -63,6 +66,7 @@
           <a-col :span="12">
             <a-form-item label="排序值" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input-number
+                id="codeItemModal-sort"
                 style="width: 100%;"
                 placeholder="请输入排序值(0~999999)"
                 v-decorator="['formData.sort', {
@@ -80,6 +84,7 @@
             <!-- 扩展一 -->
             <a-form-item label="扩展一" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
+                id="codeItemModal-attr1"
                 placeholder=""
                 v-decorator="['formData.attr1', {
                   initialValue: formData.attr1,
@@ -92,6 +97,7 @@
             <a-form-item label="扩展二" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
                 placeholder=""
+                id="codeItemModal-attr2"
                 v-decorator="['formData.attr2', {
                   initialValue: formData.attr2,
                   rules: [] }]"
@@ -102,6 +108,7 @@
             <!-- 扩展三 -->
             <a-form-item label="扩展三" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
+                id="codeItemModal-attr3"
                 placeholder=""
                 v-decorator="['formData.attr3', {
                   initialValue: formData.attr3,
@@ -113,6 +120,7 @@
             <!-- 扩展四 -->
             <a-form-item label="扩展四" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
+                id="codeItemModal-attr4"
                 placeholder=""
                 v-decorator="['formData.attr4', {
                   initialValue: formData.attr4,
@@ -124,6 +132,7 @@
             <!-- 扩展五 -->
             <a-form-item label="扩展五" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
+                id="codeItemModal-attr5"
                 placeholder=""
                 v-decorator="['formData.attr5', {
                   initialValue: formData.attr5,
@@ -135,6 +144,7 @@
             <!-- 扩展六 -->
             <a-form-item label="扩展六" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
+                id="codeItemModal-attr6"
                 placeholder=""
                 v-decorator="['formData.attr6', {
                   initialValue: formData.attr6,
@@ -148,6 +158,7 @@
           <a-col :span="24">
             <a-form-item label="备注" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
               <a-textarea
+                id="codeItemModal-remarks"
                 v-decorator="[
                   'formData.remarks',
                   {
@@ -163,10 +174,10 @@
         </a-row>
 
         <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-          <a-button type="primary" @click="handleSubmit()">
+          <a-button id="codeItemModal-save-btn" type="primary" @click="handleSubmit()">
             保存
           </a-button>
-          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+          <a-button id="codeItemModal-cancel-btn" :style="{ marginLeft: '8px' }" @click="handleCancel()">
             取消
           </a-button>
         </a-form-item>
@@ -177,13 +188,13 @@
 </template>
 
 <script>
+// 组件
 import { STable, VSelect } from '@/components'
+// 接口
 import { saveLookUpItem } from '@/api/lookup.js'
 export default {
   name: 'CodeItemModal',
-  components: {
-    STable, VSelect
-  },
+  components: { STable, VSelect },
   props: {
     visible: {
       type: Boolean,
@@ -198,34 +209,35 @@ export default {
   },
   data () {
     return {
-      titleText: '添加字典项',
-      isshow: this.visible,
+      titleText: '添加字典项', // 弹窗标题
+      isshow: this.visible, // 打开关闭弹窗
       formLayout: 'horizontal',
+      // form设置
       form: this.$form.createForm(this, { name: 'miniForm' }),
-      roleList: [],
+      roleList: [], // 列表数据
+      // 提交参数
       formData: {
-        lookupCode: '',
+        lookupCode: '', // 字典码
         code: '', // code
         dispName: '',
         isEnable: 1, // 活动状态
-        sort: '',
-        attr1: '',
-        attr2: '',
-        attr3: '',
-        attr4: '',
-        attr5: '',
-        attr6: '',
-        remarks: ''
+        sort: '', // 排序
+        attr1: '', // 扩展1
+        attr2: '', // 扩展2
+        attr3: '', // 扩展3
+        attr4: '', // 扩展4
+        attr5: '', // 扩展5
+        attr6: '', // 扩展6
+        remarks: ''// 备注
       }
-
     }
   },
   methods: {
+    // 关闭
     cancel (e) {
       this.clear()
       this.$emit('close')
     },
-
     // 保存提交
     handleSubmit () {
       const _this = this
@@ -262,6 +274,7 @@ export default {
         }
       })
     },
+    // 重置
     clear () {
       this.form.resetFields()
       delete this.formData.id
@@ -278,9 +291,6 @@ export default {
       this.formData.attr6 = ''
       this.formData.remarks = ''
     }
-
-  },
-  mounted () {
   },
   beforeCreate () {
     this.form = this.$form.createForm(this, { name: 'miniForm' })

+ 23 - 17
src/views/power/dataDictionary/codeModal.vue

@@ -1,12 +1,13 @@
 <template>
   <div>
     <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancel="cancel">
-      <a-form :form="form" @submit="handleSubmit">
+      <a-form :form="form" id="code-modal-form" @submit="handleSubmit">
         <!-- 类别编码 -->
         <a-form-item label="类别编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-input
             placeholder="请输入类别编码"
             :disabled="true"
+            id="codeModal-code"
             v-decorator="['formData.code', {
               initialValue: formData.code,
               rules: [{ required: true, message: '请输入类别编码!' }] }]"
@@ -16,6 +17,7 @@
         <!-- 名称 -->
         <a-form-item label="名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-input
+            id="codeModal-name"
             placeholder="请输入名称(最多30个字符)"
             :maxLength="30"
             v-decorator="['formData.name', {
@@ -27,6 +29,7 @@
         <!-- 排序值 -->
         <a-form-item label="排序值" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-input-number
+            id="codeModal-sort"
             style="width: 100%;"
             placeholder="请输入排序值(0~999999)"
             v-decorator="['formData.sort', {
@@ -39,6 +42,7 @@
         <!-- 状态 -->
         <a-form-item label="启用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-radio-group
+            id="codeModal-isEnable"
             name="radioGroup"
             v-decorator="[
               'formData.isEnable',
@@ -47,13 +51,14 @@
                 rules: [{ required: true, message: '请选择状态!' }] },
             ]"
           >
-            <a-radio :value="1">是</a-radio>
-            <a-radio :value="0">否</a-radio>
+            <a-radio :value="1" id="codeModal-isEnable1">是</a-radio>
+            <a-radio :value="0" id="codeModal-isEnable0">否</a-radio>
           </a-radio-group>
         </a-form-item>
 
         <a-form-item label="备注" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-textarea
+            id="codeModal-remarks"
             v-decorator="[
               'formData.remarks',
               { initialValue: formData.remarks,
@@ -66,10 +71,10 @@
         </a-form-item>
 
         <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-          <a-button type="primary" @click="handleSubmit()">
+          <a-button id="codeModal-save-btn" type="primary" @click="handleSubmit()">
             保存
           </a-button>
-          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+          <a-button id="codeModal-cancel-btn" :style="{ marginLeft: '8px' }" @click="handleCancel()">
             取消
           </a-button>
         </a-form-item>
@@ -80,13 +85,13 @@
 </template>
 
 <script>
+// 组件
 import { STable, VSelect } from '@/components'
+// 接口
 import { saveLookUp } from '@/api/lookup.js'
 export default {
   name: 'CodeModal',
-  components: {
-    STable, VSelect
-  },
+  components: { STable, VSelect },
   props: {
     visible: {
       type: Boolean,
@@ -101,21 +106,24 @@ export default {
   },
   data () {
     return {
-      titleText: '添加字典',
-      isshow: this.visible,
+      titleText: '添加字典', // 弹窗标题
+      isshow: this.visible, // 是否显示弹窗
       formLayout: 'horizontal',
+      // 可以使用任何数据,不仅仅局限于上层组件的属性
       form: this.$form.createForm(this, { name: 'miniForm' }),
+      // 提交参数
       formData: {
-        name: '',
-        code: '',
-        sort: '',
+        name: '', // 名称
+        code: '', // 类别编码
+        sort: '', // 排序值
         isEnable: '', // 活动状态
-        remarks: ''
+        remarks: ''// 备注
       }
 
     }
   },
   methods: {
+    // 取消
     cancel (e) {
       this.clear()
       this.$emit('close')
@@ -156,6 +164,7 @@ export default {
         }
       })
     },
+    // 重置
     clear () {
       this.form.resetFields()
       delete this.formData.id
@@ -165,9 +174,6 @@ export default {
       this.formData.isEnable = ''
       this.formData.remarks = ''
     }
-
-  },
-  mounted () {
   },
   beforeCreate () {
     this.form = this.$form.createForm(this, { name: 'miniForm' })

+ 35 - 25
src/views/power/dataDictionary/dataDictionary.vue

@@ -5,7 +5,7 @@
       <a-col :span="6">
         <a-row :gutter="24">
           <!-- <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="addCode">添加字典</a-button> -->
-          <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="editCode">编辑字典</a-button>
+          <a-button id="dataDictionary-operate-btn" style="margin-right: 10px;" type="primary" icon="plus" @click="editCode">编辑字典</a-button>
           <!-- <a-select style="width: 110px" placeholder="更多操作" allowClear >
                <a-select-option @click="editCode" value="编辑字典">编辑字典</a-select-option>
                <a-select-option @click="delectCode" value="删除字典">删除字典</a-select-option>
@@ -16,11 +16,11 @@
           <span>当前选择:<span style="color: #40a9ff;font-weight: 600;">{{ selectedMenu }}</span><span v-if="selectedKey.length" class="imgSize" @click="cancelSel">取消选择</span></span>
         </a-row>
         <a-row :gutter="24" >
-          <a-input-search v-model="code" placeholder="输入编码类别/名称 搜索字典" style="width: 100%" @search="getCodeList" />
+          <a-input-search id="dataDictionary-search" v-model="code" placeholder="输入编码类别/名称 搜索字典" style="width: 100%" @search="getCodeList" />
         </a-row>
         <a-row :gutter="24" >
           <a-menu class="menu-box" style="border-right: 0;max-height: 660px;overflow: auto;" v-model="selectedKey" >
-            <a-menu-item style="margin-bottom: 0px;height: 30px; line-height: 30px;" v-for="(item,index) in codeList" :key="index" :value="item">{{ item.name }}</a-menu-item>
+            <a-menu-item id="dataDictionary-menu" style="margin-bottom: 0px;height: 30px; line-height: 30px;" v-for="(item,index) in codeList" :key="index" :value="item">{{ item.name }}</a-menu-item>
           </a-menu>
           <span v-if="noData" style="line-height: 50px; font-weight: 600;">暂无数据</span>
         </a-row>
@@ -29,11 +29,11 @@
       <a-col :span="18" >
         <div style="padding-left: 20px;">
           <div class="table-page-search-wrapper">
-            <a-form layout="inline">
+            <a-form layout="inline" id="dataDictionary-form">
               <a-row :gutter="48">
                 <a-col :md="6" :sm="24">
                   <a-form-item label="数据名称">
-                    <a-input allowClear v-model.trim="queryParam.dispName" placeholder="请输入数据名称"/>
+                    <a-input id="dataDictionary-dispName" allowClear v-model.trim="queryParam.dispName" placeholder="请输入数据名称"/>
                   </a-form-item>
                 </a-col>
 
@@ -41,13 +41,14 @@
                   <a-form-item label="状态">
                     <a-select
                       allowClear
+                      id="dataDictionary-isEnable"
                       v-model="queryParam.isEnable"
                       placeholder="请选择"
                     >
-                      <a-select-option :value="1">
+                      <a-select-option :value="1" id="dataDictionary-isEnable1">
                       </a-select-option>
-                      <a-select-option :value="0">
+                      <a-select-option :value="0" id="dataDictionary-isEnable0">
                       </a-select-option>
                     </a-select>
@@ -55,7 +56,7 @@
                   </a-form-item>
                 </a-col>
                 <a-col :md="2" :sm="24">
-                  <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+                  <a-button id="dataDictionary-refresh" type="primary" @click="$refs.table.refresh(true)">查询</a-button>
                 </a-col>
                 <!-- <a-col :md="2" :sm="24">
                   <a-button type="primary" @click="queryParam=''">重置</a-button>
@@ -63,16 +64,17 @@
               </a-row>
             </a-form>
           </div>
-          <!-- <a-divider/> -->
+          <!-- <a-divider/> 操作按钮-->
           <div class="table-operator">
-            <a-button type="primary" icon="plus" @click="openCodeItemModal">添加数据</a-button>
+            <a-button type="primary" id="dataDictionary-add" icon="plus" @click="openCodeItemModal">添加数据</a-button>
             <!-- <a-button type="" icon="delete" @click="delectAll">批量删除</a-button> -->
-            <a-button type="" icon="reload" @click="$refs.table.refresh(true)">刷新数据</a-button>
+            <a-button type="" id="dataDictionary-renew" icon="reload" @click="$refs.table.refresh(true)">刷新数据</a-button>
           </div>
           <!-- <div  class="textCount">
             <a-icon type="info-circle" style="color: #1890FF;margin-right: 10px;" />
             <span>已选择<span style="color: #40a9ff;font-weight: 600;margin-left: 10px;">{{selectedNum}}项</span><span class="imgSize">清空</span></span>
           </div> -->
+          <!-- 列表 -->
           <s-table
             ref="table"
             size="small"
@@ -84,25 +86,28 @@
           >
             <span slot="action" slot-scope="text, record">
               <template>
-                <a class="action-button" @click="handleEdit(record)">修改</a>
-                <a v-if="!record.isEnable" class="action-button red-text" @click="delect(record)">删除</a>
+                <a class="action-button" :id="'dataDictionary-edit-btn'+record.id" @click="handleEdit(record)">修改</a>
+                <a v-if="!record.isEnable" :id="'dataDictionary-del-btn'+record.id" class="action-button red-text" @click="delect(record)">删除</a>
               </template>
             </span>
           </s-table>
         </div>
-
       </a-col>
     </a-row>
+    <!-- 添加/编辑数据字典弹窗 -->
     <codeModal :visible="showCodeModal" :data="codeData" @refresh="getCodeList" @close="showCodeModal = false"></codeModal>
+    <!-- 添加数据弹窗 -->
     <codeItemModal :visible="showItemCodeModal" :data="itemCodeData" @refresh="$refs.table.refresh(true)" @close="showItemCodeModal = false"></codeItemModal>
   </a-card>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import codeModal from './codeModal.vue'
 import codeItemModal from './codeItemModal.vue'
+// 接口
 import { listLookUp, delLookUp, getLookUpItem, delLookUpItem } from '@/api/lookup.js'
 export default {
   name: 'PowerDD',
@@ -129,22 +134,23 @@ export default {
     return {
       // 查询参数
       queryParam: {
-        dispName: '',
-        isEnable: undefined,
+        dispName: '', // 名称
+        isEnable: undefined, // 是否启用
         lookupCode: ''
       },
-      noData: false,
+      noData: false, // 没有数据 为空图片显示
       code: '', // 根据输入编码类别/名称搜索字典
-      selectedNum: '',
+      selectedNum: '', // 已选择数据条数
       selectedKey: [], // 选中的字典编码项
-      selectedMenu: '',
+      selectedMenu: '', // 选中的菜单名称
       formLayout: 'horizontal',
+      // 提交参数
       form: this.$form.createForm(this, { name: 'miniForm' }),
-      codeList: [],
-      showCodeModal: false,
-      showItemCodeModal: false,
+      codeList: [], // 字典列表数据
+      showCodeModal: false, // 添加/编辑数据字典弹窗
+      showItemCodeModal: false, // 添加数据弹窗
       codeData: {}, // 编辑字典行数据
-      itemCodeData: {},
+      itemCodeData: {}, // 当前行数据
       // 表头
       columns: [
         {
@@ -206,8 +212,9 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         console.log(parameter, 'parameter')
-
+        // 获取列表数据  有分页
         return getLookUpItem(Object.assign(parameter, this.queryParam)).then(res => {
+          // 计算表格序号
           const no = (res.data.pageNo - 1) * res.data.pageSize
           for (let i = 0; i < res.data.list.length; i++) {
             const _item = res.data.list[i]
@@ -218,7 +225,7 @@ export default {
         })
       },
       optionAlertShow: false,
-      windowHeight: 0
+      windowHeight: 0// 页面高度
     }
   },
   methods: {
@@ -339,11 +346,13 @@ export default {
         }
       })
     },
+    // 编辑打开添加数据弹窗
     handleEdit (row) {
       console.log(row, 'row')
       this.showItemCodeModal = true
       this.itemCodeData = row
     },
+    // 计算表格高度
     setTableH () {
       this.windowHeight = window.innerHeight - 90
     }
@@ -372,6 +381,7 @@ export default {
     }
   },
   watch: {
+    // 重组菜单列表数据
     selectedKey (newValue, oldValue) {
       console.log(newValue, 'newValue')
       if (newValue.length) {

+ 30 - 15
src/views/setting/bigScreenSet/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <a-card size="small" :bordered="false" class="noticeManagementList-wrap" :style="{height:windowHeight +'px'}">
+  <a-card size="small" :bordered="false" class="bigScreenSet-wrap" :style="{height:windowHeight +'px'}">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 设置条件 -->
       <div class="setTit">大屏参数设置</div>
@@ -9,22 +9,29 @@
           :model="form"
           ref="ruleForm"
           :rules="rules"
+          id="bigScreenSet-form"
           :label-col="labelCol"
           :wrapper-col="wrapperCol">
           <a-row>
             <a-col :md="13" :sm="24">
               <div class="flexBox">
                 <a-form-model-item label="销售系数:" prop="saleNum">
-                  <a-input style="width:93%;margin-right: 10px;" v-model.trim="form.saleNum" allowClear placeholder="请输入销售系数" oninput="if(!/^[0-9]+$/.test(value)) value=value.replace(/\D/g,'');if(value>99900)value=99900;if(value<0)value=null"></a-input>
+                  <a-input
+                    id="bigScreenSet-saleNum"
+                    style="width:93%;margin-right: 10px;"
+                    v-model.trim="form.saleNum"
+                    allowClear
+                    placeholder="请输入销售系数"
+                    oninput="if(!/^[0-9]+$/.test(value)) value=value.replace(/\D/g,'');if(value>99900)value=99900;if(value<0)value=null"></a-input>
                   <span>%</span>
                 </a-form-model-item>
               </div>
             </a-col>
             <a-col :md="13" :sm="24">
               <a-form-model-item label="销售额类型:" prop="saleType">
-                <a-select v-model="form.saleType" placeholder="请选择销售额类型">
-                  <a-select-option value="sale_price">开单金额</a-select-option>
-                  <a-select-option value="real_price">实售金额</a-select-option>
+                <a-select id="bigScreenSet-saleType" v-model="form.saleType" placeholder="请选择销售额类型">
+                  <a-select-option id="bigScreenSet-saleType-salePrice" value="sale_price">开单金额</a-select-option>
+                  <a-select-option id="bigScreenSet-saleType-realPrice" value="real_price">实售金额</a-select-option>
                 </a-select>
               </a-form-model-item>
             </a-col>
@@ -33,7 +40,7 @@
       </div>
       <!-- 操作按钮 -->
       <div class="table-operator">
-        <a-button id="noticeManagementList-add" type="primary" class="button-error" @click="handleAdd" :loading="iconLoading">确定</a-button>
+        <a-button id="bigScreenSet-save" type="primary" class="button-error" @click="handleAdd" :loading="iconLoading">确定</a-button>
       </div>
     </a-spin>
   </a-card>
@@ -41,7 +48,9 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { VSelect } from '@/components'
+// 接口
 import { queryList, batchUpdateByCode } from '@/api/sysParamsConfig'
 export default {
   name: 'BigScreenSetIndex',
@@ -50,25 +59,28 @@ export default {
   data () {
     return {
       spinning: false,
-      form: { //  查询条件
-        saleNum: undefined,
-        saleType: undefined
+      //  查询条件
+      form: {
+        saleNum: undefined, // 销售系数
+        saleType: undefined// 销售额类型
       },
+      // form表单label布局
       labelCol: { span: 4 },
       wrapperCol: { span: 14 },
-      listData: [],
-      saleNumPos: null,
-      saleTypePos: null,
+      listData: [], // 列表数据
+      saleNumPos: null, // 销售系数位置
+      saleTypePos: null, // 销售额类型位置
+      // form表单验证规则
       rules: {
         saleNum: [{ required: true, message: '销售系数不能为空', trigger: 'blur' }],
         saleType: [{ required: true, message: '销售额类型不能为空', trigger: 'change' }]
       },
-      iconLoading: false,
-      windowHeight: 0
+      iconLoading: false, // 确定按钮加载状态
+      windowHeight: 0// 页面高度
     }
   },
   methods: {
-    // 获取数据
+    // 获取销售额类型数据
     getData () {
       this.spinning = true
       queryList({ }).then(res => {
@@ -86,6 +98,7 @@ export default {
         }
       })
     },
+    // 确定保存
     handleAdd () {
       this.iconLoading = true
       const saleNum = this.form.saleNum / 100
@@ -97,12 +110,14 @@ export default {
         this.iconLoading = false
       })
     },
+    // 计算页面高度
     setTableH () {
       this.windowHeight = window.innerHeight - 90
     }
   },
   created () {
     this.getData()
+    // 计算页面显示高度
     this.setTableH()
   }
 }

+ 5 - 4
src/views/setting/checkDingTask/list.vue

@@ -1,9 +1,9 @@
 <template>
-  <a-card size="small" :bordered="false" class="rebateSettingsList-wrap" :style="{height:windowHeight +'px'}">
+  <a-card size="small" :bordered="false" class="checkDingTaskList-wrap" :style="{height:windowHeight +'px'}">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-button type="primary" @click="updateFun">钉钉审批查询</a-button>
+        <a-button type="primary" id="checkDingTaskList-refresh" @click="updateFun">钉钉审批查询</a-button>
       </div>
     </a-spin>
   </a-card>
@@ -11,15 +11,15 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 接口
 import { checkOptionTask } from '@/api/mqmsg'
-
 export default {
   name: 'CheckDingTaskList',
   mixins: [commonMixin],
   data () {
     return {
       spinning: false,
-      windowHeight: 0
+      windowHeight: 0// 页面高度
     }
   },
   methods: {
@@ -32,6 +32,7 @@ export default {
         _this.spinning = false
       })
     },
+    // 计算页面显示高度
     setTableH () {
       this.windowHeight = window.innerHeight - 90
     }

+ 10 - 4
src/views/setting/erpAllotSettings/list.vue

@@ -4,6 +4,7 @@
       <!-- 列表 -->
       <s-table
         class="sTable fixPagination"
+        id="erpAllotSettings-table"
         ref="table"
         :style="{ height: tableHeight+60+'px'}"
         size="small"
@@ -25,7 +26,7 @@
             size="small"
             style="width:30%;"
             code="ERP_PRICE_TYPE"
-            id="erpAllotSettings-erpPriceType"
+            :id="'erpAllotSettings-erpPriceType'+record.id"
             v-model="record.erpPriceType"
             placeholder="请选择"
             @change="e=>handleType(record,e)"></v-select>
@@ -37,7 +38,9 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
+// 接口
 import { allocateTypeTreeList, allocateTypeSave } from '@/api/allocateType.js'
 export default {
   name: 'ErpAllotSettings',
@@ -46,7 +49,8 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
+      // 表头
       columns: [
         { title: '费用/调拨类型', scopedSlots: { customRender: 'titles' }, width: '70%', align: 'left' },
         { title: '同步ERP价格类型', scopedSlots: { customRender: 'action' }, width: '30%', align: 'center' }
@@ -54,6 +58,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
+        // 获取列表数据 无分页
         return allocateTypeTreeList(parameter).then(res => {
           let data
           if (res.status == 200) {
@@ -64,8 +69,7 @@ export default {
           return data
         })
       },
-      itemId: null,
-      parentData: null
+      itemId: null // 当前行数据id
     }
   },
   methods: {
@@ -95,12 +99,14 @@ export default {
         }
       })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       this.tableHeight = window.innerHeight - 180
     }

+ 28 - 19
src/views/setting/erpMessageManagement/list.vue

@@ -1,22 +1,22 @@
 <template>
   <div>
-    <a-card size="small" :bordered="false" class="rebateSettingsList-wrap searchBoxNormal">
+    <a-card size="small" :bordered="false" class="erpMessageManagement-wrap searchBoxNormal">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" id="erpMessageManagement-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="同步时间">
-                <rangeDate ref="rangeDate" @change="dateChange" />
+                <rangeDate ref="rangeDate" id="erpMessageManagement-rangeDate" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="处理状态">
-                <a-select placeholder="请选择处理状态" v-model="queryParam.handleResult">
-                  <a-select-option value="finish">
+                <a-select placeholder="请选择处理状态" id="erpMessageManagement-handleResult" v-model="queryParam.handleResult">
+                  <a-select-option value="finish" id="erpMessageManagement-handleResult-finish">
                     处理成功
                   </a-select-option>
-                  <a-select-option value="fail">
+                  <a-select-option value="fail" id="erpMessageManagement-handleResult-fail">
                     处理失败
                   </a-select-option>
                 </a-select>
@@ -24,12 +24,12 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="业务编码">
-                <a-input id="rebateSettingsList-no" v-model.trim="queryParam.bizId" allowClear placeholder="请输入完整的业务编码"/>
+                <a-input id="erpMessageManagement-bizId" v-model.trim="queryParam.bizId" allowClear placeholder="请输入完整的业务编码"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="rebateSettingsList-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="rebateSettingsList-reset">重置</a-button>
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="erpMessageManagement-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="erpMessageManagement-reset">重置</a-button>
             </a-col>
           </a-row>
         </a-form>
@@ -40,6 +40,7 @@
       <a-spin :spinning="spinning" tip="Loading...">
         <s-table
           class="sTable fixPagination"
+          id="erpMessageManagement-table"
           ref="table"
           :style="{ height: tableHeight+70+'px' }"
           size="small"
@@ -79,7 +80,7 @@
               class="button-info"
               v-if="record.handleResult&&record.handleResult=='fail'"
               @click="handleAgainSync(record)"
-              id="rebateSettingsList-edit-btn">重新同步</a-button>
+              :id="'erpMessageManagement-reOperate-btn'+record.id">重新同步</a-button>
             <span v-else>--</span>
           </template>
         </s-table>
@@ -90,9 +91,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
-import { queryReceivePage, handle } from '@/api/mqmsg'
 import rangeDate from '@/views/common/rangeDate.vue'
+// 接口
+import { queryReceivePage, handle } from '@/api/mqmsg'
 export default {
   name: 'ErpMessageManagementList',
   mixins: [commonMixin],
@@ -100,15 +103,17 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
+      disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0, // 列表高度
+      // 查询参数
       queryParam: {
-        createDateStart: '',
-        createDateEnd: '',
-        handleResult: undefined,
-        bizType: 'KdMidSpareInputs',
-        bizId: undefined
+        createDateStart: '', // 同步开始时间
+        createDateEnd: '', // 同步结束时间
+        handleResult: undefined, // 处理状态
+        bizType: 'KdMidSpareInputs', // 业务类型
+        bizId: undefined// 业务编码
       },
-      disabled: false, //  查询、重置按钮是否可操作
+      // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: '3.5%', align: 'center' },
         { title: '同步时间', dataIndex: 'createDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -124,10 +129,12 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据 有分页
         return queryReceivePage(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -141,7 +148,7 @@ export default {
     }
   },
   methods: {
-    //  时间  change
+    //  同步时间  change
     dateChange (date) {
       this.queryParam.createDateStart = date[0] ? date[0] : ''
       this.queryParam.createDateEnd = date[1] ? date[1] : ''
@@ -176,12 +183,14 @@ export default {
         }
       })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 200

+ 18 - 12
src/views/setting/noticeManagement/detailModal.vue

@@ -1,14 +1,14 @@
 <template>
   <a-modal
     centered
-    class="announcementDetail-modal"
+    class="noticeDetail-modal"
     :footer="null"
     :maskClosable="false"
     title="公告详情"
     v-model="isShow"
     @cancel="isShow=false"
     width="68%">
-    <div class="noticeEditContent">
+    <div class="noticeDetailContent">
       <a-descriptions bordered size="small" :column="2">
         <a-descriptions-item label="类别">{{ typeDictValue }}</a-descriptions-item>
         <a-descriptions-item label="可见性">{{ toAppNameDictValue }}</a-descriptions-item>
@@ -28,15 +28,16 @@
         </a-descriptions-item>
         <a-descriptions-item label="附件" :span="2">
           <p style="margin: 0 0 5px;" v-for="(item,index) in attachPathsArr" :key="index">
-            <a :href="item.filePath" :download="item.fileName" class="attachLink">{{ item.fileName }}</a>
+            <a id="noticeDetail-fileDownLoad" :href="item.filePath" :download="item.fileName" class="attachLink">{{ item.fileName }}</a>
           </p>
           <span v-if="attachPathsArr.length == 0">--</span>
         </a-descriptions-item>
       </a-descriptions>
     </div>
     <div class="btn-cont">
-      <a-button id="announcementDetail-back" @click="isShow = false" style="margin-left: 15px;">关闭</a-button>
+      <a-button id="noticeDetail-close-btn" @click="isShow = false" style="margin-left: 15px;">关闭</a-button>
     </div>
+    <!-- 查看图片弹窗 -->
     <a-modal :visible="previewVisible" :footer="null" centered :maskClosable="false" @cancel="previewVisible=false">
       <img alt="example" style="width: 100%" :src="previewImage" />
     </a-modal>
@@ -44,9 +45,10 @@
 </template>
 
 <script>
+// 接口
 import { noticeDetail } from '@/api/notice'
 export default {
-  name: 'AnnouncementDetailModal',
+  name: 'NoticeDetailModal',
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -61,12 +63,13 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       detailsData: null, //  详情数据
-      previewVisible: false,
-      previewImage: ''
+      previewVisible: false, // 查看图片弹窗
+      previewImage: ''// 查看图片地址
     }
   },
   computed: {
-    typeDictValue () { //  类别  数据字典name
+    //  类别  数据字典name
+    typeDictValue () {
       let str = ''
       if (this.detailsData && this.detailsData.type == 'notity') {
         str = '公告'
@@ -79,7 +82,8 @@ export default {
       }
       return str
     },
-    toAppNameDictValue () { //  可见性  数据字典name
+    //  可见性  数据字典name
+    toAppNameDictValue () {
       let str = ''
       if (this.detailsData && this.detailsData.toAppName == '1,2') {
         str = '所有'
@@ -92,14 +96,16 @@ export default {
       }
       return str
     },
-    imgPathsArr () { //  图片数组
+    //  图片数组
+    imgPathsArr () {
       let arr = []
       if (this.detailsData && this.detailsData.imgPaths) {
         arr = this.detailsData.imgPaths.split(',')
       }
       return arr
     },
-    attachPathsArr () { //  附件数组
+    //  附件数组
+    attachPathsArr () {
       let arr = []
       if (this.detailsData && this.detailsData.attachList) {
         arr = this.detailsData.attachList
@@ -145,7 +151,7 @@ export default {
 </script>
 
 <style lang="less">
-  .announcementDetail-modal{
+  .noticeDetail-modal{
     .ant-modal-body {
       padding: 20px 40px 24px;
     }

+ 19 - 11
src/views/setting/noticeManagement/editModal.vue

@@ -75,8 +75,8 @@
       </a-spin>
     </div>
     <div class="btn-cont">
-      <a-button id="product-brand-edit-modal-back" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
-      <a-button type="primary" id="product-brand-edit-modal-save" @click="handleSave">保存</a-button>
+      <a-button id="noticeEdit-cancel-btn" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
+      <a-button type="primary" id="noticeEdit-save-btn" @click="handleSave">保存</a-button>
     </div>
   </a-modal>
 </template>
@@ -84,8 +84,10 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
+// 组件
 import { VSelect, Upload } from '@/components'
 import Editor from '@/components/WEeditor'
+// 接口
 import { noticeSave, noticeDetail } from '@/api/notice'
 export default {
   name: 'ProductBrandEditModal',
@@ -106,6 +108,7 @@ export default {
     }
   },
   computed: {
+    // 弹窗标题
     modalTit () {
       return (this.itemId ? '编辑' : '新增') + '公告'
     }
@@ -114,20 +117,23 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      // form表单label布局
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 18 }
       },
+      // 提交参数
       form: {
-        type: undefined,
-        toAppName: undefined,
-        title: '',
-        releaseDate: null,
-        imgPaths: '',
-        attachList: '',
-        content: ''
+        type: undefined, // 类别
+        toAppName: undefined, // 可见性
+        title: '', // 公告标题
+        releaseDate: null, // 公告发布时间
+        imgPaths: '', // 公告图片
+        attachList: '', // 公告附件
+        content: ''// 公告内容
       },
-      attachList: [],
+      attachList: [], // 附件集合
+      // form表单验证规则
       rules: {
         type: [
           { required: true, message: '请选择类别', trigger: 'change' }
@@ -142,13 +148,15 @@ export default {
           { required: true, message: '请选择发布时间', trigger: 'change' }
         ]
       },
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo'
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo' // 上传附件地址
     }
   },
   methods: {
+    // 不可选日期
     disabledDate (current) {
       return current && current < moment().startOf('day')
     },
+    // 禁用时间
     disabledDateTime (date) {
       if (!date) {
         date = moment()

+ 18 - 10
src/views/setting/noticeManagement/list.vue

@@ -3,7 +3,7 @@
     <a-card size="small" :bordered="false" class="noticeManagementList-wrap searchBoxNormal">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" id="noticeManagementList-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="标题">
@@ -41,6 +41,7 @@
         <!-- 列表 -->
         <s-table
           class="sTable fixPagination"
+          id="noticeManagementList-table"
           ref="table"
           :style="{ height: tableHeight+84.5+'px' }"
           size="small"
@@ -58,21 +59,21 @@
               class="button-info"
               v-if="record.sendStatus=='0'"
               @click="handleEdit(record)"
-              id="noticeManagementList-edit-btn">编辑</a-button>
+              :id="'noticeManagementList-edit-btn'+record.id">编辑</a-button>
             <a-button
               size="small"
               type="link"
               class="button-success"
               v-if="record.sendStatus=='1'"
               @click="handleDetail(record)"
-              id="noticeManagementList-detail-btn">详情</a-button>
+              :id="'noticeManagementList-detail-btn'+record.id">详情</a-button>
             <a-button
               size="small"
               type="link"
               class="button-error"
               v-if="record.sendStatus=='0'"
               @click="handleDel(record)"
-              id="noticeManagementList-del-btn">删除</a-button>
+              :id="'noticeManagementList-del-btn'+record.id">删除</a-button>
           </template>
         </s-table>
       </a-spin>
@@ -86,9 +87,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import noticeEditModal from './editModal.vue'
 import noticeDetailModal from './detailModal.vue'
+// 接口
 import { noticeList, noticeDel } from '@/api/notice'
 export default {
   name: 'NoticeManagementList',
@@ -97,13 +100,15 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
-      queryParam: { //  查询条件
-        title: '',
-        type: undefined,
-        sendStatus: undefined
-      },
+      tableHeight: 0, // 表格高度
       disabled: false, //  查询、重置按钮是否可操作
+      //  查询条件
+      queryParam: {
+        title: '', // 标题
+        type: undefined, // 类别
+        sendStatus: undefined// 发布状态
+      },
+      // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -118,6 +123,7 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据  有分页
         return noticeList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
@@ -196,12 +202,14 @@ export default {
         }
       })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 254