Explorar el Código

Merge branch 'develop_yh42_4' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh43

# Conflicts:
#	src/views/expenseManagement/expenseReimbursement/add.vue
#	src/views/promotionRulesManagement/dealerPromotions/list.vue
lilei hace 10 meses
padre
commit
18a9aaed47
Se han modificado 28 ficheros con 1101 adiciones y 573 borrados
  1. 1 1
      public/version.json
  2. 11 0
      src/api/expenseManagement.js
  3. 3 3
      src/api/promotion.js
  4. 22 1
      src/api/salesNew.js
  5. 127 47
      src/views/expenseManagement/expenseReimbursement/add.vue
  6. 43 28
      src/views/expenseManagement/expenseReimbursement/baseDataModal.vue
  7. 12 8
      src/views/expenseManagement/expenseReimbursement/chooseDepartUserModal.vue
  8. 7 2
      src/views/expenseManagement/expenseReimbursement/chooseImportModal.vue
  9. 29 21
      src/views/expenseManagement/expenseReimbursement/detail.vue
  10. 27 8
      src/views/expenseManagement/expenseReimbursement/epenseCdfModal.vue
  11. 89 60
      src/views/expenseManagement/expenseReimbursement/epenseDetailModal.vue
  12. 4 6
      src/views/expenseManagement/expenseReimbursement/importGuideModal.vue
  13. 78 58
      src/views/expenseManagement/expenseReimbursement/list.vue
  14. 116 113
      src/views/expenseManagement/expenseReimbursement/previewModal.vue
  15. 7 14
      src/views/expenseManagement/expenseReimbursement/productInfoModal.vue
  16. 1 1
      src/views/expenseManagement/expenseReimbursement/verifyModal.vue
  17. 37 27
      src/views/expenseManagement/expenseReimbursementDetail/list.vue
  18. 3 2
      src/views/promotionRulesManagement/dealerPromotions/detail.vue
  19. 120 0
      src/views/promotionRulesManagement/dealerPromotions/endDescModal.vue
  20. 19 21
      src/views/promotionRulesManagement/dealerPromotions/list.vue
  21. 18 15
      src/views/promotionRulesManagement/orderStatistics/list.vue
  22. 3 1
      src/views/reportData/tireSalesReport/detailList.vue
  23. 1 1
      src/views/reportData/tireSalesReport/outDetailModal.vue
  24. 3 0
      src/views/salesManagement/salesQueryNew/list.vue
  25. 134 59
      src/views/salesManagement/waitCostOrder/list.vue
  26. 83 0
      src/views/salesManagement/waitCostOrder/meargeOptionModal.vue
  27. 102 75
      src/views/salesManagement/waitCostOrder/viewSelectModal.vue
  28. 1 1
      vue.config.js

+ 1 - 1
public/version.json

@@ -1,4 +1,4 @@
 {
-    "version": "2.2.41",
+    "version": "2.2.43",
     "message": "发现有新版本发布,确定更新系统?"
 }

+ 11 - 0
src/api/expenseManagement.js

@@ -169,6 +169,17 @@ export const expenseAcctDetailSave = (params) => {
     }
   })
 }
