Sfoglia il codice sorgente

Merge commit '017968b59619800c55afd2028d49f65bdf622e17' into HEAD

gitadmin 10 mesi fa
parent
commit
e9b09c1e8a

+ 1 - 1
public/version.json

@@ -1,4 +1,4 @@
 {
-    "version": "2.2.422",
+    "version": "2.2.424",
     "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

@@ -237,7 +237,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({

+ 104 - 36
src/views/expenseManagement/expenseReimbursement/add.vue

@@ -45,6 +45,7 @@
           <div style="display: flex;justify-content: space-between;align-items: center;">
             <div>费用明细</div>
             <div>
+              <a-button size="small" class="button-info" type="primary" @click="plEdit">变更记账名称</a-button>
               <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>
             </div>
@@ -63,6 +64,8 @@
           :rowKey="(record) => record.id"
           :columns="columns"
           :data="loadData"
+          :row-selection="{ columnWidth: 40 }"
+          @rowSelection="rowSelectionFun"
           :defaultLoadData="false"
           :showPagination="false"
           bordered>
@@ -91,6 +94,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 +135,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 +169,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],
@@ -203,20 +212,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 +236,11 @@ export default {
     handleEditBase (event) {
       this.openBaseModal = true
     },
+    // 刷新列表
     refashData () {
       this.getDetail(true)
     },
-    //  费用单基础详情
+    //  获取费用单基础详情
     getDetail (type) {
       this.spinning = true
       this.disabled = true
@@ -245,46 +258,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 +366,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
@@ -330,9 +402,8 @@ export default {
       this.$router.push({ name: 'expenseReimbursementList' })
     },
     pageInit () {
-      console.log(1)
+      this.$refs.table.clearTable()
       if (this.$route.params.sn) { //  编辑页
-        console.log(2)
         this.getDetail(false)
       }
     }
@@ -343,10 +414,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 => {})

+ 16 - 9
src/views/expenseManagement/expenseReimbursement/baseDataModal.vue

@@ -1,5 +1,6 @@
 <template>
   <a-modal
+    v-drag
     v-model="opened"
     :title="title"
     centered
@@ -174,12 +175,12 @@ export default {
         if (this.expenseAccountSn) { //  编辑页
           this.getDetail()
           this.title = '编辑费用报销单'
-        }else{
+        } else {
           this.title = '新增费用报销单'
         }
       })
     },
-    retsetForm(){
+    retsetForm () {
       this.form = {
         applyPersonSn: undefined, // 申请人
         applyDepartmentSn: undefined, //  申请部门
@@ -238,19 +239,19 @@ export default {
       })
     },
     // 设置数据
-    setDetail(data, from){
+    setDetail (data, from) {
       console.log(data)
       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)
     },
@@ -277,13 +278,19 @@ export default {
           const form = JSON.parse(JSON.stringify(_this.form))
           form.expenseDate = form.expenseDate + '-01'
           form.expenseAccountFilesList = this.attachList
-          _this.spinning = true
           console.log(form)
+          _this.spinning = true
           // 从销售单转的费用
-          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)
@@ -311,7 +318,7 @@ export default {
       this.opened = newValue
       if (newValue) {
         this.pageInit()
-      }else{
+      } else {
         this.retsetForm()
       }
     },

+ 22 - 14
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">
@@ -139,17 +144,18 @@ export default {
       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,9 +176,9 @@ export default {
           return data
         })
       },
-      chooseLoadData: [],
-      detailData: null, //  详情数据
-      total: 0
+      detailData: null, // 详情数据
+      total: 0,
+      printRemark: false // 是否打印备注
     }
   },
   methods: {
@@ -194,6 +200,7 @@ export default {
       }
       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([{

+ 84 - 56
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>
@@ -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;"
@@ -102,7 +120,7 @@
             </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 () {
@@ -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,53 +285,59 @@ 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
         }
@@ -367,13 +394,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 ? '批量变更记账名称' : '新增费用明细'
         }
       }
     }

+ 6 - 3
src/views/expenseManagement/expenseReimbursement/list.vue

@@ -95,8 +95,9 @@
         <!-- 操作按钮 -->
         <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 type="primary" v-if="$hasPermissions('B_eRPrint')" :loading="spinning" @click="handlePlPrint()" ghost>批量打印</a-button>
+          <a-checkbox v-model="printRemark" v-if="$hasPermissions('B_eRPrint')" id="print-remark">打印备注</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>
@@ -273,7 +274,8 @@ export default {
           return data
         })
       },
-      rowSelectionInfo: null // 批量选择的数据
+      rowSelectionInfo: null, // 批量选择的数据
+      printRemark: false // 是否打印备注
     }
   },
   methods: {
@@ -324,6 +326,7 @@ export default {
           businessSnList.push(rows[i].expenseAccountSn)
         }
         pageData.push({
+          printRemark: this.printRemark,
           expenseInfo: rows[i],
           fyListData: fyListData,
           spListData: []

+ 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, '费用报销单')
     }
   }
 }

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

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

@@ -82,7 +82,7 @@
           ref="table"
           :style="{ height: tableHeight+70+'px' }"
           size="small"
-          :rowKey="(record) => record.sparePartsReturnNo"
+          :rowKey="(record) => record.id"
           :columns="columns"
           :data="loadData"
           :scroll="{ y: tableHeight }"
@@ -151,10 +151,11 @@
               @click="handleEnd(record)"
               class="button-info"
               id="promotionList-edit-btn">终止</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">删除</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
@@ -248,7 +251,8 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import addModal from './addModal.vue'
-import lookUpCustomersModal from './lookUpCustomersModal' 
+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'
@@ -260,7 +264,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 {
@@ -319,7 +323,9 @@ export default {
       itemPromotionSn: '',
       itemStatusType: '',
       chooseDealerArr: [], // 所选择经销商列表
-      loadingAudit: false
+      loadingAudit: false,
+      endObj: null, // 终止促销数据
+      openEndActivityModal: false// 打开终止促销弹窗
     }
   },
   methods: {
@@ -465,24 +471,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 () {

+ 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

@@ -595,6 +595,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 = [
@@ -650,6 +651,7 @@ export default {
           })
         }
       }
+      _this.spinning = false
     },
     // 选择费用报销单类型
     changeDaOpt (e) {
@@ -670,6 +672,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,