+// 批量保存费用明细
+export const updateBatchExpenseAcctDetail = (params) => {
+  return axios({
+    url: `/expenseAcctDetail/updateDetailByAccount`,
+    data: params,
+    method: 'post',
+    headers:{
+      'module': encodeURIComponent('批量修改记账名称')
+    }
+  })
+}
 // 费用类型
 export const expenseTypeList = (params) => {
   return axios({

+ 3 - 3
src/api/promotion.js

@@ -155,9 +155,9 @@ export const promotionDateModify = (params) => {
 // 中止
 export const promotionIsOver = (params) => {
   return axios({
-    url: `/promotion/isOver/${params.sn}`,
-    data: {},
-    method: 'get',
+    url: '/promotion/isOver',
+    data: params,
+    method: 'post',
     headers: {
       'module': encodeURIComponent('终止')
     }

+ 22 - 1
src/api/salesNew.js

@@ -262,7 +262,28 @@ export const queryBatchCreateBySalesBillSn = (params) => {
     method: 'post'
   })
 }
-
+// 批量查询合并后的报销单
+export const queryBatchCreateBySalesPromoSnListGroupType = (params) => {
+  return axios({
+    url: `/expenseAccount/queryBatchCreateBySalesPromoSnListGroupType`,
+    data: params,
+    method: 'post',
+    headers:{
+      'module': encodeURIComponent('销售单合并后转费用报销单')
+    }
+  })
+}
+// 保存合并选项
+export const expenseAccountSaveGroupType = (params) => {
+  return axios({
+    url: `/expenseAccount/saveCreateGroupType`,
+    data: params,
+    method: 'post',
+    headers:{
+      'module': encodeURIComponent('销售单转费用报销单,确定合并')
+    }
+  })
+}
 // 保存费用报销单
 export const expenseAccountSave = (params) => {
   return axios({

+ 127 - 47
src/views/expenseManagement/expenseReimbursement/add.vue

@@ -4,10 +4,10 @@
       <a-page-header :ghost="false" :backIcon="false" class="expenseReimbursementAddcont" >
         <!-- 自定义的二级文字标题 -->
         <template slot="subTitle">
-          <a id="purchaseOrderEdit-back-btn" href="javascript:;" @click="handleBack(0)"><a-icon type="left" /> 返回列表</a>
+          <a id="expenseEdit-back-btn" href="javascript:;" @click="handleBack(0)"><a-icon type="left" /> 返回列表</a>
           <span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ detailData&&detailData.expenseAccountNo }}</span>
           <span style="margin: 0 10px;color: #666;">申请人:{{ detailData&&detailData.applyPersonName || '--' }}</span>
-          <a-button size="small" type="link" class="button-default" @click="showDetail=!showDetail">
+          <a-button size="small" type="link" class="button-default" id="expenseEdit-showdesc" @click="showDetail=!showDetail">
             <a-icon :type="showDetail ? 'eye-invisible' : 'eye'"/> {{ showDetail?'隐藏':'查看' }}信息
           </a-button>
         </template>
@@ -15,7 +15,7 @@
       <a-card :bordered="false" size="small" class="expenseReimbursementAddcont" v-show="showDetail">
         <div slot="title">
           <span>基础信息</span>
-          <div style="cursor:pointer;color: #00aaff;float:right;" @click.stop="handleEditBase" >
+          <div style="cursor:pointer;color: #00aaff;float:right;" id="expenseEdit-showEditModal" @click.stop="handleEditBase" >
             <a-icon type="edit" /> 编辑基础信息
           </div>
         </div>
@@ -33,7 +33,13 @@
           <a-descriptions-item label="主题" :span="3">{{ detailData&&detailData.title || '--' }}</a-descriptions-item>
           <a-descriptions-item label="详细说明" :span="3">{{ detailData&&detailData.content.join(',')||'' }}</a-descriptions-item>
           <a-descriptions-item label="附件" :span="3">
-            <a target="_blank" style="color: #00aaff;text-decoration: underline;margin-right: 15px;" :href="item.filePath" v-for="item in detailData.expenseAccountFilesList" :key="item.id">
+            <a
+              target="_blank"
+              style="color: #00aaff;text-decoration: underline;margin-right: 15px;"
+              :href="item.filePath"
+              v-for="item in detailData.expenseAccountFilesList"
+              :id="item.id"
+              :key="item.id">
               {{ item.fileName }}
             </a>
           </a-descriptions-item>
@@ -45,8 +51,9 @@
           <div style="display: flex;justify-content: space-between;align-items: center;">
             <div>费用明细</div>
             <div>
-              <a-button size="small" class="button-info" type="primary" @click="openGuideModal=true">导入费用明细</a-button>
-              <a-button size="small" class="button-error" type="primary" @click="newExpenseDetail">新增费用明细</a-button>
+              <a-button id="expenseEdit-plEdit" size="small" class="button-info" type="primary" @click="plEdit">变更记账名称</a-button>
+              <a-button id="expenseEdit-import" size="small" class="button-info" type="primary" @click="openGuideModal=true">导入费用明细</a-button>
+              <a-button id="expenseEdit-new" size="small" class="button-error" type="primary" @click="newExpenseDetail">新增费用明细</a-button>
             </div>
           </div>
         </div>
@@ -63,6 +70,8 @@
           :rowKey="(record) => record.id"
           :columns="columns"
           :data="loadData"
+          :row-selection="{ columnWidth: 40 }"
+          @rowSelection="rowSelectionFun"
           :defaultLoadData="false"
           :showPagination="false"
           bordered>
@@ -72,18 +81,21 @@
               type="link"
               class="button-info"
               @click="setProduct(record)"
+              :id="'expenseEdit-set-'+record.id"
             >设置产品信息</a-button>
             <a-button
               size="small"
               type="link"
               class="button-info"
               @click="handleEdit(record)"
+              :id="'expenseEdit-edit-'+record.id"
             >编辑</a-button>
             <a-button
               size="small"
               type="link"
               class="button-error"
               @click="handleDel(record)"
+              :id="'expenseEdit-del-'+record.id"
             >删除</a-button>
           </template>
           <!-- 记账名称 -->
@@ -91,6 +103,10 @@
             <div>{{ text }}</div>
             <div v-if="record.accountNameFnumber">({{ record.accountNameFnumber }})</div>
           </template>
+          <!-- 原记账名称 -->
+          <template slot="yjzname" slot-scope="text,record">
+            <div>{{ text == record.accountName || !text ? '--' : text }}</div>
+          </template>
           <!-- 费用承担方 -->
           <template slot="fycdf" slot-scope="text,record">
             <div v-for="(item,index) in record.detailSplitList" :key="item.id+'-'+index">
@@ -128,12 +144,14 @@
     </div>
     <!-- 费用明细 -->
     <epenseDetailModal
+      ref="epenseDetailForm"
       :openModal="openEpenseDetailModal"
       :expenseAccountSn="$route.params.sn"
       :expenseAccountNo="detailData?detailData.expenseAccountNo:''"
       :expenseAccountDetailSn="expenseAccountDetailSn"
+      :isBatch="isBatch"
       @ok="epenseDetailOk"
-      @close="openEpenseDetailModal=false"></epenseDetailModal>
+      @close="epenseDetailClose"></epenseDetailModal>
     <!-- 产品信息设置 -->
     <productInfoModal
       ref="productInfo"
@@ -160,7 +178,7 @@ import productInfoModal from './productInfoModal.vue'
 import baseDataModal from './baseDataModal.vue'
 import ImportGuideModal from './importGuideModal.vue'
 import chooseDepartUserModal from './chooseDepartUserModal.vue'
-import { expenseAccountDetail, expenseAcctDetailDelete, expenseAcctDetailFindList, expenseAccountSubmit, expenseInsertImport } from '@/api/expenseManagement.js'
+import { expenseAccountDetail, expenseAcctDetailDelete, updateBatchExpenseAcctDetail, expenseAcctDetailFindList, expenseAccountSubmit, expenseInsertImport } from '@/api/expenseManagement.js'
 export default {
   name: 'ExpenseReimbursementEdit',
   mixins: [commonMixin],
@@ -169,15 +187,15 @@ export default {
     const _this = this
     return {
       spinning: false,
-      detailData: null,
-      openBaseModal: false,
-      openGuideModal: false,
-      openDepartUserModal: false,
+      detailData: null, // 详情信息
+      openBaseModal: false, // 基础信息编辑弹框
+      openGuideModal: false, // 导入费用明细弹框
+      openDepartUserModal: false, // 选择审核人员弹框
       openEpenseDetailModal: false, // 费用明细弹框
-      expenseAccountDetailSn: '',
+      expenseAccountDetailSn: '', // 费用明细sn
       openProductInfoModal: false, // 产品信息弹框
-      showDetail: false,
-      total: 0,
+      showDetail: false, // 是否显示详细信息
+      total: 0, // 总记录数
       loadData: parameter => {
         const params = Object.assign(parameter, { expenseAccountSn: this.$route.params.sn })
         return expenseAcctDetailFindList(params).then(res => {
@@ -203,20 +221,23 @@ export default {
         })
       },
       columns: [
-        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '记账类型', dataIndex: 'accountTypeDictValue', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
         { title: '记账名称', dataIndex: 'accountName', scopedSlots: { customRender: 'jzname' }, align: 'center', width: '10%' },
-        { title: '所属区域', dataIndex: 'subareaNames', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '所属分区', dataIndex: 'subareaAreaName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '所属省份', dataIndex: 'provinceName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '所属城市', dataIndex: 'cityName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '记账费用', dataIndex: 'expense', align: 'center', width: '10%', customRender: function (text) { return (text == 0 || text) ? _this.toThousands(text) : '--' } },
+        { title: '原记账名称', dataIndex: 'origAccountName', scopedSlots: { customRender: 'yjzname' }, align: 'center', width: '10%' },
+        { title: '所属区域', dataIndex: 'subareaNames', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '所属分区', dataIndex: 'subareaAreaName', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '所属省份', dataIndex: 'provinceName', align: 'center', width: '5%', customRender: function (text) { return text || '--' } },
+        { title: '所属城市', dataIndex: 'cityName', align: 'center', width: '5%', customRender: function (text) { return text || '--' } },
+        { title: '记账费用', dataIndex: 'expense', align: 'center', width: '8%', customRender: function (text) { return (text == 0 || text) ? _this.toThousands(text) : '--' } },
         { title: '费用承担方', scopedSlots: { customRender: 'fycdf' }, align: 'center', width: '15%' },
-        { title: '产品信息', scopedSlots: { customRender: 'cpxx' }, align: 'center', width: '12%' },
+        { title: '产品信息', scopedSlots: { customRender: 'cpxx' }, align: 'center', width: '10%' },
         { title: '销售单号', dataIndex: 'salesBillNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备注', dataIndex: 'remarks', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '100px', align: 'center' }
-      ]
+      ],
+      isBatch: false, // 是否变更记账名称
+      rowSelectionInfo: null // 批量选择的数据
     }
   },
   methods: {
@@ -224,10 +245,11 @@ export default {
     handleEditBase (event) {
       this.openBaseModal = true
     },
+    // 刷新列表
     refashData () {
       this.getDetail(true)
     },
-    //  费用单基础详情
+    //  获取费用单基础详情
     getDetail (type) {
       this.spinning = true
       this.disabled = true
@@ -245,46 +267,92 @@ export default {
         }
       })
     },
+    // 查询列表
     getExpenseDetailList () {
       this.$refs.table.refresh()
     },
     // 确认导入明细
     hanldeImprotOk (obj) {
-      console.log(obj)
       expenseInsertImport(obj).then(res => {
         if (res.status == 200) {
           this.getDetail(false)
         }
       })
     },
-    // 新增明细
-    newExpenseDetail () {
+    // 批量修改明细
+    plEdit () {
+      if (!this.rowSelectionInfo || (this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length < 1)) {
+        this.$message.warning('请在列表勾选后再进行操作!')
+        return
+      }
       this.expenseAccountDetailSn = ''
       this.openEpenseDetailModal = true
+      this.isBatch = true
     },
-    // 新增明细成功
-    epenseDetailOk () {
-      // 刷新列表
-      this.openEpenseDetailModal = false
-      this.getDetail(false)
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
     },
-    // 设置产品
-    setProduct (row) {
-      this.openProductInfoModal = true
-      this.expenseAccountDetailSn = row.expenseAccountDetailSn
-      this.$refs.productInfo.setBaseData(row)
-    },
-    // 新增产品成功
-    productInfoOk () {
-      // 刷新列表
-      this.openProductInfoModal = false
-      this.getDetail(false)
+    // 新增明细
+    newExpenseDetail () {
+      this.expenseAccountDetailSn = ''
+      this.openEpenseDetailModal = true
     },
     // 编辑明细
     handleEdit (row) {
       this.openEpenseDetailModal = true
       this.expenseAccountDetailSn = row.expenseAccountDetailSn
     },
+    // 新增修改明细成功
+    epenseDetailOk (data) {
+      // 如果是批量修改
+      if (this.isBatch) {
+        const rows = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+        const params = []
+        if (rows.length) {
+          rows.forEach(item => {
+            params.push({
+              expenseAccountDetailSn: item.expenseAccountDetailSn,
+              origAccountName: item.origAccountName,
+              origAccountNameSn: item.origAccountNameSn,
+              accountNameSn: data.accountNameSn,
+              accountType: data.accountType,
+              provinceName: data.provinceName,
+              provinceSn: data.provinceSn,
+              subareaArea: data.subareaArea,
+              cityName: data.cityName,
+              citySn: data.citySn,
+              expenseAccountNo: data.expenseAccountNo,
+              expenseAccountSn: data.expenseAccountSn,
+              remarks: data.remarks
+            })
+          })
+          // 组织数据
+          updateBatchExpenseAcctDetail(params).then(res => {
+            if (res.status == 200) {
+              this.$message.success(res.message)
+              // 修改成功
+              this.$refs.table.clearTable()
+              this.epenseDetailClose()
+              this.getDetail(false)// 刷新列表
+            }
+            this.$refs.epenseDetailForm.spinning = false
+          })
+        } else {
+          this.$message.warning('请在列表勾选后再进行操作!')
+          this.$refs.epenseDetailForm.spinning = false
+        }
+      } else {
+        // 单个修改成功
+        this.epenseDetailClose()
+        this.getDetail(false)// 刷新列表
+      }
+    },
+    // 明细弹框关闭
+    epenseDetailClose () {
+      this.openEpenseDetailModal = false
+      this.isBatch = false
+    },
     // 删除明细
     handleDel (row) {
       const _this = this
@@ -307,6 +375,19 @@ export default {
         }
       })
     },
+    // 设置产品
+    setProduct (row) {
+      this.openProductInfoModal = true
+      this.expenseAccountDetailSn = row.expenseAccountDetailSn
+      this.$refs.productInfo.setBaseData(row)
+    },
+    // 新增产品成功
+    productInfoOk () {
+      // 刷新列表
+      this.openProductInfoModal = false
+      this.getDetail(false)
+    },
+    // 提交前,选择审批人员
     beforeSubmit () {
       if (this.total) {
         this.openDepartUserModal = true
@@ -329,7 +410,9 @@ export default {
     handleBack (data) {
       this.$router.push({ name: 'expenseReimbursementList' })
     },
+    // 初始化页面
     pageInit () {
+      this.$refs.table.clearTable()
       if (this.$route.params.sn) { //  编辑页
         this.getDetail(false)
       }
@@ -341,10 +424,7 @@ export default {
     }
   },
   activated () {
-    // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
-    if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
-      this.pageInit()
-    }
+    this.pageInit()
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {})

+ 43 - 28
src/views/expenseManagement/expenseReimbursement/baseDataModal.vue

@@ -1,5 +1,6 @@
 <template>
   <a-modal
+    v-drag
     v-model="opened"
     :title="title"
     centered
@@ -19,18 +20,18 @@
         <a-row>
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <a-form-model-item label="申请人" prop="applyPersonSn">
-              <employee style="width: 100%;" @change="employeeChange" id="expenseReimbursement-Employee" v-model="form.applyPersonSn"></employee>
+              <employee style="width: 100%;" @change="employeeChange" id="expenseReimbursementAddform-Employee" v-model="form.applyPersonSn"></employee>
             </a-form-model-item>
           </a-col>
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <a-form-model-item label="申请部门" prop="applyDepartmentSn">
-              <department style="width: 100%;" @change="departementChange" id="expenseReimbursement-Department" v-model="form.applyDepartmentSn"></department>
+              <department style="width: 100%;" @change="departementChange" id="expenseReimbursementAddform-Department" v-model="form.applyDepartmentSn"></department>
             </a-form-model-item>
           </a-col>
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <a-form-model-item label="费用类型" prop="expenseType">
               <expenseType
-                id="expenseReimbursement-expenseType"
+                id="expenseReimbursementAddform-expenseType"
                 v-model="expenseTypes"
                 @change="expenseChange"
                 placeholder="请选择费用类型"
@@ -40,6 +41,7 @@
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <a-form-model-item label="费用产生月" prop="expenseDate">
               <a-month-picker
+                id="expenseReimbursementAddform-expenseDate"
                 placeholder="请选择月份"
                 v-model="form.expenseDate"
                 locale="zh-cn"
@@ -51,7 +53,7 @@
           <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
             <a-form-model-item label="主题" prop="title" :label-col="{span:3}" :wrapper-col="{span:19}">
               <a-textarea
-                id="expenseReimbursementAdd-title"
+                id="expenseReimbursementAddform-title"
                 :maxLength="100"
                 :rows="3"
                 v-model.trim="form.title"
@@ -62,7 +64,7 @@
           <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
             <a-form-model-item label="详细说明" prop="content" :label-col="{span:3}" :wrapper-col="{span:19}">
               <a-textarea
-                id="expenseReimbursementAdd-content"
+                id="expenseReimbursementAddform-content"
                 placeholder="请详细描述费用报销内容(最多500个字符)"
                 v-model.trim="form.content"
                 :rows="3"
@@ -76,7 +78,7 @@
             <a-form-model-item label="附件" help="(支持图片、word、excel、PDF等格式,最多10个附件)" :label-col="{span:3}" :wrapper-col="{span:19}">
               <Upload
                 style="height: 100%;"
-                id="noticeEdit-attachList"
+                id="expenseReimbursementAddform-attachList"
                 v-model="form.expenseAccountFilesList"
                 ref="attachList"
                 :fileSize="10"
@@ -90,8 +92,8 @@
           </a-col>
         </a-row>
         <div style="text-align: center;margin-top: 20px;">
-          <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
-          <a-button type="primary" :loading="spinning" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
+          <a-button @click="cancel" style="margin-right: 15px" id="expenseReimbursementAddform-btn-back">取消</a-button>
+          <a-button type="primary" :loading="spinning" @click="handleSubmit" id="expenseReimbursementAddform-btn-submit">保存</a-button>
         </div>
       </a-form-model>
     </a-spin>
@@ -118,17 +120,17 @@ export default {
   data () {
     return {
       opened: this.show,
-      expenseAccountSn: this.itemSn,
+      expenseAccountSn: this.itemSn, // 费用报销单sn
       spinning: false,
-      title: '新增费用报销单',
+      title: '新增费用报销单', // 弹框标题
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 14 }
       },
-      fromPage: null,
-      attachList: [],
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo',
-      expenseTypes: [],
+      fromPage: null, // 打开方式,sales:销售单转费用单,salesMearge:合并销售单转,其它手动创建
+      attachList: [], // 附件列表
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo', // 附件上传地址
+      expenseTypes: [], // 费用类型值
       form: {
         applyPersonSn: undefined, // 申请人
         applyDepartmentSn: undefined, //  申请部门
@@ -165,21 +167,24 @@ export default {
     }
   },
   methods: {
+    // 关闭弹框
     cancel () {
       this.spinning = false
       this.$emit('close')
     },
+    // 初始化
     pageInit () {
       this.$nextTick(() => {
         if (this.expenseAccountSn) { //  编辑页
           this.getDetail()
           this.title = '编辑费用报销单'
-        }else{
+        } else {
           this.title = '新增费用报销单'
         }
       })
     },
-    retsetForm(){
+    // 重置表单
+    retsetForm () {
       this.form = {
         applyPersonSn: undefined, // 申请人
         applyDepartmentSn: undefined, //  申请部门
@@ -208,19 +213,22 @@ export default {
         this.$refs.ruleForm.validateField(['applyPersonSn', 'applyDepartmentSn'])
       })
     },
+    // 申请部门选择
     departementChange () {
       this.$nextTick(() => {
         this.$refs.ruleForm.validateField('applyDepartmentSn')
       })
     },
+    // 费用产生月
     expenseDateChange (v, d) {
       this.form.expenseDate = d
     },
+    // 费用产生月禁止范围
     disabledDate (current) {
       return current && current > moment().endOf('day')
     },
+    // 费用类型选择
     expenseChange (val, opts) {
-      console.log(val, opts)
       this.expenseTypes = val || []
       this.form.expenseType = val && val[0] ? val[0] : ''
       this.form.expenseType2 = val && val[1] ? val[1] : ''
@@ -237,24 +245,23 @@ export default {
         item.fileType = item.extName
       })
     },
-    // 设置数据
-    setDetail(data, from){
-      console.log(data)
+    // 编辑时设置数据
+    setDetail (data, from) {
       this.spinning = false
       this.disabled = false
       this.fromPage = from
       this.form = Object.assign(this.form, data)
       // 获取附件列表
-      if(this.$refs.attachList){
+      if (this.$refs.attachList) {
         this.form.expenseAccountFilesList = ''
         this.attachList = data.expenseAccountFilesList
         this.$refs.attachList.setFileList(this.attachList)
       }
-      setTimeout(()=>{
+      setTimeout(() => {
         this.expenseTypes = data.expenseType ? [this.form.expenseType, this.form.expenseType2, this.form.expenseType3] : []
       }, 500)
     },
-    //  详情
+    //  获取详情
     getDetail () {
       this.spinning = true
       this.disabled = true
@@ -277,13 +284,20 @@ export default {
           const form = JSON.parse(JSON.stringify(_this.form))
           form.expenseDate = form.expenseDate + '-01'
           form.expenseAccountFilesList = this.attachList
+          // console.log(form)
           _this.spinning = true
-          console.log(form)
-          // 从销售单转的费用
-          if(_this.fromPage=='sales'){
-            _this.$emit('expenseSaveOk',form)
+
+          // 从销售单转的费用,直接提交
+          if (_this.fromPage == 'sales') {
+            _this.$emit('expenseSaveOk', form, this.fromPage)
+            return false
+          }
+          // 从销售单转的费用,合并提交
+          if (_this.fromPage == 'salesMearge') {
+            _this.$emit('expenseSaveOk', form, this.fromPage)
             return false
           }
+          // 手动建的费用单
           expenseAccountSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
@@ -291,6 +305,7 @@ export default {
                 if (this.expenseAccountSn) {
                   _this.$emit('refashData')
                 } else {
+                  // 跳转到费用明细单页面
                   _this.$router.push({ name: 'expenseReimbursementEdit', params: { sn: res.data.expenseAccountSn } })
                 }
                 _this.spinning = false
@@ -311,7 +326,7 @@ export default {
       this.opened = newValue
       if (newValue) {
         this.pageInit()
-      }else{
+      } else {
         this.retsetForm()
       }
     },

+ 12 - 8
src/views/expenseManagement/expenseReimbursement/chooseDepartUserModal.vue

@@ -46,7 +46,7 @@
         </div>
         <div class="btn-cont">
           <a-button id="departUser-back" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
-          <a-button :loading="uploading" style="margin-right: 15px;" @click="updateUser">刷新人员</a-button>
+          <a-button id="departUser-refash" :loading="uploading" style="margin-right: 15px;" @click="updateUser">刷新人员</a-button>
           <a-button type="primary" id="departUser-save" @click="handleSave">确定</a-button>
         </div>
       </div>
@@ -67,7 +67,7 @@ export default {
       type: Boolean,
       default: false
     },
-    type: {
+    type: { // 类型
       type: String,
       default: ''
     },
@@ -101,17 +101,19 @@ export default {
     }
   },
   methods: {
+    // 刷新人员数据
     updateUser () {
       this.uploading = true
       this.$refs.departUserApp.updateDeptUser()
       // this.$refs.departUserCc.updateDeptUser()
     },
+    // 选择人员
     changeApprovers (value) {
       this.form.approvers = value
       this.$refs.ruleForm.clearValidate()
     },
+    // 获取人员组织树数据
     getTreeVal (data) {
-      console.log(data)
       const ret = []
       data.map(item => {
         ret.push(item.value)
@@ -131,7 +133,6 @@ export default {
           if (form.ccList) {
             form.ccList = this.getTreeVal(form.ccList)
           }
-          console.log(form)
           this.$emit('submit', form)
           this.$emit('close')
         } else {
@@ -139,6 +140,7 @@ export default {
         }
       })
     },
+    // 格式化人员数据
     getFormatUser (list) {
       const ret = []
       list.map(item => {
@@ -146,16 +148,16 @@ export default {
       })
       return ret
     },
+    // 获取默认人员选项
     async getDefAudit () {
-      // 费用单''   提货单'billOfLading'   财务单'financeOrder'
+      // 费用单时 type = ''
       if (!this.type) {
         // 默认写死的人员
         const data = await getDefaultCofig({ code: 'EXPENSE_ACCOUNT_DING_USER' }).then(res => res.data)
         const ret = JSON.parse(data.value)
-        console.log(ret)
         this.form.approvers = this.getFormatUser(ret.approvers)
         this.form.ccList = this.getFormatUser(ret.ccList)
-      } else if (this.type && this.type == 'financeOrder') {
+      } else if (this.type && this.type == 'financeOrder') { // 财务单 type = 'financeOrder'
         // 取最新一次审核通过值
         const data = await queryLastFinishDingUser().then(res => res.data)
         if (data.approversTaskList) {
@@ -164,7 +166,8 @@ export default {
         if (data.ccTaskList) {
           this.form.ccList = this.getFormatUser(data.ccTaskList)
         }
-      } else if (this.type && this.type == 'billOfLading') {
+      } else if (this.type && this.type == 'billOfLading') { // 提货单 type = 'billOfLading'
+        // 取最新一次审核通过值
         const data = await getFinishDingUser().then(res => res.data)
         if (data.approversTaskList) {
           this.form.approvers = this.getFormatUser(data.approversTaskList)
@@ -174,6 +177,7 @@ export default {
         }
       }
     },
+    // 重置
     resetForm () {
       this.$nextTick(() => {
         this.$refs.ruleForm.resetFields()

+ 7 - 2
src/views/expenseManagement/expenseReimbursement/chooseImportModal.vue

@@ -125,6 +125,7 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
+      // 正确列表
       nowColumns: [
         { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
         { title: '记账类型', dataIndex: 'importAccountType', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -138,6 +139,7 @@ export default {
         { title: '产品信息', scopedSlots: { customRender: 'cpxx' }, align: 'center', width: '15%' }
       ],
       loadData: [],
+      // 错误数据列表
       nowUnColumns: [
         { title: '序号', dataIndex: 'no', width: '9%', align: 'center' },
         { title: '记账类型', dataIndex: 'importAccountType', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -156,7 +158,7 @@ export default {
     }
   },
   methods: {
-    // 格式化数据
+    // 格式化产品数据
     formatProduct (list) {
       const ret = []
       list.map(item => {
@@ -169,6 +171,7 @@ export default {
       })
       return ret
     },
+    // 格式化承担人员数据
     formatSplit (list) {
       const ret = []
       list.map(item => {
@@ -185,6 +188,7 @@ export default {
             })
           })
         } else {
+          // 没有承担人员
           ret.push({
             splitObjName: item.importSplitObjName,
             splitObjType: item.importSplitObjType,
@@ -194,6 +198,7 @@ export default {
       })
       return ret
     },
+    // 获取数据
     getData () {
       const paramsData = JSON.parse(JSON.stringify(this.paramsData))
       this.loadData = paramsData.rightList || []
@@ -227,7 +232,7 @@ export default {
         this.isShow = false
       }
     },
-    // 导出
+    // 导出错误项
     handleError () {
       const _this = this
       if (_this.paramsData.errorList.length < 1) {

+ 29 - 21
src/views/expenseManagement/expenseReimbursement/detail.vue

@@ -3,18 +3,19 @@
     <a-spin :spinning="spinning" tip="Loading...">
       <a-page-header :ghost="false" :backIcon="false" class="expenseManagementDetail-cont">
         <template slot="subTitle">
-          <a href="javascript:;" @click="handleBack">
+          <a href="javascript:;" @click="handleBack" id="epenseDetail-back-btn" >
             <a-icon type="left"></a-icon>
             返回列表
           </a>
           <span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ detailData&&detailData.expenseAccountNo || '--' }}</span>
           <span style="margin: 0 10px;color: #666;">申请人:{{ detailData&&detailData.applyPersonName }}</span>
-          <a-button type="link" size="small" class="button-default" @click="showDetail=!showDetail">
+          <a-button id="epenseDetail-showDesc-btn" type="link" size="small" class="button-default" @click="showDetail=!showDetail">
             <a-icon :type="showDetail ? 'eye-invisible' : 'eye'"/> {{ showDetail?'隐藏':'查看' }}信息
           </a-button>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
         <template slot="extra">
+          <a-checkbox v-model="printRemark" v-if="$hasPermissions('B_eRPrint')" id="print-remark">打印备注</a-checkbox>
           <a-button
             :disabled="detailData==null"
             key="1"
@@ -79,6 +80,10 @@
             <div>{{ text }}</div>
             <div v-if="record.accountNameFnumber">({{ record.accountNameFnumber }})</div>
           </template>
+          <!-- 原记账名称 -->
+          <template slot="yjzname" slot-scope="text,record">
+            <div>{{ text == record.accountName || !text ? '--' : text }}</div>
+          </template>
           <!-- 费用承担方 -->
           <template slot="fycdf" slot-scope="text,record">
             <div v-for="(item,index) in record.detailSplitList" :key="item.id+'-'+index">
@@ -133,23 +138,23 @@ export default {
     return {
       spinning: false,
       disabled: false,
-      baseData: null,
-      showTipModal: false,
-      showDetail: false,
-      printType: '',
-      count: 0,
+      showTipModal: false, // 费用报销单打印预览弹框
+      showDetail: false, // 是否显示详细信息
+      printType: '', // 打印类型
+      count: 0, // 费用明细条数
       columns: [
-        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '记账类型', dataIndex: 'accountTypeDictValue', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '记账名称', dataIndex: 'accountName', scopedSlots: { customRender: 'jzname' }, align: 'center', width: '14%' },
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '记账类型', dataIndex: 'accountTypeDictValue', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
+        { title: '记账名称', dataIndex: 'accountName', scopedSlots: { customRender: 'jzname' }, align: 'center', width: '8%' },
+        { title: '原记账名称', dataIndex: 'origAccountName', scopedSlots: { customRender: 'yjzname' }, align: 'center', width: '8%' },
         { title: '所属区域', dataIndex: 'subareaNames', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '所属分区', dataIndex: 'subareaAreaName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '所属省份', dataIndex: 'provinceName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '所属城市', dataIndex: 'cityName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '记账费用', dataIndex: 'expense', align: 'right', width: '8%', customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' } },
-        { title: '费用承担方', scopedSlots: { customRender: 'fycdf' }, align: 'center', width: '14%' },
-        { title: '产品信息', scopedSlots: { customRender: 'cpxx' }, align: 'center', width: '12%' },
-        { title: '销售单号', dataIndex: 'salesBillNo', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '所属省份', dataIndex: 'provinceName', align: 'center', width: '7%', customRender: function (text) { return text || '--' } },
+        { title: '所属城市', dataIndex: 'cityName', align: 'center', width: '7%', customRender: function (text) { return text || '--' } },
+        { title: '记账费用', dataIndex: 'expense', align: 'center', width: '8%', customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' } },
+        { title: '费用承担方', scopedSlots: { customRender: 'fycdf' }, align: 'center', width: '12%' },
+        { title: '产品信息', scopedSlots: { customRender: 'cpxx' }, align: 'center', width: '10%' },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备注', dataIndex: 'remarks', align: 'center', width: '8%', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -170,13 +175,13 @@ export default {
           return data
         })
       },
-      chooseLoadData: [],
-      detailData: null, //  详情数据
-      total: 0
+      detailData: null, // 详情数据
+      total: 0, // 总条数
+      printRemark: false // 是否打印备注
     }
   },
   methods: {
-    //  返回
+    //  返回列表
     handleBack () {
       this.$router.push({ name: 'expenseReimbursementList' })
     },
@@ -192,8 +197,10 @@ export default {
       if (type == 'preview') {
         this.showTipModal = true
       }
+      // 设置打印内容
       this.$nextTick(() => {
         this.$refs.printModal.setData([{
+          printRemark: this.printRemark,
           expenseInfo: this.detailData,
           fyListData,
           spListData: spListData || []
@@ -207,6 +214,7 @@ export default {
         this.spinning = false
       })
     },
+    // 打印成功
     printOk (data) {
       if (data && data.status == 200) {
         expenseAccountUpdateBatch([{
@@ -223,7 +231,7 @@ export default {
         this.spinning = false
       }
     },
-    //  详情
+    //  详情信息
     getDetail () {
       this.spinning = true
       this.detailData = null

+ 27 - 8
src/views/expenseManagement/expenseReimbursement/epenseCdfModal.vue

@@ -20,6 +20,7 @@
             <!-- 费用承担方类型 -->
             <template slot="fycdftype" slot-scope="text,record,index">
               <v-select
+                :id="'cdfTable-splitObjType-'+index"
                 code="EXPENSE_ACCOUNT_DETAIL_SPLIT_OBJ_TYPE"
                 allowClear
                 style="width: 100%;"
@@ -32,7 +33,7 @@
             <!-- 费用承担方 -->
             <template slot="fycdf" slot-scope="text,record,index">
               <!-- 部门 -->
-              <department v-show="record.splitObjType=='DEPARTMENT'" style="width: 100%;" placeholder="请选择承担方" v-model="record.splitObjSn"></department>
+              <department :id="'cdfTable-department-'+index" v-show="record.splitObjType=='DEPARTMENT'" style="width: 100%;" placeholder="请选择承担方" v-model="record.splitObjSn"></department>
               <!-- 经销商 -->
               <custList
                 v-show="record.splitObjType=='CUSTOMER'"
@@ -46,19 +47,22 @@
                 v-show="record.splitObjType=='SUPPLIER'"
                 style="width: 100%;"
                 enableFlag="1"
+                :id="'cdfTable-supplier-'+index"
                 v-model="record.splitObjSn"
                 placeholder="请选择(输入名称搜索)"></supplier>
               <!-- 其它往来 -->
-              <otherTransactions 
-              style="width: 100%;"
-              v-show="record.splitObjType=='OTHER_ORG'" 
-              v-model="record.splitObjSn" 
-              placeholder="请选择(输入名称搜索)"></otherTransactions>
+              <otherTransactions
+                style="width: 100%;"
+                :id="'cdfTable-otherTransactions-'+index"
+                v-show="record.splitObjType=='OTHER_ORG'"
+                v-model="record.splitObjSn"
+                placeholder="请选择(输入名称搜索)"></otherTransactions>
               <span v-if="!record.splitObjType">--</span>
             </template>
             <!-- 费用承担金额 -->
             <template slot="amount" slot-scope="text,record,index">
               <a-input-number
+                :id="'cdfTable-splitAmount-'+index"
                 v-show="record.splitObjType"
                 style="width: 100%;"
                 v-model="record.splitAmount"
@@ -75,10 +79,12 @@
               <div
                 style="display: flex;align-items: center;width: 100%;padding: 5px 0;border-bottom: 1px solid #eee;"
                 v-for="(item,idx) in record.childDetailSplitList"
+                :id="item.id"
                 :key="item.id">
                 <employee style="width: 40%;" placeholder="请选择承担人员" v-model="item.splitObjSn"></employee>
                 -
                 <a-input-number
+                  :id="'cdfTable-childsplitAmount-'+index"
                   style="width: 40%;"
                   v-model="item.splitAmount"
                   :precision="2"
@@ -89,6 +95,7 @@
                 <div style="padding-left: 15px;" v-if="record.childDetailSplitList&&record.childDetailSplitList.length>1">
                   <a-button
                     @click="handleDelCdry(record,idx)"
+                    :id="'cdfTable-childsplitAmoun-del-'+index"
                     title="删除"
                     size="small"
                     type="danger"
@@ -98,6 +105,7 @@
                 <div v-if="record.childDetailSplitList&&idx == record.childDetailSplitList.length - 1">
                   <a-button
                     @click="handleAddCdry(record,idx)"
+                    :id="'cdfTable-childsplitAmoun-add-'+index"
                     title="添加承担人员"
                     size="small"
                     type="primary"
@@ -110,6 +118,7 @@
             </template>
             <template slot="action" slot-scope="text,record,index">
               <a-button
+                :id="'cdfTable-del-'+index"
                 size="small"
                 type="link"
                 class="button-error"
@@ -118,6 +127,7 @@
             </template>
             <template slot="footer" slot-scope="currentPageData">
               <a-button
+                :id="'cdfTable-add-'+index"
                 type="link"
                 class="button-info"
                 block
@@ -148,10 +158,12 @@ export default {
     }
   },
   watch: {
+    // 费用明细列表
     list (newValue, oldValue) {
       this.dataList = JSON.parse(JSON.stringify(newValue))
       this.dataList.map(item => {
         item.no = item.id
+        // 部门
         if (item.splitObjType == 'DEPARTMENT' && (!item.childDetailSplitList || item.childDetailSplitList.length == 0)) {
           this.$set(item, 'childDetailSplitList', [{
             splitObjType: 'EMPLOYEE',
@@ -159,12 +171,14 @@ export default {
             splitAmount: 0
           }])
         }
+        // 客户
         if (item.splitObjType == 'CUSTOMER') {
           this.$nextTick(() => {
             this.$refs['custList-' + item.no].setDufaultVal(item.splitObjName)
           })
         }
       })
+      // 默认添加一条
       if (this.dataList.length == 0) {
         this.handleAddRow()
       }
@@ -198,24 +212,27 @@ export default {
         splitObjSn: undefined,
         splitAmount: Number(row.splitAmount).toFixed(2)
       }] : [])
+      // 客户
       if (row.splitObjType == 'CUSTOMER') {
         this.$set(row, 'splitObjSn', undefined)
         this.$set(row, 'splitObjName', undefined)
         this.$refs['custList-' + row.no].dealerName = []
       }
+      // 供应商
       if (row.splitObjType == 'SUPPLIER') {
         this.$set(row, 'splitObjSn', undefined)
       }
+      // 费用合计
       this.$emit('fyTotal', this.fyTotal())
     },
-    // 经销商
+    // 选择经销商
     custChange (v, obj, id) {
       const row = this.dataList[id.split('-')[1]]
       this.$set(row, 'splitObjSn', v.key)
       this.$set(row, 'splitObjName', obj.dealerName)
       this.$emit('fyTotal', this.fyTotal())
     },
-    // 承担费用
+    // 选择承担费用
     splitAmountChange () {
       this.$emit('fyTotal', this.fyTotal())
     },
@@ -232,6 +249,7 @@ export default {
         hasError = 1
       } else {
         ret.map(item => {
+          // 如果时部门
           if (item.splitObjType == 'DEPARTMENT') {
             const al = item.childDetailSplitList.filter(a => !a.splitObjSn && a.splitAmount > 0)
             if (al.length) {
@@ -317,6 +335,7 @@ export default {
         }
       })
     },
+    // 费用合计计算
     fyTotal: function () {
       let total = 0
       this.dataList.map(item => { total = total + item.splitAmount })

+ 89 - 60
src/views/expenseManagement/expenseReimbursement/epenseDetailModal.vue

@@ -4,7 +4,7 @@
     class="epenseDetailModal-modal"
     :footer="null"
     :maskClosable="false"
-    :title="title+'费用明细'"
+    :title="title"
     v-model="isShow"
     @cancel="isShow=false"
     width="60%">
@@ -33,16 +33,28 @@
               <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
                 <a-form-model-item label="记账名称" prop="accountNameSn">
                   <!-- 部门 -->
-                  <department v-show="form.accountType=='INNER_ACCOUNT'" @change="accountNameSnChange" v-model="form.accountNameSn" placeholder="请选择记账名称(输入名称搜索)"></department>
+                  <department id="epenseDetailModal-accountName" v-show="form.accountType=='INNER_ACCOUNT'" @change="accountNameSnChange" v-model="form.accountNameSn" placeholder="请选择记账名称(输入名称搜索)"></department>
                   <!-- 经销商 -->
-                  <custList v-show="form.accountType=='CUSTOMER'" cooperateFlag="1" ref="custList" @change="accountNameSnChange" placeholder="请选择记账名称(输入名称搜索)"></custList>
+                  <custList
+                    id="epenseDetailModal-accountName1"
+                    v-show="form.accountType=='CUSTOMER'"
+                    cooperateFlag="1"
+                    ref="custList"
+                    @change="accountNameSnChange"
+                    placeholder="请选择记账名称(输入名称搜索)"></custList>
                   <!-- 供应商 -->
-                  <supplier v-show="form.accountType=='OUT_ACCOUNT'" enableFlag="1" @change="accountNameSnChange" v-model="form.accountNameSn" placeholder="请选择记账名称(输入名称搜索)"></supplier>
+                  <supplier
+                    id="epenseDetailModal-accountName2"
+                    v-show="form.accountType=='OUT_ACCOUNT'"
+                    enableFlag="1"
+                    @change="accountNameSnChange"
+                    v-model="form.accountNameSn"
+                    placeholder="请选择记账名称(输入名称搜索)"></supplier>
                   <!-- 其它往来 -->
-                  <otherTransactions v-show="form.accountType=='OTHER_ACCOUNT'" @change="accountNameSnChange" v-model="form.accountNameSn" placeholder="请选择记账名称(输入名称搜索)"></otherTransactions>
+                  <otherTransactions id="epenseDetailModal-accountName3" v-show="form.accountType=='OTHER_ACCOUNT'" @change="accountNameSnChange" v-model="form.accountNameSn" placeholder="请选择记账名称(输入名称搜索)"></otherTransactions>
                   <span v-if="!form.accountType">
-                    <a-select style="width: 100%" placeholder="请选择记账名称">
-                      <a-select-option value="" :disabled="true">
+                    <a-select style="width: 100%" placeholder="请选择记账名称" id="epenseDetailModal-accountName4">
+                      <a-select-option value="" :disabled="true" id="epenseDetailModal-accountName-kong">
                         请先选择记账类型
                       </a-select-option>
                     </a-select>
@@ -65,7 +77,7 @@
               </a-col>
               <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
                 <a-form-model-item label="所属省份" prop="provinceSn">
-                  <Area id="epenseDetailModal-area" @change="provinceChange" placeholder="请选择所属省份" v-model="form.provinceSn"></Area>
+                  <Area id="epenseDetailModal-provinceSn" @change="provinceChange" placeholder="请选择所属省份" v-model="form.provinceSn"></Area>
                 </a-form-model-item>
               </a-col>
             </a-row>
@@ -73,7 +85,7 @@
               <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
                 <a-form-model-item label="所属城市" prop="citySn">
                   <Area
-                    id="epenseDetailModal-area"
+                    id="epenseDetailModal-citySn"
                     ref="city"
                     @change="cityChange"
                     placeholder="请选择所属城市"
@@ -82,7 +94,13 @@
                     v-model="form.citySn"></Area>
                 </a-form-model-item>
               </a-col>
-              <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-col
+                :xs="24"
+                :sm="24"
+                :md="12"
+                :lg="12"
+                :xl="12"
+                v-if="!isBatch">
                 <a-form-model-item label="记账费用">
                   <a-input
                     style="width: 100%;color: red;font-weight: bold;"
@@ -96,13 +114,13 @@
             <a-row>
               <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
                 <a-form-model-item label="备注" prop="remarks" :label-col="{span:2}" :wrapper-col="{span:20}">
-                  <a-textarea placeholder="请输入备注(最多500个字符)" v-model="form.remarks" :rows="4" :maxLength="500"/>
+                  <a-textarea id="epenseDetailModal-remarks" placeholder="请输入备注(最多500个字符)" v-model="form.remarks" :rows="4" :maxLength="500"/>
                 </a-form-model-item>
               </a-col>
             </a-row>
           </a-form-model>
           <!-- 费用承担方 -->
-          <epenseCdfModal ref="epenseCdf" :list="form.detailSplitList" @fyTotal="getFyTotal"></epenseCdfModal>
+          <epenseCdfModal v-if="!isBatch" ref="epenseCdf" :list="form.detailSplitList" @fyTotal="getFyTotal"></epenseCdfModal>
         </div>
         <div class="btn-cont">
           <a-button id="epenseDetailModal-back" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
@@ -139,9 +157,13 @@ export default {
       type: String,
       default: ''
     },
-    expenseAccountDetailSn: {
+    expenseAccountDetailSn: { // 明细sn
       type: String,
       default: ''
+    },
+    isBatch: { // 是否批量修改
+      type: Boolean,
+      default: false
     }
   },
   data () {
@@ -171,7 +193,7 @@ export default {
         expenseAccountSn: '', // 报销单SN
         expenseAccountNo: '', // 报销单号
         expenseAccountDetailSn: '', // 报销明细sn
-        detailSplitList: []
+        detailSplitList: [] // 费用承担方明细
       },
       rules: {
         accountType: [
@@ -198,9 +220,9 @@ export default {
           this.form.citySn = row.citySn
           this.form.provinceName = row.provinceName
           this.form.cityName = row.cityName
-          this.form.subareaArea.subareaName = row.subareaArea.subareaName
-          this.form.subareaArea.subareaAreaName = row.subareaArea.subareaAreaName
-          this.subareaList = [row.subareaArea.subareaName, row.subareaArea.subareaAreaName]
+          this.form.subareaArea.subareaName = row.subareaArea ? row.subareaArea.subareaName : ''
+          this.form.subareaArea.subareaAreaName = row.subareaArea ? row.subareaArea.subareaAreaName : ''
+          this.subareaList = row.subareaArea ? [row.subareaArea.subareaName, row.subareaArea.subareaAreaName] : []
         } else {
           this.form.accountNameSn = ''
           this.form.provinceSn = ''
@@ -224,7 +246,6 @@ export default {
     },
     // 省
     provinceChange (v, row) {
-      console.log(v, row)
       this.form.provinceName = row ? row.name : ''
       this.form.provinceSn = v || ''
       this.form.citySn = undefined
@@ -264,58 +285,65 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const form = JSON.parse(JSON.stringify(_this.form))
-          const cdfList = this.$refs.epenseCdf.getList()
-          if (cdfList[0] == 1) {
-            this.$warning({
-              title: '是否存在以下情况,请按照要求填写',
-              content: <div><p>1、费用承担方至少有一个</p><p>2、带星号的列为必填项,不能为空</p></div>,
-              centered: true
-            })
-            return
-          }
-          if (cdfList[0] == 3) {
-            this.$warning({
-              title: '提示',
-              content: '请检查每行承担人员是否已经选择',
-              centered: true
-            })
-            return
-          }
-          if (cdfList[0] == 2) {
-            this.$warning({
-              title: '提示',
-              content: '请检查每行人员平摊费用合计是否等于承担金额',
-              centered: true
-            })
-            return
-          }
-          // 获取承担人列表数据
-          form.detailSplitList = cdfList[1]
           form.provinceName = form.provinceName ? form.provinceName : ''
           form.provinceSn = form.provinceSn ? form.provinceSn : ''
           form.citySn = form.citySn ? form.citySn : ''
           form.cityName = form.cityName ? form.cityName : ''
-          form.expense = Math.abs(form.expense)
 
-          console.log(form)
+          // 如果是批量修改记账名称
+          if (this.isBatch) {
+            _this.spinning = true
+            _this.$emit('ok', form)
+          } else {
+            // 校验明细承担人列表
+            const cdfList = this.$refs.epenseCdf.getList()
+            if (cdfList[0] == 1) {
+              this.$warning({
+                title: '是否存在以下情况,请按照要求填写',
+                content: <div><p>1、费用承担方至少有一个</p><p>2、带星号的列为必填项,不能为空</p></div>,
+                centered: true
+              })
+              return
+            }
+            if (cdfList[0] == 3) {
+              this.$warning({
+                title: '提示',
+                content: '请检查每行承担人员是否已经选择',
+                centered: true
+              })
+              return
+            }
+            if (cdfList[0] == 2) {
+              this.$warning({
+                title: '提示',
+                content: '请检查每行人员平摊费用合计是否等于承担金额',
+                centered: true
+              })
+              return
+            }
+            // 获取承担人列表数据
+            form.detailSplitList = cdfList[1]
+            form.expense = Math.abs(form.expense) // 费用合计
 
-          _this.spinning = true
-          expenseAcctDetailSave(form).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              setTimeout(() => {
-                _this.$emit('ok')
+            _this.spinning = true
+            expenseAcctDetailSave(form).then(res => {
+              if (res.status == 200) {
+                _this.$message.success(res.message)
+                setTimeout(() => {
+                  _this.$emit('ok')
+                  _this.spinning = false
+                }, 200)
+              } else {
                 _this.spinning = false
-              }, 200)
-            } else {
-              _this.spinning = false
-            }
-          })
+              }
+            })
+          }
         } else {
           return false
         }
       })
     },
+    // 重置表单
     resetForm () {
       this.$nextTick(() => {
         this.$refs.ruleForm.resetFields()
@@ -367,13 +395,14 @@ export default {
       } else {
         this.form.expenseAccountSn = this.expenseAccountSn
         this.form.expenseAccountNo = this.expenseAccountNo
+        // 编辑
         if (this.expenseAccountDetailSn) {
-          this.title = '编辑'
+          this.title = '编辑费用明细'
           this.form.expenseAccountDetailSn = this.expenseAccountDetailSn || ''
           this.getExpenseAccountDetail()
         } else {
           this.resetForm()
-          this.title = '新增'
+          this.title = this.isBatch ? '批量变更记账名称' : '新增费用明细'
         }
       }
     }

+ 4 - 6
src/views/expenseManagement/expenseReimbursement/importGuideModal.vue

@@ -17,9 +17,9 @@
           <ul>
             <li>1) 导入的Excel文件中必须包含名为“记账类型”、“记账名称”、“费用承担方类型”、“费用承担方”、“费用承担金额”的列,且名称必须相同</li>
             <li>2) 其他列可根据实际情况填写,如果符合规则,系统会一起导入</li>
-            <li><a :href="filePath" style="margin: 5px 0 0 15px;display: block;">
-            <a-icon type="download" style="padding-right: 5px;" />下载导入模板
-          </a></li>
+            <li><a :href="filePath" id="importGuide-link" style="margin: 5px 0 0 15px;display: block;">
+              <a-icon type="download" style="padding-right: 5px;" />下载导入模板
+            </a></li>
           </ul>
         </div>
         <div class="explain-item">
@@ -90,7 +90,7 @@ export default {
         savePathType: 'local'
       },
       exportLoading: false,
-      filePath: location.protocol + '//' +location.host + '/templ/费用明细模板.xlsx' + '?a=' + new Date().getTime()
+      filePath: location.protocol + '//' + location.host + '/templ/费用明细模板.xlsx' + '?a=' + new Date().getTime() // 模板地址
     }
   },
   methods: {
@@ -109,13 +109,11 @@ export default {
     },
     // 上传文件  change
     changeImport (file) {
-      console.log(file, JSON.parse(file))
       if (file && JSON.parse(file).length > 0) {
         this.paramsData = Object.assign({}, JSON.parse(file)[0] || null, this.params)
       } else {
         this.paramsData = null
       }
-      console.log(this.paramsData)
     },
     // 导入
     hanldeOk (obj) {

+ 78 - 58
src/views/expenseManagement/expenseReimbursement/list.vue

@@ -78,9 +78,9 @@
             </template>
             <a-col :md="6" :sm="24">
               <span class="table-page-search-submitButtons">
-                <a-button type="primary" :disabled="disabled" @click="searchForm">查询</a-button>
-                <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
-                <a @click="advanced=!advanced" style="margin-left: 8px">
+                <a-button type="primary" :disabled="disabled" @click="searchForm" id="salesManagementList-search">查询</a-button>
+                <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()" id="salesManagementList-reset">重置</a-button>
+                <a @click="advanced=!advanced" style="margin-left: 8px" id="salesManagementList-advanced">
                   {{ advanced ? '收起' : '展开' }}
                   <a-icon :type="advanced ? 'up' : 'down'"/>
                 </a>
@@ -94,9 +94,16 @@
       <a-spin :spinning="spinning" tip="Loading...">
         <!-- 操作按钮 -->
         <div class="table-operator">
-          <a-button type="primary" v-if="$hasPermissions('B_eRNew')" @click="handleEdit()">新增</a-button>
-          <a-button type="primary" :loading="spinning" @click="handlePlPrint()" ghost>批量打印</a-button>
-          <span style="margin-left: 8px">
+          <a-button id="salesManagementList-add" type="primary" v-if="$hasPermissions('B_eRNew')" @click="handleEdit()">新增</a-button>
+          <a-button
+            id="salesManagementList-batchPrint"
+            type="primary"
+            v-if="$hasPermissions('B_eRPrint')"
+            :loading="spinning"
+            @click="handlePlPrint()"
+            ghost>批量打印</a-button>
+          <a-checkbox id="salesManagementList-print-remarks" v-model="printRemark" v-if="$hasPermissions('B_eRPrint')">打印备注</a-checkbox>
+          <span style="margin-left: 8px" v-if="$hasPermissions('B_eRPrint')">
             <template v-if="rowSelectionInfo && rowSelectionInfo.selectedRowKeys.length>0">{{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }}</template>
           </span>
         </div>
@@ -117,7 +124,7 @@
           bordered>
           <!-- 单号 -->
           <template slot="expenseAccountNo" slot-scope="text, record">
-            <span v-if="$hasPermissions('B_eRdetail')" class="link-bule" @click="handleDetail(record)">{{ record.expenseAccountNo }}</span>
+            <span :id="'salesManagementList-detail-'+record.id" v-if="$hasPermissions('B_eRdetail')" class="link-bule" @click="handleDetail(record)">{{ record.expenseAccountNo }}</span>
             <div v-else>{{ record.expenseAccountNo||'--' }}</div>
           </template>
           <!-- 总数量 -->
@@ -130,43 +137,48 @@
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
-            <a-button
-              v-if="record.state=='WAIT_SUBMIT'&&$hasPermissions('B_ERtEdit')"
-              size="small"
-              type="link"
-              class="button-info"
-              @click="handleEdit(record)"
-            >
-              编辑
-            </a-button>
-            <a-button
-              v-if="record.state=='WAIT_SUBMIT'&&$hasPermissions('B_ERDel')"
-              size="small"
-              type="link"
-              class="button-error"
-              @click="handleDel(record)"
-            >
-              删除
-            </a-button>
-            <a-button
-              v-if="record.state!='WAIT_SUBMIT'&&$hasPermissions('B_ERAudit')"
-              size="small"
-              type="link"
-              class="button-info"
-              @click="handleSH(record)"
-            >
-              审核进度
-            </a-button>
-            <a-button
-              v-if="record.state=='AUDIT_REJECT'"
-              size="small"
-              type="link"
-              class="button-info"
-              @click="againEdit(record)"
-            >
-              再次编辑
-            </a-button>
-          <!-- <span v-if="record.state=='AUDIT_REJECT' || record.state=='AUDIT_PASS'">--</span> -->
+            <div>
+              <a-button
+                :id="'salesManagementList-edit-'+record.id"
+                v-if="record.state=='WAIT_SUBMIT'&&$hasPermissions('B_ERtEdit')"
+                size="small"
+                type="link"
+                class="button-info"
+                @click="handleEdit(record)"
+              >
+                编辑
+              </a-button>
+              <a-button
+                :id="'salesManagementList-del-'+record.id"
+                v-if="record.state=='WAIT_SUBMIT'&&$hasPermissions('B_ERDel')"
+                size="small"
+                type="link"
+                class="button-error"
+                @click="handleDel(record)"
+              >
+                删除
+              </a-button>
+              <a-button
+                :id="'salesManagementList-audit-'+record.id"
+                v-if="record.state!='WAIT_SUBMIT'&&$hasPermissions('B_ERAudit')"
+                size="small"
+                type="link"
+                class="button-info"
+                @click="handleSH(record)"
+              >
+                审核进度
+              </a-button>
+              <a-button
+                :id="'salesManagementList-editAge-'+record.id"
+                v-if="record.state=='AUDIT_REJECT'"
+                size="small"
+                type="link"
+                class="button-info"
+                @click="againEdit(record)"
+              >
+                再次编辑
+              </a-button>
+            </div>
           </template>
         </s-table>
       </a-spin>
@@ -216,10 +228,10 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 审核进度弹框是否显示
       openBaseModal: false, // 基础信息新建
-      showTipModal: false,
+      showTipModal: false, // 打印预览组件
       itemSn: '', // 费用单sn
-      tableHeight: 0,
-      expenseTypes: [],
+      tableHeight: 0, // 表格高度
+      expenseTypes: [], // 费用类型
       // 查询参数
       queryParam: {
         expenseDate: moment().format('YYYY-MM'), // 月份
@@ -231,7 +243,7 @@ export default {
         printStatus: undefined, // 打印状态
         state: undefined, // 状态
         salesBillNo: '', // 销售单号
-        bizUserSn: undefined
+        bizUserSn: undefined // 客服
       },
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -273,7 +285,8 @@ export default {
           return data
         })
       },
-      rowSelectionInfo: null // 批量选择的数据
+      rowSelectionInfo: null, // 批量选择的数据
+      printRemark: false // 是否打印备注
     }
   },
   methods: {
@@ -281,6 +294,7 @@ export default {
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
     },
+    // 打印结束,记录打印状态
     printOk (data) {
       if (data && data.status == 200) {
         const rows = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
@@ -312,10 +326,11 @@ export default {
         _this.$message.warning('请在列表勾选后再进行批量操作!')
         return false
       }
+      // 开始打印
       this.spinning = true
       const pageData = []
       const businessSnList = []
-
+      // 循环获取
       for (let i = 0; i < rows.length; i++) {
         // 费用明细
         const fyListData = await expenseAcctDetailFindList({ expenseAccountSn: rows[i].expenseAccountSn }).then(res => res.data)
@@ -323,7 +338,9 @@ export default {
         if (rows[i].state != 'WAIT_SUBMIT') {
           businessSnList.push(rows[i].expenseAccountSn)
         }
+        // 组装数据
         pageData.push({
+          printRemark: this.printRemark,
           expenseInfo: rows[i],
           fyListData: fyListData,
           spListData: []
@@ -337,7 +354,6 @@ export default {
           item.spListData = sp ? sp.taskVOList : []
         }
       })
-      console.log(pageData)
       // 打开预览弹框
       this.showTipModal = true
       this.$nextTick(() => {
@@ -345,25 +361,28 @@ export default {
         this.spinning = false
       })
     },
+    // 费用发生月份
     onChange (date, dateString) {
       this.queryParam.expenseDate = dateString
     },
+    // 费用发生月份禁用范围
     disabledDate (current) {
       return current && current > moment().endOf('day')
     },
+    // 费用类型选择
     expenseChange (val, opts) {
-      console.log(val, opts)
       this.expenseTypes = val || []
       this.queryParam.expenseType = val && val[0] ? val[0] : ''
       this.queryParam.expenseType2 = val && val[1] ? val[1] : ''
       this.queryParam.expenseType3 = val && val[2] ? val[2] : ''
     },
-    // 详情
+    // 详情页面
     handleDetail (row) {
       this.$router.push({ name: 'expenseReimbursementListDetail', params: { sn: row.expenseAccountSn } })
     },
     // 新增、编辑
     handleEdit (row) {
+      // 编辑
       if (row && row.expenseAccountSn) {
         this.$router.push({ name: 'expenseReimbursementEdit', params: { sn: row.expenseAccountSn } })
       } else {
@@ -384,15 +403,13 @@ export default {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
-              _this.spinning = false
-            } else {
-              _this.spinning = false
             }
+            _this.spinning = false
           })
         }
       })
     },
-    // 审核进度
+    // 审核进度弹框
     handleSH (row) {
       this.openModal = true
       this.itemSn = row.expenseAccountSn
@@ -417,11 +434,12 @@ export default {
         }
       })
     },
+    // 查询列表
     searchForm () {
       this.$refs.table.refresh(true)
       this.$refs.table.clearSelected()
     },
-    // 重置
+    // 重置列表
     resetSearchForm () {
       this.queryParam = {
         expenseDate: '', // 月份
@@ -439,12 +457,14 @@ export default {
       this.expenseTypes = []
       this.searchForm()
     },
+    // 页面初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 240

+ 116 - 113
src/views/expenseManagement/expenseReimbursement/previewModal.vue

@@ -1,126 +1,129 @@
 <template>
-  <div class="container-print-view" 
-  style="width:100%;font-size: 12pt;height: 600px;overflow: auto;" 
+  <div
+    class="container-print-view"
+    style="width:100%;font-size: 12pt;height: 600px;overflow: auto;"
   >
-  <div class="expense-detail-print" style="width:564pt;margin:0 auto;" v-for="item in list" :key="item.expenseInfo.expenseAccountSn">
-    <div class="container-title" style="text-align: center;font-size: 24px;font-weight: 600;margin: 20px 0;">箭冠汽配企业费用报销单</div>
-    <div class="container-info" style="width:564pt;border: 1px solid #000000;">
-      <div class="container-info-basics" v-if="item.expenseInfo">
-        <div class="basics-item" style="width: 100%;border-bottom: 1px solid #000000;padding:0;margin:0;">
-          <span style="display: inline-block;width: 50%;padding: 10px;border-right: 1px solid #000000;">申请人:{{ item.expenseInfo.applyPersonName?item.expenseInfo.applyPersonName:'' }}</span>
-          <span style="display: inline-block;border-right: none;padding: 10px;">申请部门:{{ item.expenseInfo.applyDepartmentName?item.expenseInfo.applyDepartmentName:'' }}</span>
-        </div>
-        <div class="basics-item" style="width: 100%;border-bottom: 1px solid #000000;padding:0;margin:0;">
-          <span style="display: inline-block;width: 50%;padding: 10px;border-right: 1px solid #000000;">费用类型:{{ item.expenseInfo.expenseTypeName?item.expenseInfo.expenseTypeName:'' }}</span>
-          <span style="display: inline-block;border-right: none;padding: 10px;">费用发生月份:{{ item.expenseInfo.expenseDate?item.expenseInfo.expenseDate.substring(0, 7):'' }}</span>
-        </div>
-        <div class="basics-item" style="width: 100%;border-bottom: 1px solid #000000;padding:0;margin:0;">
-          <span style="display: inline-block;width: 50%;padding: 10px;border-right: 1px solid #000000;">费用单号:{{ item.expenseInfo.expenseAccountNo?item.expenseInfo.expenseAccountNo:'' }}{{ item.expenseInfo.stateDictValue?'('+item.expenseInfo.stateDictValue+')':'' }}</span>
-          <span style="display: inline-block;border-right: none;padding: 10px;">合计金额:{{ (item.expenseInfo.applyExpenseTotal ||item.expenseInfo.applyExpenseTotal==0)?item.expenseInfo.applyExpenseTotal+'元':'' }}</span>
-        </div>
-        <div class="basics-item" style="width: 100%;border-bottom: 1px solid #000000;overflow: hidden;">
-          <div style="border-right: none;float: left;padding: 10px 0 10px 10px;">主题:</div>
-          <div style="padding: 10px 10px 10px 50px;text-align: center;font-weight: bold;">
-            {{ item.expenseInfo.title?item.expenseInfo.title:'' }}
+    <div class="expense-detail-print" style="width:564pt;margin:0 auto;" v-for="item in list" :key="item.expenseInfo.expenseAccountSn">
+      <div class="container-title" style="text-align: center;font-size: 24px;font-weight: 600;margin: 20px 0;">箭冠汽配企业费用报销单</div>
+      <div class="container-info" style="width:564pt;border: 1px solid #000000;">
+        <div class="container-info-basics" v-if="item.expenseInfo">
+          <div class="basics-item" style="width: 100%;border-bottom: 1px solid #000000;padding:0;margin:0;">
+            <span style="display: inline-block;width: 50%;padding: 10px;border-right: 1px solid #000000;">申请人:{{ item.expenseInfo.applyPersonName?item.expenseInfo.applyPersonName:'' }}</span>
+            <span style="display: inline-block;border-right: none;padding: 10px;">申请部门:{{ item.expenseInfo.applyDepartmentName?item.expenseInfo.applyDepartmentName:'' }}</span>
           </div>
-        </div>
-        <div class="basics-item" style="width: 100%;border-bottom: 1px solid #000000;padding:0;margin:0;">
-          <span style="display: inline-block;width: 100%;padding: 10px 10px 5px;border-right: 1px solid #000000;border-right: none;">详细说明:</span>
-          <div style="padding:0 20px 10px 40px;">
-            <div v-for="(ditem,index) in item.expenseInfo.content" :key="index+'-content'">
-              {{ ditem || '--' }}
+          <div class="basics-item" style="width: 100%;border-bottom: 1px solid #000000;padding:0;margin:0;">
+            <span style="display: inline-block;width: 50%;padding: 10px;border-right: 1px solid #000000;">费用类型:{{ item.expenseInfo.expenseTypeName?item.expenseInfo.expenseTypeName:'' }}</span>
+            <span style="display: inline-block;border-right: none;padding: 10px;">费用发生月份:{{ item.expenseInfo.expenseDate?item.expenseInfo.expenseDate.substring(0, 7):'' }}</span>
+          </div>
+          <div class="basics-item" style="width: 100%;border-bottom: 1px solid #000000;padding:0;margin:0;">
+            <span style="display: inline-block;width: 50%;padding: 10px;border-right: 1px solid #000000;">费用单号:{{ item.expenseInfo.expenseAccountNo?item.expenseInfo.expenseAccountNo:'' }}{{ item.expenseInfo.stateDictValue?'('+item.expenseInfo.stateDictValue+')':'' }}</span>
+            <span style="display: inline-block;border-right: none;padding: 10px;">合计金额:{{ (item.expenseInfo.applyExpenseTotal ||item.expenseInfo.applyExpenseTotal==0)?item.expenseInfo.applyExpenseTotal+'元':'' }}</span>
+          </div>
+          <div class="basics-item" style="width: 100%;border-bottom: 1px solid #000000;overflow: hidden;">
+            <div style="border-right: none;float: left;padding: 10px 0 10px 10px;">主题:</div>
+            <div style="padding: 10px 10px 10px 50px;text-align: center;font-weight: bold;">
+              {{ item.expenseInfo.title?item.expenseInfo.title:'' }}
+            </div>
+          </div>
+          <div class="basics-item" style="width: 100%;border-bottom: 1px solid #000000;padding:0;margin:0;">
+            <span style="display: inline-block;width: 100%;padding: 10px 10px 5px;border-right: 1px solid #000000;border-right: none;">详细说明:</span>
+            <div style="padding:0 20px 10px 40px;">
+              <div v-for="(ditem,index) in item.expenseInfo.content" :key="index+'-content'">
+                {{ ditem || '--' }}
+              </div>
             </div>
           </div>
         </div>
-      </div>
-      <div class="container-fytable" style="padding:0 10px;" v-if="item.fyListData">
-        <div class="table-title" style="padding: 10px 0;">费用明细:</div>
-        <table
-          border="1"
-          cellspacing="0"
-          cellpadding="0"
-          style="width: 100%;border-collapse: collapse;font-size:10pt;text-align: center;"
-          align="center">
-          <thead>
-            <tr>
-              <th style="padding:5px 0;width:6%;">序号</th>
-              <th style="padding:5px 0;width:22%;">记账方</th>
-              <!-- <th style="padding:5px 0;width:15%;">区域/省/市</th> -->
-              <th style="padding:5px 0;width:10%;">记账费用</th>
-              <th style="padding:5px 0;width:30%;">费用承担方</th>
-              <th style="padding:5px 0;width:22%;">产品信息</th>
-            </tr>
-          </thead>
-          <tbody>
-            <tr v-for="(fyItem,index) in item.fyListData" :key="index">
-              <td style="text-align: center;width:6%;">{{ index+1 }}</td>
-              <td style="text-align: left;width:22%;padding:0 5px;">
-                <div>{{ fyItem.accountTypeDictValue }}</div>
-                <div>{{ fyItem.accountName||'' }}</div>
-                <div v-if="fyItem.accountNameFnumber">({{ fyItem.accountNameFnumber }})</div>
-              </td>
-              <!-- <td style="text-align: left;width:15%;padding:5px 5px;">
+        <div class="container-fytable" style="padding:0 10px;" v-if="item.fyListData">
+          <div class="table-title" style="padding: 10px 0;">费用明细:</div>
+          <table
+            border="1"
+            cellspacing="0"
+            cellpadding="0"
+            style="width: 100%;border-collapse: collapse;font-size:10pt;text-align: center;"
+            align="center">
+            <thead>
+              <tr>
+                <th style="padding:5px 0;width:6%;">序号</th>
+                <th style="padding:5px 0;width:22%;">记账方</th>
+                <!-- <th style="padding:5px 0;width:15%;">区域/省/市</th> -->
+                <th style="padding:5px 0;width:10%;">记账费用</th>
+                <th style="padding:5px 0;width:30%;">费用承担方</th>
+                <th style="padding:5px 0;width:22%;">产品信息</th>
+                <th v-if="item.printRemark">备注</th>
+              </tr>
+            </thead>
+            <tbody>
+              <tr v-for="(fyItem,index) in item.fyListData" :key="index">
+                <td style="text-align: center;width:6%;">{{ index+1 }}</td>
+                <td style="text-align: left;width:22%;padding:0 5px;">
+                  <div>{{ fyItem.accountTypeDictValue }}</div>
+                  <div>{{ fyItem.accountName||'' }}</div>
+                  <div v-if="fyItem.accountNameFnumber">({{ fyItem.accountNameFnumber }})</div>
+                </td>
+                <!-- <td style="text-align: left;width:15%;padding:5px 5px;">
                 <div>{{ fyItem.subareaNames }}</div>
                 <div>{{ fyItem.provinceName }}</div>
                 <div>{{ fyItem.cityName }}</div>
               </td> -->
-              <td style="text-align: right;width:10%;padding:0 5px;">{{ fyItem.expense||fyItem.expense==0?toThousands(fyItem.expense):'' }}</td>
-              <td style="text-align: left;width:30%;padding:0 5px;vertical-align: top;">
-                <div v-for="(ditem,index) in fyItem.detailSplitList" :key="ditem.id+'-'+index" style="padding: 3px 0;" >
-                  {{ ditem.splitObjName }}
-                  <span v-if="ditem.splitObjFnumber">({{ ditem.splitObjFnumber }})</span>
-                  <span v-if="ditem.childDetailSplit&&ditem.childDetailSplit.splitObjName">/</span>
-                  {{ ditem.childDetailSplit?ditem.childDetailSplit.splitObjName:'' }}: {{ ditem.childDetailSplit?toThousands(ditem.childDetailSplit.splitAmount):toThousands(ditem.splitAmount) }}
-                </div>
-              </td>
-              <td style="text-align: left;width:22%;padding:0 5px;vertical-align: top;">
-                <div v-for="ditem in fyItem.detailProductsList" :key="ditem.id" style="padding: 3px 0;">
-                  <div v-if="ditem.productCode">{{ ditem.productCode }}: {{ toThousands(ditem.expense) }}</div>
-                  <div v-else-if="ditem.productBrandName">{{ ditem.productBrandName }}<span v-if="ditem.productTypeShowName">/</span>{{ ditem.productTypeShowName }}: {{ toThousands(ditem.expense) }}</div>
-                  <div v-else>{{ ditem.productTypeShowName }}: {{ toThousands(ditem.expense) }}</div>
-                </div>
-              </td>
-            </tr>
-          </tbody>
-        </table>
-      </div>
-      <div class="container-fytable" style="padding:0 10px 5px;" v-if="item.spListData&&item.spListData.length">
-        <p class="table-title">审批信息:</p>
-        <table
-          border="1"
-          cellspacing="0"
-          cellpadding="0"
-          style="width: 100%;border-collapse: collapse;border: 1px solid black;font-size:10pt;text-align: center;"
-          align="center">
-          <thead>
-            <tr style="height: 30px;padding: 5px;">
-              <th style="padding:5px 0;width:8%;">序号</th>
-              <th style="padding:5px 0;width:15%;">人员姓名</th>
-              <th style="padding:5px 0;width:15%;">人员类型</th>
-              <th style="padding:5px 0;width:10%;">状态</th>
-              <th style="padding:5px 0;width:17%;">审批意见</th>
-              <th style="padding:5px 0;width:15%;">附件</th>
-              <th style="padding:5px 0;width:20%;">时间</th>
-            </tr>
-          </thead>
-          <tbody>
-            <tr style="height: 30px;padding: 5px;" v-for="(spitem,index) in item.spListData" :key="index">
-              <td style="padding:5px 0;">{{ index+1||'' }}</td>
-              <td style="padding:5px 0;">{{ spitem.userName||'' }}</td>
-              <td style="padding:5px 0;">{{ spitem.userType||'' }}</td>
-              <td style="padding:5px 0;">{{ spitem.state||'' }}</td>
-              <td style="padding:5px 0;">{{ spitem.remark||'' }}</td>
-              <td style="padding:5px 0;">{{ spitem.hasAttachments!= '0' ? '请在钉钉中查看附件内容' : '--' }}</td>
-              <td style="padding:5px 0;">{{ spitem.date||'' }}</td>
-            </tr></tbody>
-        </table>
-      </div>
-      <div class="container-fytable" style="padding:0 10px;" v-else>
-        <p class="table-title">审批信息:暂无</p>
+                <td style="text-align: right;width:10%;padding:0 5px;">{{ fyItem.expense||fyItem.expense==0?toThousands(fyItem.expense):'' }}</td>
+                <td style="text-align: left;width:30%;padding:0 5px;vertical-align: top;">
+                  <div v-for="(ditem,index) in fyItem.detailSplitList" :key="ditem.id+'-'+index" style="padding: 3px 0;" >
+                    {{ ditem.splitObjName }}
+                    <span v-if="ditem.splitObjFnumber">({{ ditem.splitObjFnumber }})</span>
+                    <span v-if="ditem.childDetailSplit&&ditem.childDetailSplit.splitObjName">/</span>
+                    {{ ditem.childDetailSplit?ditem.childDetailSplit.splitObjName:'' }}: {{ ditem.childDetailSplit?toThousands(ditem.childDetailSplit.splitAmount):toThousands(ditem.splitAmount) }}
+                  </div>
+                </td>
+                <td style="text-align: left;width:22%;padding:0 5px;vertical-align: top;">
+                  <div v-for="ditem in fyItem.detailProductsList" :key="ditem.id" style="padding: 3px 0;">
+                    <div v-if="ditem.productCode">{{ ditem.productCode }}: {{ toThousands(ditem.expense) }}</div>
+                    <div v-else-if="ditem.productBrandName">{{ ditem.productBrandName }}<span v-if="ditem.productTypeShowName">/</span>{{ ditem.productTypeShowName }}: {{ toThousands(ditem.expense) }}</div>
+                    <div v-else>{{ ditem.productTypeShowName }}: {{ toThousands(ditem.expense) }}</div>
+                  </div>
+                </td>
+                <td v-if="item.printRemark">{{ fyItem.remarks }}</td>
+              </tr>
+            </tbody>
+          </table>
+        </div>
+        <div class="container-fytable" style="padding:0 10px 5px;" v-if="item.spListData&&item.spListData.length">
+          <p class="table-title">审批信息:</p>
+          <table
+            border="1"
+            cellspacing="0"
+            cellpadding="0"
+            style="width: 100%;border-collapse: collapse;border: 1px solid black;font-size:10pt;text-align: center;"
+            align="center">
+            <thead>
+              <tr style="height: 30px;padding: 5px;">
+                <th style="padding:5px 0;width:8%;">序号</th>
+                <th style="padding:5px 0;width:15%;">人员姓名</th>
+                <th style="padding:5px 0;width:15%;">人员类型</th>
+                <th style="padding:5px 0;width:10%;">状态</th>
+                <th style="padding:5px 0;width:17%;">审批意见</th>
+                <th style="padding:5px 0;width:15%;">附件</th>
+                <th style="padding:5px 0;width:20%;">时间</th>
+              </tr>
+            </thead>
+            <tbody>
+              <tr style="height: 30px;padding: 5px;" v-for="(spitem,index) in item.spListData" :key="index">
+                <td style="padding:5px 0;">{{ index+1||'' }}</td>
+                <td style="padding:5px 0;">{{ spitem.userName||'' }}</td>
+                <td style="padding:5px 0;">{{ spitem.userType||'' }}</td>
+                <td style="padding:5px 0;">{{ spitem.state||'' }}</td>
+                <td style="padding:5px 0;">{{ spitem.remark||'' }}</td>
+                <td style="padding:5px 0;">{{ spitem.hasAttachments!= '0' ? '请在钉钉中查看附件内容' : '--' }}</td>
+                <td style="padding:5px 0;">{{ spitem.date||'' }}</td>
+              </tr></tbody>
+          </table>
+        </div>
+        <div class="container-fytable" style="padding:0 10px;" v-else>
+          <p class="table-title">审批信息:暂无</p>
+        </div>
       </div>
     </div>
   </div>
-  </div>
 </template>
 
 <script>
@@ -140,17 +143,17 @@ export default {
       this.list = list
     },
     // 打印
-    prints(){
+    prints () {
       const _this = this
       const html = document.getElementsByClassName('expense-detail-print')
       // 自动排版
-      const result = groupLessThan(html,true)
+      const result = groupLessThan(html, true)
       this.$store.state.app.curActionPermission = 'B_eRPrint'
       // html, type, callback, printLogParams
       jGPlPrint(result, 'print', function (res) {
         _this.$store.state.app.curActionPermission = ''
         _this.$emit('printOk', res)
-      },null,'费用报销单')
+      }, null, '费用报销单')
     }
   }
 }

+ 7 - 14
src/views/expenseManagement/expenseReimbursement/productInfoModal.vue

@@ -36,6 +36,7 @@
             <div slot="customTitle"><span style="color: red;">*</span>费用金额</div>
             <template slot="action" slot-scope="text,record,index">
               <a-button
+                :id="'productInfoModal-del-'+record.id"
                 size="small"
                 type="link"
                 class="button-error"
@@ -52,17 +53,18 @@
                 style="width: 100%;"
                 :disabled="!!record.productCode"
                 :ref="'productType-'+record.no"
-                :id="'productType-'+index"
+                :id="'productInfoModal-productType-'+record.id"
                 v-model="record.productType"
                 @change="changeProductType"></ProductTypeAll>
             </template>
             <!-- 产品编码 -->
             <template slot="productCode" slot-scope="text,record,index">
-              <productCodeList :ref="'productCode-'+record.no" :key="'productCode-'+index" :id="'productCode-'+index" @change="e => productCodeChange(e, record)" />
+              <productCodeList :ref="'productCode-'+record.no" :key="'productCode-'+index" :id="'productCode-'+record.id" @change="e => productCodeChange(e, record)" />
             </template>
             <!-- 费用金额 -->
             <template slot="expense" slot-scope="text,record">
               <a-input-number
+                :id="'productInfoModal-expense-'+record.id"
                 style="width: 100%;"
                 v-model="record.expense"
                 :precision="2"
@@ -73,6 +75,7 @@
             </template>
             <template slot="footer" slot-scope="currentPageData">
               <a-button
+                :id="'productInfoModal-add-'+record.id"
                 type="link"
                 class="button-info"
                 v-if="dataList.length==0"
@@ -113,7 +116,7 @@ export default {
       type: String,
       default: ''
     },
-    expenseAccountDetailSn: {
+    expenseAccountDetailSn: { // 费用单sn
       type: String,
       default: ''
     }
@@ -123,7 +126,7 @@ export default {
       spinning: false,
       isShow: this.openModal, //  是否打开弹框
       dataList: [],
-      baseData: null,
+      baseData: null, // 详细信息
       columns: [
         { title: '产品品牌', scopedSlots: { customRender: 'productBrand' }, align: 'center', width: '20%' },
         { title: '产品分类', scopedSlots: { customRender: 'productType' }, align: 'center', width: '30%' },
@@ -136,7 +139,6 @@ export default {
   methods: {
     // 产品编码
     productCodeChange (val, row) {
-      console.log(val, row)
       row.productSn = val.key || undefined
       row.productCode = val.row && val.row.code ? val.row.code : undefined
       row.productName = val.row && val.row.name ? val.row.name : undefined
@@ -163,7 +165,6 @@ export default {
     },
     //  产品分类  change
     changeProductType (val, id, options) {
-      console.log(val, id, options)
       const index = id.split('-')[1]
       const row = this.dataList[index]
       if (val.length > 1) {
@@ -223,10 +224,6 @@ export default {
       // 校验数据
       const retList = JSON.parse(JSON.stringify(this.dataList))
       console.log(retList)
-      // if (retList.length == 0) {
-      //   this.$message.info('请添加产品信息')
-      //   return
-      // }
       let hasError = 0
       retList.map(item => {
         if (!item.expense) {
@@ -238,10 +235,6 @@ export default {
         delete item.productType
         delete item.no
       })
-      // if (hasError == 1) {
-      //   this.$message.info('请输入费用金额')
-      //   return
-      // }
       if (hasError == 2) {
         this.$message.info('产品品牌、产品分类、产品编码,三个至少填一个')
         return

+ 1 - 1
src/views/expenseManagement/expenseReimbursement/verifyModal.vue

@@ -36,7 +36,7 @@ export default {
       type: Boolean,
       default: false
     },
-    itemSn: {
+    itemSn: { // 费用单sn
       type: [Number, String],
       default: ''
     }

+ 37 - 27
src/views/expenseManagement/expenseReimbursementDetail/list.vue

@@ -7,7 +7,7 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="审核时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate id="expenseReimbursementDetailList-rangeDate" ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -40,6 +40,7 @@
               <a-col :md="6" :sm="24">
                 <a-form-item label="费用发生月份">
                   <a-month-picker
+                    id="expenseReimbursementDetailList-month"
                     placeholder="请选择月份"
                     v-model="queryParam.expenseDate"
                     @change="onChange"
@@ -61,14 +62,14 @@
               <a-col :md="6" :sm="24">
                 <a-form-item label="记账名称">
                   <!-- 部门 -->
-                  <department v-show="queryParam.accountType=='INNER_ACCOUNT'" @change="accountNameSnChange" v-model="queryParam.accountNameSn" placeholder="请选择记账名称(输入名称搜索)"></department>
+                  <department id="expenseReimbursementDetailList-department" v-show="queryParam.accountType=='INNER_ACCOUNT'" @change="accountNameSnChange" v-model="queryParam.accountNameSn" placeholder="请选择记账名称(输入名称搜索)"></department>
                   <!-- 经销商 -->
-                  <custList v-show="queryParam.accountType=='CUSTOMER'" ref="custList" @change="accountNameSnChange" placeholder="请选择记账名称(输入名称搜索)"></custList>
+                  <custList id="expenseReimbursementDetailList-custList" v-show="queryParam.accountType=='CUSTOMER'" ref="custList" @change="accountNameSnChange" placeholder="请选择记账名称(输入名称搜索)"></custList>
                   <!-- 供应商 -->
-                  <supplier v-show="queryParam.accountType=='OUT_ACCOUNT'" @change="accountNameSnChange" v-model="queryParam.accountNameSn" placeholder="请选择记账名称(输入名称搜索)"></supplier>
+                  <supplier id="expenseReimbursementDetailList-supplier" v-show="queryParam.accountType=='OUT_ACCOUNT'" @change="accountNameSnChange" v-model="queryParam.accountNameSn" placeholder="请选择记账名称(输入名称搜索)"></supplier>
                   <!-- 其它往来 -->
-                  <otherTransactions v-show="queryParam.accountType=='OTHER_ACCOUNT'" v-model="queryParam.accountNameSn" placeholder="请选择记账名称(输入名称搜索)"></otherTransactions>
-                  <a-select style="width: 100%" v-if="!queryParam.accountType" placeholder="请选择记账名称">
+                  <otherTransactions id="expenseReimbursementDetailList-other" v-show="queryParam.accountType=='OTHER_ACCOUNT'" v-model="queryParam.accountNameSn" placeholder="请选择记账名称(输入名称搜索)"></otherTransactions>
+                  <a-select style="width: 100%" v-if="!queryParam.accountType" placeholder="请选择记账名称" id="expenseReimbursementDetailList-kong">
                     <a-select-option value="" :disabled="true">
                       请先选择记账类型
                     </a-select-option>
@@ -99,6 +100,7 @@
                 <a-form-item label="费用承担方类型" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
                   <v-select
                     code="EXPENSE_ACCOUNT_DETAIL_SPLIT_OBJ_TYPE"
+                    id="expenseReimbursementDetailList-splitObjType"
                     allowClear
                     style="width: 100%;"
                     v-model="queryParam.splitObjType"
@@ -110,10 +112,10 @@
               <a-col :md="6" :sm="24">
                 <a-form-item label="费用承担方" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
                   <!-- 部门 -->
-                  <department v-show="queryParam.splitObjType=='DEPARTMENT'" style="width: 100%;" placeholder="请选择承担方" v-model="queryParam.splitObjSn"></department>
+                  <department id="expenseReimbursementDetailList-department" v-show="queryParam.splitObjType=='DEPARTMENT'" style="width: 100%;" placeholder="请选择承担方" v-model="queryParam.splitObjSn"></department>
                   <!-- 经销商 -->
-                  <custList v-show="queryParam.splitObjType=='CUSTOMER'" ref="custList" @change="custChange" placeholder="请选择(输入名称搜索)"></custList>
-                  <a-select style="width: 100%" v-if="!queryParam.splitObjType" placeholder="请选择">
+                  <custList id="expenseReimbursementDetailList-custList" v-show="queryParam.splitObjType=='CUSTOMER'" ref="custList" @change="custChange" placeholder="请选择(输入名称搜索)"></custList>
+                  <a-select style="width: 100%" v-if="!queryParam.splitObjType" placeholder="请选择" id="expenseReimbursementDetailList-kong1">
                     <a-select-option value="" :disabled="true">
                       请先选择承担方类型
                     </a-select-option>
@@ -122,12 +124,12 @@
               </a-col>
               <a-col :md="6" :sm="24" v-show="queryParam.splitObjType=='DEPARTMENT'">
                 <a-form-item label="费用承担人" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-                  <employee style="width: 100%;" placeholder="请选择承担人员" v-model="queryParam.childSplitObjSn"></employee>
+                  <employee id="expenseReimbursementDetailList-employee" style="width: 100%;" placeholder="请选择承担人员" v-model="queryParam.childSplitObjSn"></employee>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24" v-show="queryParam.splitObjType==undefined">
                 <a-form-item label="费用承担人" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-                  <a-select style="width: 100%" placeholder="请选择">
+                  <a-select style="width: 100%" placeholder="请选择" id="expenseReimbursementDetailList-kong2">
                     <a-select-option value="" :disabled="true">
                       请先选择承担方类型
                     </a-select-option>
@@ -142,8 +144,8 @@
             </template>
             <a-col :md="6" :sm="24">
               <div class="table-page-search-submitButtons">
-                <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
-                <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                <a-button id="expenseReimbursementDetailList-search" type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button id="expenseReimbursementDetailList-reset" style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
                 <a-button
                   style="margin-left: 10px"
                   type="primary"
@@ -153,7 +155,7 @@
                   :loading="exportLoading"
                   v-if="$hasPermissions('B_expenseAcctDetailReport')"
                   id="expenseAcctDetail-export">导出</a-button>
-                <a @click="advanced=!advanced" style="margin-left: 8px">
+                <a @click="advanced=!advanced" style="margin-left: 8px" id="expenseReimbursementDetailList-advanced">
                   {{ advanced ? '收起' : '展开' }}
                   <a-icon :type="advanced ? 'up' : 'down'"/>
                 </a>
@@ -220,14 +222,14 @@ export default {
       advanced: true, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 选择客户弹框是否显示
-      exportLoading: false,
+      exportLoading: false, // 导出loading
       tableHeight: 0,
       time: [
         moment(getDate.getCurrMonthDays().starttime, 'YYYY-MM-DD'),
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ],
-      countData: null,
-      expenseTypes: [],
+      countData: null, // 统计信息
+      expenseTypes: [], // 费用类型
       // 查询参数
       queryParam: {
         expenseDate: undefined, // 月份
@@ -244,15 +246,15 @@ export default {
         splitObjType: undefined, // 费用承担方类型
         splitObjSn: undefined, //  费用承担方
         childSplitObjSn: undefined, // 费用承担人
-        subareaArea: {
+        subareaArea: { // 区域信息
           subareaName: '',
           subareaAreaName: ''
         },
-        provinceName: '',
-        cityName: '',
+        provinceName: '', // 省
         provinceSn: undefined,
+        cityName: '', // 市
         citySn: undefined,
-        bizUserSn: undefined
+        bizUserSn: undefined // 客服
       },
       addrProvinceList: [], // 省列表
       addrCityList: [], // 城市列表数据
@@ -315,46 +317,52 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    // 费用发生月份
     onChange (date, dateString) {
       this.queryParam.expenseDate = dateString
     },
+    // 费用发生月份禁用时间
+    disabledDate (current) {
+      return current && current > moment().endOf('day')
+    },
+    // 费用类型
     expenseChange (val, opts) {
-      console.log(val, opts)
       this.expenseTypes = val || []
       this.queryParam.expenseType = val && val[0] ? val[0] : ''
       this.queryParam.expenseType2 = val && val[1] ? val[1] : ''
       this.queryParam.expenseType3 = val && val[2] ? val[2] : ''
     },
+    // 经销商 ,费用承担方
     custChange (val) {
       this.queryParam.splitObjSn = val.key
     },
-    disabledDate (current) {
-      return current && current > moment().endOf('day')
-    },
+    // 申请人选择
     employeeChange (v) {
       this.queryParam.employeeSn = v.key
     },
+    // 申请部门选择
     applyDepartmentChange (v) {
       this.queryParam.applyDepartmentSn = v.key
     },
     // 记账名称变化时
     accountNameSnChange (v, row) {
-      console.log(v, row)
       if (v) {
         this.queryParam.accountNameSn = v.key
       }
     },
+    // 费用承担方类型
     splitObjTypeChange (v) {
       this.queryParam.splitObjSn = undefined
       this.queryParam.childSplitObjSn = undefined
       this.$refs.custList.dealerName = []
     },
+    // 统计信息
     getDetailCount (params) {
       expenseAccountDetailCount(params).then(res => {
         this.countData = res.data || null
       })
     },
-    //  导出
+    //  导出费用报销明细统计报表
     handleExport () {
       const _this = this
       const params = JSON.parse(JSON.stringify(_this.queryParam))
@@ -401,12 +409,14 @@ export default {
       this.expenseTypes = []
       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 - 235

+ 3 - 2
src/views/promotionRulesManagement/dealerPromotions/detail.vue

@@ -22,10 +22,11 @@
           <a-descriptions-item label="参与客户" v-if="detailData.dealerScope!='ALL_DEALER'"><div @click="handleSee">共<span class="link-bule">{{ detailData.dealerQty }}</span>个</div></a-descriptions-item>
           <a-descriptions-item label="参与客户" v-else>全部客户</a-descriptions-item>
           <a-descriptions-item label="活动订单起订金额(元)">{{ detailData.minOrderFlag ==='0'?'不限':detailData.minOrderAmount?toThousands(detailData.minOrderAmount):'--' }}</a-descriptions-item>
-          <a-descriptions-item label="活动经费上限(元)" :span="2">{{ detailData.upperLimitFlag ==='0'?'不限':detailData.upperLimitAmount? toThousands(detailData.upperLimitAmount):'--' }}</a-descriptions-item>
+          <a-descriptions-item label="活动经费上限(元)":span="2">{{ detailData.upperLimitFlag ==='0'?'不限':detailData.upperLimitAmount? toThousands(detailData.upperLimitAmount):'--' }}</a-descriptions-item>
           <a-descriptions-item label="促销描述" :span="3">
-            <div class="descItem">{{ detailData.content || '' }}</div>
+            <div class="descItem">{{ detailData.content || '--' }}</div>
           </a-descriptions-item>
+          <a-descriptions-item label="终止说明" :span="3" v-if="detailData.state === 'IS_OVER'&&detailData.overInfo">{{ detailData.overInfo }}</a-descriptions-item>
           <a-descriptions-item label="附件" :span="3">
             <div class="attachmentBox" v-if="detailData.attachmentList&&detailData.attachmentList.length>0">
               <a

+ 120 - 0
src/views/promotionRulesManagement/dealerPromotions/endDescModal.vue

@@ -0,0 +1,120 @@
+<template>
+  <a-modal
+    centered
+    class="endDescription-modal"
+    :footer="null"
+    :maskClosable="false"
+    v-model="isShow"
+    title="提示"
+    @cancel="isShow=false"
+    :width="500">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div style="margin-bottom: 20px;font-weight: bold;margin-left:20px;">确定要终止该促销吗?</div>
+      <a-form-model
+        id="endDescription-form"
+        ref="ruleForm"
+        :model="form"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol" >
+        <a-form-model-item label="促销简称" prop="name">
+          <span>{{ form.name }}</span>
+        </a-form-model-item>
+        <a-form-model-item label="终止说明" prop="newTimeEnd">
+          <a-input id="endDescription-desc" v-model="form.desc" type="textarea" placeholder="请输入终止说明(最多50字符)" :maxLength="50"/>
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button id="endDescription-modal-back" @click="isShow = false">取消</a-button>
+        <a-button style="margin-left: 15px;" type="primary" id="endDescription-modal-save" @click="handleSave">确定</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+// 接口
+import { promotionIsOver } from '@/api/promotion'
+export default {
+  name: 'EndDescModal',
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemObj: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      // form 表单label布局
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 18 }
+      },
+      // 提交参数
+      form: {
+        sn: undefined,
+        name: '',
+        desc: undefined
+      }
+    }
+  },
+  methods: {
+    //  确定终止
+    handleSave () {
+      const _this = this
+      _this.spinning = true
+      promotionIsOver({ promotionSn: this.form.sn, overInfo: this.form.desc }).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$emit('ok')
+          _this.isShow = false
+        }
+        _this.spinning = false
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.form = {
+          sn: undefined,
+          name: '',
+          desc: undefined
+        }
+      } else {
+        if (this.itemObj) {
+          this.form = { ...this.form, ...this.itemObj }
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .endDescription-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+
+</style>

+ 19 - 21
src/views/promotionRulesManagement/dealerPromotions/list.vue

@@ -151,10 +151,11 @@
               @click="handleEnd(record)"
               class="button-info"
               :id="'promotionList-edit-btn'+record.id">终止</a-button>
+            <!-- canDelFlag  1显示删除按钮 0不显示删除按钮 (权限:发布状态  关闭 活动状态 进行中||已结束 并且从没有销售单参与过该活动) -->
             <a-button
               size="small"
               type="link"
-              v-if="$hasPermissions('B_dealerPromotionDel')&&(record.state == 'WAIT_SUBMIT'||record.state == 'AUDIT_REJECT')"
+              v-if="$hasPermissions('B_dealerPromotionDel')&&record.canDelFlag == 1"
               @click="handleDel(record)"
               class="button-error"
               :id="'promotionList-del-btn'+record.id">删除</a-button>
@@ -182,6 +183,8 @@
       <add-modal v-drag :itemSn="itemSn" :openModal="openModal" @ok="handleOk" @close="openModal=false" />
       <!-- 促销时间变更 -->
       <edit-active-end-time ref="editTime" v-drag :openModal="editEndModal" @ok="$refs.table.refresh()" @close="editEndModal=false" />
+      <!-- 终止促销 -->
+      <end-desc-modal v-drag :openModal="openEndActivityModal" @ok="$refs.table.refresh()" :itemObj="endObj" @close="closeEndActivityModal" ></end-desc-modal>
       <!-- 审核弹窗 -->
       <a-modal
         closable
@@ -250,6 +253,7 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import addModal from './addModal.vue'
 import lookUpCustomersModal from './lookUpCustomersModal'
+import endDescModal from './endDescModal'
 import rangeDate from '@/views/common/rangeDate.vue'
 import creatorList from '@/views/common/creatorList.vue'
 import editActiveEndTime from './editActiveEndTime.vue'
@@ -262,7 +266,7 @@ import { dealerPromotionList, dealerPromotionDel, modifyEnabledFlag, promotionAu
 export default {
   name: 'PromotionManagementList',
   mixins: [commonMixin],
-  components: { STable, supplier, VSelect, rangeDate, warehouse, lookUpCustomersModal, addModal, editActiveEndTime, creatorList, custList },
+  components: { STable, supplier, VSelect, rangeDate, warehouse, lookUpCustomersModal, endDescModal, addModal, editActiveEndTime, creatorList, custList },
   data () {
     this.handleAuditModal = debounce(this.handleAuditModal, 800)
     return {
@@ -323,7 +327,9 @@ export default {
       itemPromotionSn: '', // 参与客户,当前sn
       itemStatusType: '', // 按你加载类型 isEdit 编辑 isAudit 审核 isClose关闭
       chooseDealerArr: [], // 所选择经销商列表
-      loadingAudit: false// 审核按钮加载状态
+      loadingAudit: false,
+      endObj: null, // 终止促销数据
+      openEndActivityModal: false// 打开终止促销弹窗
     }
   },
   methods: {
@@ -474,24 +480,16 @@ export default {
     },
     // 终止
     handleEnd (row) {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确定要终止该促销?',
-        centered: true,
-        onOk () {
-          _this.spinning = true
-          promotionIsOver({ sn: row.promotionSn }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh()
-              _this.spinning = false
-            } else {
-              _this.spinning = false
-            }
-          })
-        }
-      })
+      this.endObj = {
+        sn: row.promotionSn,
+        name: row.description,
+        desc: row.overInfo || undefined
+      }
+      this.openEndActivityModal = true
+    },
+    closeEndActivityModal () {
+      this.openEndActivityModal = false
+      this.endObj = null
     },
     // 关闭采购退货详情弹框
     closeDetailModal () {

+ 18 - 15
src/views/promotionRulesManagement/orderStatistics/list.vue

@@ -7,7 +7,7 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate id="orderStatisticsList-time" ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -43,7 +43,7 @@
               <span class="table-page-search-submitButtons">
                 <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="orderStatisticsList-refresh">查询</a-button>
                 <a-button style="margin-left: 5px" @click="resetSearchForm()" :disabled="disabled" id="orderStatisticsList-reset">重置</a-button>
-                <a @click="advanced=!advanced" style="margin-left: 5px">
+                <a @click="advanced=!advanced" style="margin-left: 5px" id="orderStatisticsList-advanced">
                   {{ advanced ? '收起' : '展开' }}
                   <a-icon :type="advanced ? 'up' : 'down'"/>
                 </a>
@@ -83,7 +83,7 @@
             v-if="$hasPermissions('B_orderStatistics_detail')"
             @click="handleDetail(record)"
             class="button-success"
-            id="orderStatisticsList-edit-btn">详情</a-button>
+            :id="'orderStatisticsList-detail-'+record.id">详情</a-button>
           <span v-else>--</span>
         </template>
       </s-table>
@@ -114,14 +114,14 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       // 查询参数
       queryParam: {
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        buyerSn: undefined,
-        promoActiveSn: undefined,
-        salesBillNo: '',
-        billStatus: undefined
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束时间
+        buyerSn: undefined, // 客户名称
+        promoActiveSn: undefined, // 促销名称
+        salesBillNo: '', // 销售单号
+        billStatus: undefined // 业务状态
       },
-      time: [
+      time: [ // 时间默认值
         getDate.getCurrMonthDays().starttime,
         getDate.getCurrMonthDays().endtime
       ],
@@ -151,8 +151,8 @@ export default {
       },
       openModal: false, //  弹框是否显示
       itemSn: '', //  当前sn
-      nowData: null,
-      productTotal: null
+      nowData: null, // 当前操作数据
+      productTotal: null // 合计
     }
   },
   computed: {
@@ -173,9 +173,9 @@ export default {
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '4%', align: 'center' }
       ]
-        arr.splice(8, 0, { title: '原价总额', dataIndex: 'promoTotal', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(9, 0, { title: '促销品总额', dataIndex: 'totalPromoAmount', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(10, 0, { title: '节省总额', dataIndex: 'totalEconomizeAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      arr.splice(8, 0, { title: '原价总额', dataIndex: 'promoTotal', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      arr.splice(9, 0, { title: '促销品总额', dataIndex: 'totalPromoAmount', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      arr.splice(10, 0, { title: '节省总额', dataIndex: 'totalEconomizeAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       return arr
     }
   },
@@ -185,9 +185,11 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    // 客户选择
     custChange (obj) {
       this.queryParam.buyerSn = obj.key
     },
+    // 促销规则选择
     promoChange (obj) {
       this.queryParam.promoActiveSn = obj.key
     },
@@ -234,6 +236,7 @@ export default {
         _this.setTableH()
       })
     },
+    // 表格高度计算
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 236

+ 3 - 1
src/views/reportData/tireSalesReport/detailList.vue

@@ -334,7 +334,9 @@ export default {
       this.showOutDetail = true
       const titObj = {
         tit: row.dealerEntity.dealerName,
-        code: row.productEntity.code
+        code: row.productEntity.code,
+        origCode: row.productEntity.origCode,
+        size: row.productEntity.size
       }
       this.$nextTick(() => {
         this.$refs.outDetail.getAjaxData(params, titObj)

+ 1 - 1
src/views/reportData/tireSalesReport/outDetailModal.vue

@@ -86,7 +86,7 @@ export default {
     getAjaxData (obj, titObj) {
       this.queryParam = obj
       if (titObj && Object.keys(titObj).length != 0) {
-        this.titleInfo = titObj.tit + '(产品编码:' + titObj.code + ')'
+        this.titleInfo = titObj.tit + '(产品编码:' + titObj.code + ',原厂编码:' + (titObj.origCode || '--') + ',产品尺寸:' + (titObj.size || '--') + ')'
       } else {
         this.titleInfo = '出库明细'
       }

+ 3 - 0
src/views/salesManagement/salesQueryNew/list.vue

@@ -598,6 +598,7 @@ export default {
     // 转费用单
     async handleExpense (row) {
       const _this = this
+      _this.spinning = true
       const hasExpense = await queryCreateBySalesBillSn({ salesBillSn: row.salesBillSn }).then(res => res.data || [])
       const showModalFlag = []
       const optionsKey = [
@@ -653,6 +654,7 @@ export default {
           })
         }
       }
+      _this.spinning = false
     },
     // 选择费用报销单类型
     changeDaOpt (e) {
@@ -673,6 +675,7 @@ export default {
           this.$refs.table.refresh()
           this.openBaseModal = false
           this.expenseOption = null
+          this.$refs.expenseModal.spinning = false
           this.$router.push({ name: 'expenseReimbursementEdit', params: { sn: res.data.expenseAccountSn } })
         }
       })

+ 134 - 59
src/views/salesManagement/waitCostOrder/list.vue

@@ -3,7 +3,7 @@
     <a-spin :spinning="spinning" tip="Loading...">
       <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont">
         <template slot="subTitle">
-          <a href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <a href="javascript:;" @click="handleBack" id="waitCostList-back-btn"><a-icon type="left" /> 返回列表</a>
         </template>
       </a-page-header>
       <a-card size="small" :bordered="false" class="pages-wrap">
@@ -14,13 +14,19 @@
               <a-form layout="inline" @keyup.enter.native="searchTable">
                 <a-row :gutter="15" type="flex">
                   <a-col flex="300px">
-                    <a-form-item label="促销名称/简称">
-                      <a-input v-model.trim="queryParam.promotionDescription" allowClear placeholder="请输入促销名称/简称"/>
+                    <a-form-item label="销售单号">
+                      <a-input id="waitCostList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+                    </a-form-item>
+                  </a-col>
+                  <a-col flex="300px">
+                    <a-form-item label="客户名称">
+                      <dealerSubareaScopeList id="waitCostList-dealerSubareaScopeList" ref="dealerSubareaScopeList" @change="custChange" />
                     </a-form-item>
                   </a-col>
                   <a-col flex="300px">
                     <a-form-item label="费用类型">
                       <v-select
+                        id="waitCostList-convertExpenseAccountType"
                         v-model="queryParam.convertExpenseAccountType"
                         code="CONVERT_EXPENSE_ACCOUNT_TYPE"
                         placeholder="请选择费用类型"
@@ -28,23 +34,18 @@
                     </a-form-item>
                   </a-col>
                   <a-col flex="300px">
-                    <a-form-item label="客户名称">
-                      <dealerSubareaScopeList ref="dealerSubareaScopeList" @change="custChange" />
-                    </a-form-item>
-                  </a-col>
-                  <a-col flex="300px">
-                    <a-form-item label="销售单号">
-                      <a-input v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+                    <a-form-item label="促销名称/简称">
+                      <a-input id="waitCostList-promotionDescription" v-model.trim="queryParam.promotionDescription" allowClear placeholder="请输入促销名称/简称"/>
                     </a-form-item>
                   </a-col>
                   <a-col flex="300px">
                     <a-form-item label="规则简称">
-                      <a-input v-model.trim="queryParam.promotionRuleDescription" allowClear placeholder="请输入规则简称"/>
+                      <a-input id="waitCostList-promotionRuleDescription" v-model.trim="queryParam.promotionRuleDescription" allowClear placeholder="请输入规则简称"/>
                     </a-form-item>
                   </a-col>
                   <a-col flex="150px">
-                    <a-button type="primary" :disabled="disabled" @click="searchForm">查询</a-button>
-                    <a-button style="margin-left: 10px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                    <a-button type="primary" id="handel-search" :disabled="disabled" @click="searchForm(false)">查询</a-button>
+                    <a-button style="margin-left: 10px" id="handel-reset" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
                   </a-col>
                 </a-row>
               </a-form>
@@ -64,8 +65,7 @@
             ref="table"
             :style="{ height: pageHeight+67+'px' }"
             size="small"
-            :rowKey="(record) => record.no"
-            rowKeyName="no"
+            :rowKey="(record) => record.id"
             :columns="columns"
             :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: curExpenseAccountType ? record.convertExpenseAccountType != curExpenseAccountType : false } }) }"
             @rowSelection="rowSelectionFun"
@@ -78,6 +78,7 @@
               <div>
                 <a-button
                   size="small"
+                  :id="'handel-submit-'+record.no"
                   type="link"
                   class="button-warning"
                   @click="handleSave(record)"
@@ -91,54 +92,68 @@
     <div class="affix-cont" :style="{padding:hideFooter?0:'7px 0 4px'}">
       <a-button
         style="width: 100px;"
-        type="primary"
-        class="button-info"
+        type="info"
+        id="handel-views"
         @click="handleView()"
       >
-        查看
+        查看已选
       </a-button>
       <a-button
         type="primary"
+        class="button-info"
+        id="handel-submit"
         :disabled="spinning"
         style="width: 100px;margin: 0 20px;"
         @click="handleSave()"
       >
         提交
       </a-button>
+      <a-button
+        type="primary"
+        id="handel-mergeSubmit"
+        :disabled="spinning"
+        style="width: 100px;"
+        @click="handleMerge()"
+      >
+        合并提交
+      </a-button>
     </div>
     <!-- 新增费用单 -->
     <baseDataModal ref="expenseModal" @expenseSaveOk="expenseSaveOk" :show="openBaseModal" @close="openBaseModal=false"></baseDataModal>
     <!-- 查看已选费用单 -->
-    <viewSelectModal ref="viewModal" :openModal="showViewModal" @close="showViewModal=false"></viewSelectModal>
+    <viewSelectModal ref="viewModal" :openModal="showViewModal" @close="showViewModal=false" @submit="meargeSubmit"></viewSelectModal>
+    <!-- 合并选项弹框 -->
+    <meargeOptionModal ref="meargeModal" :openModal="showMeargeModal" @close="showMeargeModal=false" @meargeOk="meargeOk"/>
   </div>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import baseDataModal from '@/views/expenseManagement/expenseReimbursement/baseDataModal.vue'
 import viewSelectModal from './viewSelectModal.vue'
-import { salesConvertExpenseList, expenseAccountSave, queryBatchCreateBySalesBillSn } from '@/api/salesNew'
+import meargeOptionModal from './meargeOptionModal.vue'
+import { salesConvertExpenseList, expenseAccountSave, queryBatchCreateBySalesBillSn, expenseAccountSaveGroupType, queryBatchCreateBySalesPromoSnListGroupType } from '@/api/salesNew'
 export default {
   name: 'WaitCostOrder',
   mixins: [commonMixin],
-  components: { STable, VSelect, dealerSubareaScopeList, baseDataModal, viewSelectModal },
+  components: { STable, VSelect, dealerSubareaScopeList, baseDataModal, viewSelectModal, meargeOptionModal },
   data () {
     return {
       spinning: false,
       disabled: false,
-      hideFooter: false,
+      hideFooter: false, // 隐藏页面底部
       openBaseModal: false, // 费用弹框
-      fromRouter: '',
-      authCode: '',
+      showMeargeModal: false, // 合并选项弹框
+      fromRouter: '', // 从那个页面打开
+      authCode: '', // 数据权限码
       queryParam: {
-        promotionDescription: '',
-        convertExpenseAccountType: '',
-        salesBillNo: '',
-        promotionRuleDescription: '',
-        buyerName: ''
+        promotionDescription: '', // 销名称/简称
+        convertExpenseAccountType: '', // 费用类型
+        salesBillNo: '', // 销售单号
+        promotionRuleDescription: '', // 规则简称
+        buyerName: '' // 客户名称
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -146,7 +161,7 @@ export default {
         this.spinning = true
         delete parameter.tableId
         delete parameter.index
-        this.getPageHeight()
+        this.getPageHeight() // 获取表格高度
         return salesConvertExpenseList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
@@ -161,28 +176,29 @@ export default {
           return data
         })
       },
-      rowSelectionInfo: null,
-      curExpenseAccountType: '',
-      pageHeight: 300,
-      showViewModal: false,
-      isSearch: false
+      rowSelectionInfo: null, // 已选行
+      curExpenseAccountType: '', // 当前已选费用类型
+      pageHeight: 300, // 默认页面高度
+      showViewModal: false, // 查看已选费用单
+      isSearch: false // 是否查询中
     }
   },
   computed: {
+    // 已选数据数量
     hasSelect () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length
     },
     columns () {
       const _this = this
       const arr = [
-        { title: '序号', dataIndex: 'no', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '销售单号', dataIndex: 'salesBillNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'buyerName', width: '16%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '费用类型', dataIndex: 'convertExpenseAccountTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '待转金额', dataIndex: 'expense', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '促销名称', dataIndex: 'promotionTitle', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '促销简称', dataIndex: 'promotionDescription', width: '17%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
-        { title: '规则简称', dataIndex: 'promotionRuleDescription', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, sorter: true },
+        { title: '促销简称', dataIndex: 'promotionDescription', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '规则简称', dataIndex: 'promotionRuleDescription', width: '16%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '促销类型', dataIndex: 'promotionRuleTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
@@ -194,22 +210,23 @@ export default {
     handleBack () {
       this.$router.push({ name: 'salesQueryNewList' })
     },
+    // 页面高度计算
     getPageHeight () {
       this.pageHeight = window.innerHeight - 290 - (this.$refs.searchbox ? this.$refs.searchbox.clientHeight : 0)
     },
-    // 表格选中项
+    // 表格选中项,只能选中统一费用类型的
     rowSelectionFun (obj) {
-      console.log(obj)
       this.rowSelectionInfo = obj || null
       if (obj.selectedRows) {
         this.curExpenseAccountType = obj.selectedRows && obj.selectedRows[0] && obj.selectedRows[0]['convertExpenseAccountType'] || ''
+        // 没用勾选任何数据,刷新列表
         if (obj.selectedRows.length <= 1) {
           if (!this.isSearch) {
             this.$refs.table.refresh()
           }
           this.isSearch = false
         } else {
-          // 全选
+          // 全选,盘点是否类型一致,否则不能全选
           const ret = obj.selectedRows.filter(item => item.convertExpenseAccountType == this.curExpenseAccountType)
           if (ret.length != obj.selectedRows.length) {
             this.$message.warning('费用类型不一致,请重新勾选!')
@@ -218,54 +235,108 @@ export default {
         }
       }
     },
+    // 客户选择
     custChange (val) {
       this.queryParam.buyerName = val.name || ''
     },
-    // 提交
+    // 合并提交
+    handleMerge () {
+      if (!this.hasSelect) {
+        this.$message.warning('请先勾选再合并提交!')
+        return
+      }
+      // 打开合并选项弹框
+      this.showMeargeModal = true
+    },
+    // 确定合并
+    meargeOk (groupType) {
+      // 批量合并
+      const salesPromoSnList = []
+      this.rowSelectionInfo.selectedRows.map(item => {
+        salesPromoSnList.push(item.salesPromoSn)
+      })
+      const params = {
+        salesPromoSnList: salesPromoSnList,
+        groupType: groupType
+      }
+      const meargeType = { 'CUSTOMER': '相同客户名称', 'CUSTOMER_PROMO': '相同促销活动', 'CUSTOMER_PROMO_RULE': '相同活动规则' }
+      // 开始合并
+      queryBatchCreateBySalesPromoSnListGroupType(params).then(res => {
+        // 打开已合并的待转费用报销单弹框
+        if (res.status == 200) {
+          const list = res.data && res.data.detailList || []
+          if (list.length) {
+            // 打开查看弹框
+            this.showViewModal = true
+            this.$refs.viewModal.title = '已合并的待转费用报销单' + '(按' + meargeType[groupType] + '合并)'
+            this.$refs.viewModal.submitType = 'mearge'
+            this.$refs.viewModal.setData(list, res.data)
+          } else {
+            this.$message.warning('没有可合并的待转费用报销单!')
+          }
+        }
+      })
+    },
+    // 确定合并提交转费用单弹框
+    meargeSubmit (data) {
+      this.expenseSave(data, 'salesMearge')
+    },
+    // 直接提交(不合并)
     handleSave (row) {
-      const _this = this
       const salesPromoSnList = []
       // 单个转
       if (row) {
         salesPromoSnList.push(row.salesPromoSn)
       } else {
-        const slen = _this.rowSelectionInfo.selectedRowKeys.length
-        if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && slen < 1)) {
-          _this.$message.warning('请在列表勾选后再进行批量操作!')
+        // 批量转
+        if (!this.hasSelect) {
+          this.$message.warning('请在列表勾选后再进行提交操作!')
           return
         }
-        // 批量转
         this.rowSelectionInfo.selectedRows.map(item => {
           salesPromoSnList.push(item.salesPromoSn)
         })
       }
-
+      // 打开转费用单弹框
       this.handleExpense(salesPromoSnList)
     },
     // 转费用单
     async handleExpense (snList) {
       const _this = this
+      this.spinning = true
       const hasExpense = await queryBatchCreateBySalesBillSn({ salesPromoSnList: snList }).then(res => res.data || [])
       let result = null
       for (const key in hasExpense) {
         result = hasExpense[key]
       }
-      _this.expenseSave(result)
+      // 转费用单弹框
+      _this.expenseSave(result, 'sales')
     },
-    // 转费用单
-    expenseSave (data) {
-      console.log(data)
+    // 新建费用单
+    expenseSave (data, type) {
       if (data) {
+        // 关闭查看弹框
+        this.$refs.viewModal.spinning = false
+        this.showViewModal = false
+        // 打开新建转费用单弹框
         this.openBaseModal = true
-        this.$refs.expenseModal.setDetail(data, 'sales')
+        this.$refs.expenseModal.setDetail(data, type)
+        this.spinning = false
+      } else {
+        this.spinning = false
       }
     },
-    expenseSaveOk (params) {
-      expenseAccountSave(params).then(res => {
+    // 转费用单成功,并跳转到费用单详情页面
+    expenseSaveOk (params, type) {
+      // type:
+      // sales:不合并
+      // salesMearge:合并转
+      const fun = type == 'sales' ? expenseAccountSave : expenseAccountSaveGroupType
+      fun(params).then(res => {
         if (res.status == 200) {
           this.$message.info(res.message)
           this.openBaseModal = false
-          this.searchForm()
+          this.searchForm(true)
           this.$router.push({ name: 'expenseReimbursementEdit', params: { sn: res.data.expenseAccountSn } })
         }
       })
@@ -277,6 +348,8 @@ export default {
         return
       }
       this.showViewModal = true
+      this.$refs.viewModal.title = '已选待转费用报销单'
+      this.$refs.viewModal.submitType = 'noMearge'
       this.$refs.viewModal.setData(this.rowSelectionInfo && this.rowSelectionInfo.selectedRows)
     },
     //  重置
@@ -291,10 +364,12 @@ export default {
       this.$refs.table.refresh(true)
       this.$refs.table.clearSelected()
     },
-    searchForm () {
+    searchForm (flag) {
       this.isSearch = true
       this.$refs.table.refresh(true)
-      this.$refs.table.clearSelected()
+      if (flag) {
+        this.$refs.table.clearSelected()
+      }
     }
   },
   activated () {

+ 83 - 0
src/views/salesManagement/waitCostOrder/meargeOptionModal.vue

@@ -0,0 +1,83 @@
+<template>
+  <a-modal
+    centered
+    :footer="null"
+    :maskClosable="false"
+    title="选择合并方式"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="500px">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div style="padding:15px;">
+        <a-icon :style="{ fontSize: '16px', color: '#666', marginRight:'6px' }" type="check-square" /> 相同客户名称
+      </div>
+      <div style="padding:5px 0 25px 40px;" v-if="sameCustomeName">
+        <a-checkbox id="meargeOptions-sameRules1" v-model="sameRules1" @change="sameRules2=undefined">相同促销活动</a-checkbox>
+        <a-checkbox id="meargeOptions-sameRules2" v-model="sameRules2" @change="sameRules1=undefined">相同活动规则(同一促销活动)</a-checkbox>
+      </div>
+      <div class="btn-cont" style="padding:20px 20px 0;text-align: center;">
+        <a-button type="info" @click="isShow=false" id="meargeOptions-cancel-btn">取消</a-button>
+        <a-button type="primary" style="margin-left: 10px" @click="submit" id="meargeOptions-ok-btn">确定</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import {
+  commonMixin
+} from '@/utils/mixin'
+export default {
+  name: 'ViewSelectModal',
+  mixins: [commonMixin],
+  props: {
+    openModal: {
+      type: Boolean, // 弹框显示
+      default: false
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal,
+      sameCustomeName: true, // 是否勾选相同客户名称
+      sameRules1: undefined, // 相同促销活动
+      sameRules2: undefined, // 相同活动规则(同一促销活动)
+      groupType: 'CUSTOMER'
+    }
+  },
+  methods: {
+    // 确定提交
+    submit () {
+      if (!this.sameRules1 && !this.sameRules2) {
+        this.groupType = 'CUSTOMER' // 相同客户名称
+      } else {
+        if (this.sameRules1) {
+          this.groupType = 'CUSTOMER_PROMO' // 相同促销活动
+        } else if (this.sameRules2) {
+          this.groupType = 'CUSTOMER_PROMO_RULE' // 相同活动规则(同一促销活动)
+        }
+      }
+      this.$emit('meargeOk', this.groupType)
+      this.isShow = false
+    }
+  },
+  watch: {
+    openModal (nVal, oVal) {
+      this.isShow = nVal
+    },
+    isShow (nVal, oVal) {
+      if (!nVal) {
+        this.$emit('close')
+      } else {
+        this.sameRules1 = undefined
+        this.sameRules2 = undefined
+        this.groupType = 'CUSTOMER'
+      }
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 102 - 75
src/views/salesManagement/waitCostOrder/viewSelectModal.vue

@@ -1,99 +1,126 @@
 <template>
-  <a-modal centered :footer="null" :maskClosable="false" title="已选待转费用报销单" v-model="isShow" @cancel="isShow=false"
+  <a-modal
+    v-drag
+    centered
+    :footer="null"
+    :maskClosable="false"
+    :title="title"
+    v-model="isShow"
+    @cancel="cancel"
     width="70%">
-    <div style="padding:10px;">共{{dataSource&&dataSource.length}}条</div>
+    <div style="padding:10px;">共{{ dataSource&&dataSource.length }}条</div>
     <a-spin :spinning="spinning" tip="Loading...">
       <div>
         <ve-table
-            border-y
-            v-show="!showEmpty"
-            :scroll-width="0"
-            :max-height="tableHeight"
-            :row-style-option="{clickHighlight: true}"
-            :cellSelectionOption="{enable: false}"
-            :virtual-scroll-option="{enable: true}"
-            :columns="columns"
-            :table-data="dataSource"
-            row-key-field-name="no"
-            :column-width-resize-option="columnWidthResizeOption"
-          />
+          border-y
+          v-show="!showEmpty"
+          :scroll-width="0"
+          :max-height="tableHeight"
+          :row-style-option="{clickHighlight: true}"
+          :cellSelectionOption="{enable: false}"
+          :virtual-scroll-option="{enable: true}"
+          :columns="columns"
+          :table-data="dataSource"
+          row-key-field-name="no"
+          :column-width-resize-option="columnWidthResizeOption"
+        />
         <div v-show="showEmpty" class="empty-data"><a-empty description="暂无数据" :image="simpleImage"/></div>
       </div>
       <div class="btn-cont" style="padding:20px 20px 0;text-align: center;">
-        <a-button type="primary" class="button-info" style="margin-left: 10px" @click="isShow=false">确定</a-button>
+        <a-button id="viewChoose-modal-cancel" type="primary" v-if="submitType=='noMearge'" class="button-info" @click="cancel">关闭</a-button>
+        <a-button id="viewChoose-modal-submit" type="primary" v-else @click="submit">提交</a-button>
       </div>
     </a-spin>
   </a-modal>
 </template>
 
 <script>
-  import {
-    commonMixin
-  } from '@/utils/mixin'
-  import { Empty } from 'ant-design-vue';
-  export default {
-    name: 'ViewSelectModal',
-    mixins: [commonMixin],
-    props: {
-      openModal: {
-        type: Boolean,
-        default: false
+import {
+  commonMixin
+} from '@/utils/mixin'
+import { Empty } from 'ant-design-vue'
+export default {
+  name: 'ViewSelectModal',
+  mixins: [commonMixin],
+  props: {
+    openModal: { // 弹框显示
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, // 弹框显示
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
+      columnWidthResizeOption: {
+        // default false
+        enable: true,
+        // column resize min width
+        minWidth: 50
       },
+      showEmpty: false, // 无数据图表
+      tableHeight: 450, // 表格高度
+      dataSource: [], // 列表数据
+      title: '已选待转费用报销单',
+      submitType: 'noMearge', // 默认是,直接勾选的数据,不是合并后的数据
+      otherData: null // 其它参数
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', field: 'no', key: 'a', width: 50, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '销售单号', field: 'salesBillNo', key: 'b', width: 100, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '客户名称', field: 'buyerName', key: 'c', width: 150, align: 'center', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '费用类型', field: 'convertExpenseAccountTypeDictValue', key: 'd', width: 100, align: 'center', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '待转金额', field: 'expense', key: 'e', width: 80, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '促销名称', field: 'promotionTitle', key: 'f', width: 150, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '促销简称', field: 'promotionDescription', key: 'g', width: 150, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '规则简称', field: 'promotionRuleDescription', key: 'h', width: 150, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '促销类型', field: 'promotionRuleTypeDictValue', key: 'l', width: 100, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    // 设置列表数据
+    setData (list, data) {
+      this.otherData = data
+      this.dataSource = JSON.parse(JSON.stringify(list))
+      this.dataSource.map((item, index) => {
+        item.no = index + 1
+        // 合并列表字段不一样
+        if (this.submitType == 'mearge') {
+          item.convertExpenseAccountTypeDictValue = item.expenseTypeName
+          item.promotionRuleTypeDictValue = item.promotionRuleTypeName
+        }
+        item.expense = this.toThousands(item.expense, 2)
+      })
     },
-    data() {
-      const _this = this
-      return {
-        spinning: false,
-        isShow: this.openModal,
-        simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
-        columnWidthResizeOption: {
-            // default false
-            enable: true,
-            // column resize min width
-            minWidth: 50
-        },
-        showEmpty: false,
-        tableHeight: 450,
-        dataSource: []
-      }
-    },
-    computed: {
-      columns() {
-        const arr =  [
-                { title: '序号', field: 'no',key: "a", width: 50, align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
-                { title: '销售单号', field: 'salesBillNo',key: "b", width: 100, align: 'left',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'} },
-                { title: '客户名称', field: 'buyerName',key: "c", width: 150, align: 'left',operationColumn: false , ellipsis: { showTitle: true },renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
-                { title: '费用类型', field: 'convertExpenseAccountTypeDictValue',key: "d", width: 100, align: 'center',operationColumn: false,ellipsis: { showTitle: true },renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'} },
-                { title: '待转金额', field: 'expense',key: "e", width: 80, align: 'right',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
-                { title: '促销名称', field: 'promotionTitle',key: "f", width: 150, align: 'left',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
-                { title: '促销简称', field: 'promotionDescription',key: "g", width: 150, align: 'left',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
-                { title: '规则简称', field: 'promotionRuleDescription',key: "h", width: 150, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
-                { title: '促销类型', field: 'promotionRuleTypeDictValue',key: "l", width: 100, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}}
-            ]
-        return arr
-      }
+    // 继续提交
+    submit () {
+      this.spinning = true
+      this.$emit('submit', this.submitType == 'noMearge' ? this.dataSource : this.otherData)
     },
-    methods: {
-       setData(list){
-         this.dataSource = JSON.parse(JSON.stringify(list))
-         this.dataSource.map((item,index) => {
-           item.no = index + 1
-         })
-       }
+    // 关闭弹框
+    cancel () {
+      this.isShow = false
+    }
+  },
+  watch: {
+    openModal (nVal, oVal) {
+      this.isShow = nVal
     },
-    watch: {
-      openModal(nVal, oVal) {
-        this.isShow = nVal
-      },
-      isShow(nVal, oVal) {
-        if (!nVal) {
-          this.$emit('close')
-          this.dataSource = []
-        }
+    isShow (nVal, oVal) {
+      if (!nVal) {
+        this.$emit('close')
+        this.dataSource = []
       }
     }
   }
+}
 </script>
 
 <style>
-</style>
+</style>

+ 1 - 1
vue.config.js

@@ -108,7 +108,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remosve the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.2.117/ocs-admin',
+        // target: 'http://192.168.2.124:8602/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
         target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,