Bladeren bron

调拨类型、费用类型修改

lilei 2 jaren geleden
bovenliggende
commit
dfdb502f2a
23 gewijzigde bestanden met toevoegingen van 377 en 157 verwijderingen
  1. 8 1
      src/api/expenseManagement.js
  2. 3 0
      src/components/index.less
  3. 1 1
      src/components/newThem.less
  4. 6 15
      src/views/allocationManagement/matchSendOutOrder/list.vue
  5. 3 23
      src/views/allocationManagement/transferOut/basicInfoModal.vue
  6. 19 6
      src/views/allocationManagement/transferOut/list.vue
  7. 24 21
      src/views/allocationManagement/transferReturn/basicInfoModal.vue
  8. 9 1
      src/views/allocationManagement/transferReturn/detail.vue
  9. 22 6
      src/views/allocationManagement/transferReturn/edit.vue
  10. 22 4
      src/views/allocationManagement/transferReturn/editGrp.vue
  11. 25 4
      src/views/allocationManagement/transferReturn/list.vue
  12. 1 10
      src/views/allocationManagement/transfersPrint/list.vue
  13. 20 19
      src/views/common/allocateType.js
  14. 73 0
      src/views/common/expenseType.js
  15. 40 7
      src/views/expenseManagement/expenseReimbursement/add.vue
  16. 25 7
      src/views/expenseManagement/expenseReimbursement/baseDataModal.vue
  17. 1 1
      src/views/expenseManagement/expenseReimbursement/detail.vue
  18. 12 6
      src/views/expenseManagement/expenseReimbursement/epenseDetailModal.vue
  19. 22 7
      src/views/expenseManagement/expenseReimbursement/list.vue
  20. 17 7
      src/views/expenseManagement/expenseReimbursement/productInfoModal.vue
  21. 22 9
      src/views/expenseManagement/expenseReimbursementDetail/list.vue
  22. 1 1
      src/views/productManagement/shelfNoManage/changeRecordModal.vue
  23. 1 1
      src/views/productManagement/shelfNoManage/editHwModal.vue

+ 8 - 1
src/api/expenseManagement.js

@@ -111,7 +111,14 @@ export const expenseAcctDetailSave = (params) => {
     method: 'post'
   })
 }
-
+// 费用类型
+export const expenseTypeList = (params) => {
+  return axios({
+    url: `/expenseType/queryTreeList`,
+    data: params,
+    method: 'post'
+  })
+}
 // 导入费用报销明细
 export const expenseImportDetail = (params) => {
   return axios({

+ 3 - 0
src/components/index.less

@@ -350,4 +350,7 @@
 }
 .ant-alert-message, .ant-card-head{
   color: #000000!important;
+}
+.ant-select-disabled .ant-select-selection,.ant-cascader-picker-disabled{
+  color: #999!important;
 }

+ 1 - 1
src/components/newThem.less

@@ -7,4 +7,4 @@
 @collapse-header-padding: 6px 8px;
 @table-padding-vertical: 5px;
 @table-padding-horizontal: 5px;
-@input-disabled-bg: #dedede;
+@input-disabled-bg: #fdfdfd;

+ 6 - 15
src/views/allocationManagement/matchSendOutOrder/list.vue

@@ -16,16 +16,11 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="调拨类型">
-                <AllocateType id="allocateBillList-allocateTypeSn" v-model="queryParam.allocateTypeSn"></AllocateType>
+              <a-form-item label="收货客户名称">
+                <dealerSubareaScopeList ref="receiverSn" defValKey="buyerSn" @change="custChange" v-model="queryParam.receiverSn" />
               </a-form-item>
             </a-col>
             <template v-if="advanced">
-              <a-col :md="6" :sm="24">
-                <a-form-item label="收货客户名称">
-                  <dealerSubareaScopeList ref="receiverSn" defValKey="buyerSn" @change="custChange" v-model="queryParam.receiverSn" />
-                </a-form-item>
-              </a-col>
               <a-col :md="4" :sm="24">
                 <a-form-item label="业务状态">
                   <v-select
@@ -108,11 +103,10 @@ import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import { allocateBillList, allocateBillCheck } from '@/api/allocateBill'
-import AllocateType from '@/views/common/allocateType.js'
 export default {
   name: 'MatchSendOutOrderAllocationList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, AllocateType, dealerSubareaScopeList },
+  components: { STable, VSelect, rangeDate, dealerSubareaScopeList },
   data () {
     return {
       spinning: false,
@@ -126,7 +120,6 @@ export default {
         beginDate: getDate.getThreeMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
         targetName: '', //  调往对象
-        allocateTypeSn: undefined, //  调拨类型
         state: undefined, //  业务状态
         allocateNo: '', //  调拨单号
         receiverSn: undefined,
@@ -165,11 +158,10 @@ export default {
         { title: '序号', dataIndex: 'no', width: '3.5%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '调拨单号', scopedSlots: { customRender: 'allocateNo' }, align: 'center', width: '13.5%' },
-        { title: '调往对象', dataIndex: 'targetName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '调往对象', dataIndex: 'targetName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '发货编号', dataIndex: 'sendNo', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '收货客户名称', dataIndex: 'receiverName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '收货客户名称', dataIndex: 'receiverName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '总数量', dataIndex: 'totalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调拨类型', dataIndex: 'allocateTypeName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '对单状态', dataIndex: 'checkStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '对单人员', dataIndex: 'checkPersonName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -195,7 +187,6 @@ export default {
       this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.targetName = ''
-      this.queryParam.allocateTypeSn = undefined
       this.queryParam.state = undefined
       this.queryParam.allocateNo = ''
       this.queryParam.receiverSn = ''
@@ -240,7 +231,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 238
+      this.tableHeight = window.innerHeight - tableSearchH - 195
     }
   },
   watch: {

+ 3 - 23
src/views/allocationManagement/transferOut/basicInfoModal.vue

@@ -46,14 +46,7 @@
           </a-col>
           <a-col :md="12" :sm="24">
             <a-form-model-item label="费用/调拨类型" prop="costTypeSn">
-              <a-cascader
-                id="allocateBill-basicInfo-allocateTypeSn"
-                v-model="allocateTypeVal"
-                @change="allocateTypeChange"
-                :options="allocateTypeList"
-                expand-trigger="hover"
-                placeholder="请选择费用/调拨类型"
-                :fieldNames="{ label: 'name', value: 'allocateTypeSn', children: 'sonList' }"/>
+              <AllocateType id="allocateBill-basicInfo-allocateTypeSn" v-model="allocateTypeVal" placeholder="请选择费用/调拨类型" @change="allocateTypeChange"></AllocateType>
             </a-form-model-item>
           </a-col>
           <a-col :md="12" :sm="24">
@@ -100,13 +93,13 @@ import { VSelect } from '@/components'
 import { allocateBillSave } from '@/api/allocateBill'
 import { dealerSubareaScopeList } from '@/api/dealer'
 import { getLookUpData } from '@/api/data'
-import { allocateTypeTreeList } from '@/api/allocateType'
 import ProductBrand from '@/views/common/productBrand.js'
 import productTypeAll from '@/views/common/productTypeAll.js'
+import AllocateType from '@/views/common/allocateType.js'
 export default {
   name: 'TransferOutBasicInfoModal',
   mixins: [commonMixin],
-  components: { VSelect, ProductBrand, productTypeAll },
+  components: { VSelect, ProductBrand, productTypeAll, AllocateType },
   props: {
     openModal: {
       //  弹框显示状态
@@ -151,7 +144,6 @@ export default {
       dealerData: [], //  经销商  下拉数据
       targetTypeList: [], //  调往对象类型
       allocateTypeVal: [],
-      allocateTypeList: [], //  调拨类型
       dateFormat: 'YYYY-MM-DD HH:mm:ss',
       selectPriceDate: '',
       isEdit: false
@@ -264,16 +256,6 @@ export default {
           _this.targetTypeList = []
         }
       })
-    },
-    //  获取调拨类型
-    getAllocateTypeAllList () {
-      allocateTypeTreeList({}).then(res => {
-        if (res.status == 200) {
-          this.allocateTypeList = res.data
-        } else {
-          this.allocateTypeList = []
-        }
-      })
     }
   },
   watch: {
@@ -286,7 +268,6 @@ export default {
       if (!newValue) {
         this.$emit('close')
         this.$refs.ruleForm.resetFields()
-        this.allocateTypeList = []
         this.allocateTypeVal = []
         this.productType = []
         this.form = {
@@ -307,7 +288,6 @@ export default {
         }
       } else {
         this.getTargetTypeList()
-        this.getAllocateTypeAllList()
         // 编辑
         if (this.detailData) {
           this.isEdit = true

+ 19 - 6
src/views/allocationManagement/transferOut/list.vue

@@ -16,8 +16,8 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="调拨类型">
-                <AllocateType id="allocateBillList-allocateTypeSn" placeholder="请选择调拨类型" v-model="queryParam.allocateTypeSn"></AllocateType>
+              <a-form-item label="费用/调拨类型">
+                <AllocateType id="allocateBillList-costTypeName" v-model="allocateTypeVal" :changeOnSelect="true" placeholder="请选择费用/调拨类型" @change="changeAllocatype"></AllocateType>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
@@ -117,8 +117,8 @@
         <!-- 调拨类型 -->
         <template slot="allocateType" slot-scope="text, record">
           <div>
-            <span v-if="record.costTypeName">{{ record.costTypeName }}/</span>
-            <span v-if="record.allocateSortName">{{ record.allocateSortName }}/</span>
+            <span v-if="record.allocateSortName">{{ record.allocateSortName }}</span>
+            <span v-if="record.allocateSortName&&record.allocateTypeName">/</span>
             <span v-if="record.allocateTypeName">{{ record.allocateTypeName }}</span>
           </div>
         </template>
@@ -188,11 +188,14 @@ export default {
         moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ],
+      allocateTypeVal: [],
       queryParam: { //  查询条件
         beginDate: getDate.getThreeMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
         targetName: '', //  调往对象
-        allocateTypeSn: undefined, //  调拨类型
+        costTypeSn: undefined, // 费用类型
+        allocateSortSn: undefined, //  调拨类型1
+        allocateTypeSn: undefined, //  调拨类型2
         state: undefined, //  业务状态
         allocateNo: '', //  调拨单号
         receiverSn: undefined,
@@ -239,7 +242,8 @@ export default {
         { title: '总数量', dataIndex: 'totalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '总售价', dataIndex: 'totalPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '审核时间', dataIndex: 'auditTime', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '费用/调拨类型', scopedSlots: { customRender: 'allocateType' }, width: '8%', align: 'center' },
+        { title: '费用类型', dataIndex: 'costTypeName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨类型', scopedSlots: { customRender: 'allocateType' }, width: '6%', align: 'center' },
         { title: '业务状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '打印状态', dataIndex: 'printStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '打印次数', dataIndex: 'printCount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -266,18 +270,27 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    changeAllocatype (val, opts) {
+      this.allocateTypeVal = val || []
+      this.queryParam.costTypeSn = val && val[0] ? val[0] : ''
+      this.queryParam.allocateSortSn = val && val[1] ? val[1] : ''
+      this.queryParam.allocateTypeSn = val && val[2] ? val[2] : ''
+    },
     //  重置
     resetSearchForm () {
       this.$refs.rangeDate.resetDate(this.time)
       this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.targetName = ''
+      this.queryParam.costTypeSn = undefined
+      this.queryParam.allocateSortSn = undefined
       this.queryParam.allocateTypeSn = undefined
       this.queryParam.state = undefined
       this.queryParam.checkStatus = undefined
       this.queryParam.printState = undefined
       this.queryParam.allocateNo = ''
       this.queryParam.receiverSn = undefined
+      this.allocateTypeVal = []
       this.$refs.receiverSn.resetForm()
       this.$refs.table.refresh(true)
     },

+ 24 - 21
src/views/allocationManagement/transferReturn/basicInfoModal.vue

@@ -44,10 +44,8 @@
           </a-select>
           <a-input v-if="!isDealer" v-model.trim="form.targetName" placeholder="请输入调拨退货对象名称(最多30个字符)" allowClear :maxLength="30" />
         </a-form-model-item>
-        <a-form-model-item label="调拨退货类型" prop="allocateReturnTypeSn">
-          <a-select id="allocateBill-basicInfo-allocateReturnTypeSn" v-model="form.allocateReturnTypeSn" placeholder="请选择调拨退货类型" allowClear >
-            <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-          </a-select>
+        <a-form-model-item label="费用/调拨退货类型" prop="costTypeSn">
+          <AllocateType id="allocateBill-basicInfo-allocateTypeSn" v-model="allocateTypeVal" placeholder="请选择费用/调拨退货类型" @change="allocateTypeChange"></AllocateType>
         </a-form-model-item>
         <a-form-model-item label="是否抓单" prop="grabFlag">
           <v-select
@@ -77,10 +75,10 @@ import debounce from 'lodash/debounce'
 import { VSelect } from '@/components'
 import { allocateReturnSave, allocateReturnQueryBySn } from '@/api/allocateReturn'
 import { dealerSubareaScopeList } from '@/api/dealer'
-import { allocateTypeAllList } from '@/api/allocateType'
+import AllocateType from '@/views/common/allocateType.js'
 export default {
   name: 'TransferOutBasicInfoModal',
-  components: { VSelect },
+  components: { VSelect, AllocateType },
   mixins: [commonMixin],
   props: {
     openModal: {
@@ -98,10 +96,13 @@ export default {
         labelCol: { span: 4 },
         wrapperCol: { span: 20 }
       },
+      allocateTypeVal: [],
       form: {
         targetType: 'DEALER',
         targetSn: undefined,
         targetName: '',
+        costTypeSn: undefined,
+        allocateSortSn: undefined,
         allocateReturnTypeSn: undefined,
         grabFlag: '1',
         remarks: ''
@@ -110,12 +111,11 @@ export default {
         targetType: [{ required: true, message: '请选择调往对象', trigger: 'change' }],
         targetSn: [{ required: true, message: '请选择调往对象名称', trigger: 'change' }],
         targetName: [{ required: true, message: '请输入调往对象名称', trigger: 'blur' }],
-        allocateReturnTypeSn: [{ required: true, message: '请选择调拨类型', trigger: 'change' }],
+        costTypeSn: [{ required: true, message: '请选择费用/调拨退货类型', trigger: 'change' }],
         grabFlag: [{ required: true, message: '请选择是否抓单', trigger: 'change' }]
       },
       fetching: false,
-      dealerData: [], //  经销商  下拉数据
-      allocateTypeList: [] //  调拨类型
+      dealerData: [] //  经销商  下拉数据
     }
   },
   computed: {
@@ -144,6 +144,18 @@ export default {
       const ind = this.dealerData.findIndex(item => item.dealerSn == value)
       this.form.targetName = this.dealerData[ind].dealerName
     },
+    // 调拨类别 change
+    allocateTypeChange (val, opt) {
+      console.log(val, opt, '------------')
+      this.allocateTypeVal = val
+      this.form.costTypeSn = val[0] ? val[0] : ''
+      this.form.allocateSortSn = val[1] ? val[1] : ''
+      this.form.allocateReturnTypeSn = val[2] ? val[2] : ''
+      // 名称
+      this.form.costTypeName = opt[0] ? opt[0].name : ''
+      this.form.allocateSortName = opt[1] ? opt[1].name : ''
+      this.form.allocateReturnTypeName = opt[2] ? opt[2].name : ''
+    },
     // 基本信息
     getDetail (data, flag) {
       const _this = this
@@ -190,26 +202,19 @@ export default {
         this.form.grabFlag = '0'
       }
     },
-    //  调拨类型
-    getAllocateTypeAllList () {
-      allocateTypeAllList().then(res => {
-        if (res.status == 200) {
-          this.allocateTypeList = res.data
-        } else {
-          this.allocateTypeList = []
-        }
-      })
-    },
     resetForm () {
       this.$refs.ruleForm.resetFields()
       this.form = {
         targetType: 'DEALER',
         targetSn: undefined,
         targetName: '',
+        costTypeSn: undefined,
+        allocateTypeSn: undefined,
         allocateReturnTypeSn: undefined,
         grabFlag: '1',
         remarks: ''
       }
+      this.allocateTypeVal = []
     }
   },
   watch: {
@@ -222,8 +227,6 @@ export default {
       if (!newValue) {
         this.resetForm()
         this.$emit('close')
-      } else {
-        this.getAllocateTypeAllList()
       }
     }
   }

+ 9 - 1
src/views/allocationManagement/transferReturn/detail.vue

@@ -25,7 +25,15 @@
               <a-descriptions-item label="调拨退货单号">{{ (basicInfoData&&basicInfoData.allocateReturnNo) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="调拨退货对象">{{ (basicInfoData&&basicInfoData.targetTypeDictValue) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="调拨退货对象名称">{{ (basicInfoData&&basicInfoData.targetName) || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="调拨退货类型">{{ (basicInfoData&&basicInfoData.allocateReturnTypeName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="费用类型">
+                {{ (basicInfoData&&basicInfoData.costTypeName) || '--' }}
+              </a-descriptions-item>
+              <a-descriptions-item label="调拨退货类型">
+                <div>
+                  <span v-if="basicInfoData&&basicInfoData.allocateSortName">{{ basicInfoData.allocateSortName || '--' }}</span>
+                  <span v-if="basicInfoData&&basicInfoData.allocateReturnTypeName">/{{ basicInfoData.allocateReturnTypeName || '--' }}</span>
+                </div>
+              </a-descriptions-item>
               <a-descriptions-item label="是否抓单">{{ basicInfoData&&basicInfoData.grabFlagDictValue || '--' }}</a-descriptions-item>
               <a-descriptions-item label="业务状态">{{ (basicInfoData&&basicInfoData.stateDictValue) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="备注">{{ (basicInfoData&&basicInfoData.remarks) || '--' }}</a-descriptions-item>

+ 22 - 6
src/views/allocationManagement/transferReturn/edit.vue

@@ -19,8 +19,13 @@
               <a-descriptions-item label="调拨退货单号">{{ (basicInfoData&&basicInfoData.allocateReturnNo) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="调拨退货对象">{{ (basicInfoData&&basicInfoData.targetTypeDictValue) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="调拨退货对象名称">{{ (basicInfoData&&basicInfoData.targetName) || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="调拨退货类型">
-                <AllocateType id="allocateEdit-allocateReturnTypeSn" style="width: 200px;" @change="changeAllocateType" v-model="basicInfoData.allocateReturnTypeSn"></AllocateType>
+              <a-descriptions-item label="费用/调拨退货类型">
+                <AllocateType
+                  id="allocateEdit-allocateReturnTypeSn"
+                  style="width: 220px;"
+                  v-model="allocateTypeVal"
+                  placeholder="请选择费用/调拨退货类型"
+                  @change="changeAllocateType"></AllocateType>
               </a-descriptions-item>
               <a-descriptions-item label="是否抓单">{{ (basicInfoData&&basicInfoData.grabFlagDictValue) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="业务状态">{{ (basicInfoData&&basicInfoData.stateDictValue) || '--' }}</a-descriptions-item>
@@ -332,7 +337,8 @@ export default {
       basicInfoData: null, // 基本信息
       openGuideModal: false, //  导入产品引导
       openModal: false,
-      nowType: null
+      nowType: null,
+      allocateTypeVal: []
     }
   },
   methods: {
@@ -351,8 +357,18 @@ export default {
       _this.editRemark = false
     },
     // 修改调拨类型
-    changeAllocateType (val) {
+    changeAllocateType (val, opt) {
+      console.log(val, opt, '------------')
       const _this = this
+      this.allocateTypeVal = val
+      this.basicInfoData.costTypeSn = val[0] ? val[0] : ''
+      this.basicInfoData.allocateSortSn = val[1] ? val[1] : ''
+      this.basicInfoData.allocateReturnTypeSn = val[2] ? val[2] : ''
+      // 名称
+      this.basicInfoData.costTypeName = opt[0] ? opt[0].name : ''
+      this.basicInfoData.allocateSortName = opt[1] ? opt[1].name : ''
+      this.basicInfoData.allocateReturnTypeName = opt[2] ? opt[2].name : ''
+
       this.$confirm({
         title: '提示',
         content: '确定要更改调拨退货类型吗?',
@@ -492,8 +508,8 @@ export default {
       allocateReturnQueryBySn({ allocateReturnSn: this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.basicInfoData = res.data
-          if (!flag) {
-            this.resetSearchForm()
+          if (this.basicInfoData.costTypeSn) {
+            this.allocateTypeVal = [this.basicInfoData.costTypeSn, this.basicInfoData.allocateSortSn, this.basicInfoData.allocateReturnTypeSn]
           }
         } else {
           this.basicInfoData = null

+ 22 - 4
src/views/allocationManagement/transferReturn/editGrp.vue

@@ -19,8 +19,13 @@
               <a-descriptions-item label="调拨退货单号">{{ (basicInfoData&&basicInfoData.allocateReturnNo) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="调拨退货对象">{{ (basicInfoData&&basicInfoData.targetTypeDictValue) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="调拨退货对象名称">{{ (basicInfoData&&basicInfoData.targetName) || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="调拨退货类型">
-                <AllocateType id="allocateEdit-allocateReturnTypeSn" style="width: 200px;" @change="changeAllocateType" v-model="basicInfoData.allocateReturnTypeSn"></AllocateType>
+              <a-descriptions-item label="费用/调拨退货类型">
+                <AllocateType
+                  id="allocateEdit-allocateReturnTypeSn"
+                  style="width: 220px;"
+                  v-model="allocateTypeVal"
+                  placeholder="请选择费用/调拨退货类型"
+                  @change="changeAllocateType"></AllocateType>
               </a-descriptions-item>
               <a-descriptions-item label="是否抓单">{{ (basicInfoData&&basicInfoData.grabFlagDictValue) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="业务状态">{{ (basicInfoData&&basicInfoData.stateDictValue) || '--' }}</a-descriptions-item>
@@ -308,7 +313,8 @@ export default {
       },
       basicInfoData: null, // 基本信息
       openGuideModal: false, //  导入产品引导
-      rowSelectionInfo: null
+      rowSelectionInfo: null,
+      allocateTypeVal: []
     }
   },
   computed: {
@@ -419,8 +425,17 @@ export default {
       _this.editRemark = false
     },
     // 修改调拨类型
-    changeAllocateType (val) {
+    changeAllocateType (val, opt) {
+      console.log(val, opt, '------------')
       const _this = this
+      this.allocateTypeVal = val
+      this.basicInfoData.costTypeSn = val[0] ? val[0] : ''
+      this.basicInfoData.allocateSortSn = val[1] ? val[1] : ''
+      this.basicInfoData.allocateReturnTypeSn = val[2] ? val[2] : ''
+      // 名称
+      this.basicInfoData.costTypeName = opt[0] ? opt[0].name : ''
+      this.basicInfoData.allocateSortName = opt[1] ? opt[1].name : ''
+      this.basicInfoData.allocateReturnTypeName = opt[2] ? opt[2].name : ''
       this.$confirm({
         title: '提示',
         content: '确定要更改调拨退货类型吗?',
@@ -560,6 +575,9 @@ export default {
       allocateReturnQueryBySn({ allocateReturnSn: this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.basicInfoData = res.data
+          if (this.basicInfoData.costTypeSn) {
+            this.allocateTypeVal = [this.basicInfoData.costTypeSn, this.basicInfoData.allocateSortSn, this.basicInfoData.allocateReturnTypeSn]
+          }
           if (!flag) {
             this.resetSearchForm()
           }

+ 25 - 4
src/views/allocationManagement/transferReturn/list.vue

@@ -21,8 +21,8 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="调拨退货类型">
-                <AllocateType id="transferReturn-allocateReturnTypeSn" v-model="queryParam.allocateReturnTypeSn"></AllocateType>
+              <a-form-item label="费用/调拨退货类型">
+                <AllocateType id="transferReturn-allocateReturnTypeSn" v-model="allocateTypeVal" :changeOnSelect="true" placeholder="请选择费用/调拨退货类型" @change="changeAllocatype"></AllocateType>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
@@ -80,6 +80,14 @@
           <span v-if="$hasPermissions('M_transferReturnDetail')" class="link-bule" @click="handleDetail(record)">{{ record.allocateReturnNo }}</span>
           <span v-else>{{ record.allocateReturnNo }}</span>
         </template>
+        <!-- 调拨类型 -->
+        <template slot="allocateType" slot-scope="text, record">
+          <div>
+            <span v-if="record.allocateSortName">{{ record.allocateSortName }}</span>
+            <span v-if="record.allocateSortName&&record.allocateReturnTypeName">/</span>
+            <span v-if="record.allocateReturnTypeName">{{ record.allocateReturnTypeName }}</span>
+          </div>
+        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -146,13 +154,16 @@ export default {
         // moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
         // moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ],
+      allocateTypeVal: [],
       queryParam: { //  查询条件
         // beginDate: getDate.getThreeMonthDays().starttime,
         // endDate: getDate.getCurrMonthDays().endtime,
         beginDate: '',
         endDate: '',
         targetName: '', //  调往对象
-        allocateReturnTypeSn: undefined, //  调拨退货类型
+        costTypeSn: undefined, // 费用类型
+        allocateSortSn: undefined, //  调拨类别
+        allocateReturnTypeSn: undefined, // 调拨退货类型2
         state: undefined, //  业务状态
         allocateReturnNo: '' //  调拨单号
       },
@@ -190,7 +201,8 @@ export default {
         { title: '调拨退货单号', scopedSlots: { customRender: 'allocateReturnNo' }, align: 'center', width: '8%' },
         { title: '调拨退货对象类型', dataIndex: 'targetTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '调拨退货对象名称', dataIndex: 'targetName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '调拨退货类型', dataIndex: 'allocateReturnTypeName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '费用类型', dataIndex: 'costTypeName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨退货类型', scopedSlots: { customRender: 'allocateType' }, width: '6%', align: 'center' },
         { title: '是否抓单', dataIndex: 'grabFlagDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '退货总数量', dataIndex: 'totalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '坏件数量', dataIndex: 'totalBadQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -209,6 +221,12 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    changeAllocatype (val, opts) {
+      this.allocateTypeVal = val || []
+      this.queryParam.costTypeSn = val && val[0] ? val[0] : ''
+      this.queryParam.allocateSortSn = val && val[1] ? val[1] : ''
+      this.queryParam.allocateReturnTypeSn = val && val[2] ? val[2] : ''
+    },
     //  重置
     resetSearchForm () {
       this.$refs.rangeDate.resetDate('')
@@ -219,7 +237,10 @@ export default {
       this.queryParam.targetName = ''
       this.queryParam.state = undefined
       this.queryParam.allocateReturnNo = ''
+      this.queryParam.costTypeSn = undefined
+      this.queryParam.allocateSortSn = undefined
       this.queryParam.allocateReturnTypeSn = undefined
+      this.allocateTypeVal = []
       this.$refs.table.refresh(true)
     },
     //  删除

+ 1 - 10
src/views/allocationManagement/transfersPrint/list.vue

@@ -24,11 +24,6 @@
                   <a-input id="allocateBillList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调往对象"/>
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-item label="调拨类型">
-                  <AllocateType id="allocateBillList-allocateTypeSn" v-model="queryParam.allocateTypeSn"></AllocateType>
-                </a-form-item>
-              </a-col>
               <template v-if="advanced">
                 <a-col :md="6" :sm="24">
                   <a-form-item label="收货客户名称">
@@ -157,12 +152,11 @@ import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import printModal from '@/views/allocationManagement/transferOut/printModal.vue'
 import recordModal from './recordModal.vue'
 import { allocateBillList, allocateBillDetailPrint } from '@/api/allocateBill'
-import AllocateType from '@/views/common/allocateType.js'
 import { printFun } from '@/libs/JGPrint.js'
 export default {
   name: 'TransfersPrintList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, AllocateType, dealerSubareaScopeList, printModal, recordModal, subarea, Area },
+  components: { STable, VSelect, rangeDate, dealerSubareaScopeList, printModal, recordModal, subarea, Area },
   data () {
     return {
       spinning: false,
@@ -178,7 +172,6 @@ export default {
         beginDate: getDate.getThreeMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
         targetName: '', //  调往对象
-        allocateTypeSn: undefined, //  调拨类型
         state: undefined, //  业务状态
         allocateNo: '', //  调拨单号
         receiverSn: undefined,
@@ -228,7 +221,6 @@ export default {
         // { title: '易损件售价', dataIndex: 'receiveYsjTotalAmount', width: '70px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '电池售价', dataIndex: 'receiveDcTotalAmount', width: '70px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '机油售价', dataIndex: 'receiveJyTotalAmount', width: '70px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调拨类型', dataIndex: 'allocateTypeName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '打印状态', dataIndex: 'printStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '允许打印时间', dataIndex: 'allowPrintTime', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -263,7 +255,6 @@ export default {
       this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.targetName = ''
-      this.queryParam.allocateTypeSn = undefined
       this.queryParam.state = undefined
       this.queryParam.allocateNo = ''
       this.queryParam.receiverName = ''

+ 20 - 19
src/views/common/allocateType.js

@@ -1,34 +1,35 @@
-import { queryListByTreeLevel } from '@/api/allocateType'
+import { allocateTypeTreeList } from '@/api/allocateType'
 const AllocateType = {
   template: `
-      <a-select
-        :placeholder="placeholder"
-        :id="id"
-        allowClear
+      <a-cascader
         :value="defaultVal"
-        :showSearch="true"
+        allowClear
+        :change-on-select="changeOnSelect"
         @change="handleChange"
-        option-filter-prop="children"
-        :filter-option="filterOption">
-        <a-select-option v-for="item in list" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-      </a-select>
+        :options="list"
+        expand-trigger="hover"
+        :placeholder="placeholder"
+        :id="id"
+        :fieldNames="{ label: 'name', value: 'allocateTypeSn', children: 'sonList' }"/>
     `,
   props: {
     value: {
-      type: [String,Number],
-      defatut: ''
+      type: Array,
+      defatut: function(){
+        return []
+      }
     },
     id: {
       type: String,
       default: ''
     },
-    level: {
-      type: [String,Number],
-      default: '3'
-    },
     placeholder:{
       type: String,
       default: '请选择'
+    },
+    changeOnSelect:{
+      type: Boolean,
+      default: false
     }
   },
   data() {
@@ -51,14 +52,14 @@ const AllocateType = {
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
     },
-    handleChange(value) {
+    handleChange(value,opts) {
       this.defaultVal = value;
-      this.$emit('change', value);
       this.$emit('input', value);
+      this.$emit('change', value,opts);
     },
     //  调拨类型
     getProductBrand () {
-      queryListByTreeLevel({"treeLevel":this.level}).then(res => {
+      allocateTypeTreeList({}).then(res => {
         if (res.status == 200) {
           this.list = res.data
         } else {

+ 73 - 0
src/views/common/expenseType.js

@@ -0,0 +1,73 @@
+import { expenseTypeList } from '@/api/expenseManagement.js'
+const ExpenseType = {
+  template: `
+      <a-cascader
+        :value="defaultVal"
+        allowClear
+        :change-on-select="changeOnSelect"
+        @change="handleChange"
+        :options="list"
+        expand-trigger="hover"
+        :placeholder="placeholder"
+        :id="id"
+        :fieldNames="{ label: 'name', value: 'expenseTypeSn', children: 'sonList' }"/>
+    `,
+  props: {
+    value: {
+      type: Array,
+      defatut: function(){
+        return []
+      }
+    },
+    id: {
+      type: String,
+      default: ''
+    },
+    placeholder:{
+      type: String,
+      default: '请选择'
+    },
+    changeOnSelect:{
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+      defaultVal: this.value,
+      list: []
+    };
+  },
+  mounted() {
+    this.getProductBrand()
+  },
+  watch: {
+    value(newValue, oldValue) {
+      this.defaultVal = newValue
+    }
+  },
+  methods: {
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    handleChange(value,opts) {
+      this.defaultVal = value;
+      this.$emit('input', value);
+      this.$emit('change', value, opts);
+    },
+    //  调拨类型
+    getProductBrand () {
+      expenseTypeList({}).then(res => {
+        if (res.status == 200) {
+          this.list = res.data
+        } else {
+          this.list = []
+        }
+      })
+    },
+  },
+};
+
+export default ExpenseType

+ 40 - 7
src/views/expenseManagement/expenseReimbursement/add.vue

@@ -16,7 +16,7 @@
             <a-descriptions-item label="费用单号">{{ detailData&&detailData.expenseAccountNo || '--' }}</a-descriptions-item>
             <a-descriptions-item label="申请人">{{ detailData&&detailData.applyPersonName || '--' }}</a-descriptions-item>
             <a-descriptions-item label="申请部门">{{ detailData&&detailData.applyDepartmentName || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="费用类型">{{ detailData&&detailData.expenseTypeDictValue || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="费用类型">{{ detailData&&detailData.expenseTypeName || '--' }}<span v-if="detailData&&detailData.expenseType2">/{{ detailData&&detailData.expenseTypeName2 || '--' }}</span></a-descriptions-item>
             <a-descriptions-item label="费用发生月份">{{ detailData&&detailData.expenseDate?detailData.expenseDate.substring(0, 7) : '--' }}</a-descriptions-item>
             <a-descriptions-item label="合计金额">{{ (detailData.applyExpenseTotal || detailData.applyExpenseTotal == 0) ? detailData.applyExpenseTotal+' 元' : '--' }}</a-descriptions-item>
             <a-descriptions-item label="状态">{{ detailData&&detailData.stateDictValue || '--' }}</a-descriptions-item>
@@ -95,12 +95,17 @@
           </template>
           <!-- 产品信息 -->
           <template slot="cpxx" slot-scope="text,record">
-            <div v-for="item in record.detailProductsList" :key="item.id">
-              <div v-if="item.productCode">{{ item.productCode }}: ¥{{ item.expense }}</div>
-              <div v-else-if="item.productBrandName">{{ item.productBrandName }}<span v-if="item.productTypeShowName">/</span>{{ item.productTypeShowName }}: ¥{{ item.expense }}</div>
-              <div v-else>{{ item.productTypeShowName }}: ¥{{ item.expense }}</div>
+            <div style="display:flex;align-items: center;" v-if="record.detailProductsList">
+              <a-icon style="color:red;font-size:20px;" v-if="record.ptaFlag" type="exclamation-circle" />
+              <div style="padding-left: 6px;">
+                <div v-for="item in record.detailProductsList" :key="item.id">
+                  <div v-if="item.productCode">{{ item.productCode }}: ¥{{ item.expense }}</div>
+                  <div v-else-if="item.productBrandName">{{ item.productBrandName }}<span v-if="item.productTypeShowName">/</span>{{ item.productTypeShowName }}: ¥{{ item.expense }}</div>
+                  <div v-else>{{ item.productTypeShowName }}: ¥{{ item.expense }}</div>
+                </div>
+              </div>
             </div>
-            <span v-if="!record.detailProductsList||record.detailProductsList.length==0">--</span>
+            <div v-else>--</div>
           </template>
         </s-table>
       </a-card>
@@ -165,6 +170,7 @@ export default {
       expenseAccountDetailSn: '',
       openProductInfoModal: false, // 产品信息弹框
       total: 0,
+      hasPtaFlag: [],
       loadData: parameter => {
         const params = Object.assign(parameter, { expenseAccountSn: this.$route.params.sn })
         return expenseAcctDetailFindList(params).then(res => {
@@ -172,8 +178,20 @@ export default {
           if (res.status == 200) {
             data = res.data
             const no = 0
+            this.hasPtaFlag = []
             for (var i = 0; i < data.length; i++) {
               data[i].no = no + i + 1
+              // 产品信息合计
+              if (data[i].detailProductsList) {
+                data[i].productTotalAmount = 0
+                data[i].detailProductsList.map(item => {
+                  data[i].productTotalAmount += item.expense
+                })
+                data[i].ptaFlag = Math.floor(data[i].productTotalAmount) !== Math.abs(data[i].expense)
+                if (data[i].ptaFlag) {
+                  this.hasPtaFlag.push('第 ' + (i + 1) + ' 行')
+                }
+              }
             }
             this.total = data.length
             this.disabled = false
@@ -287,7 +305,22 @@ export default {
     },
     beforeSubmit () {
       if (this.total) {
-        this.openDepartUserModal = true
+        // 判断是否存在产品信息合计不等于记账费用
+        if (this.hasPtaFlag.length) {
+          const h = this.$createElement
+          this.$warning({
+            title: '操作提示',
+            content: h('div', {}, [
+              h('p', '提交失败,以下费用明细的产品信息金额之和,不等于记账费用,请修改后再提交!'),
+              h('p', '需要修改的行数:'),
+              h('p', { style: { color: '#00aaff' } }, this.hasPtaFlag.join(','))
+            ]),
+            centered: true,
+            onOk () {}
+          })
+        } else {
+          this.openDepartUserModal = true
+        }
       } else {
         this.$message.info('请新增费用明细')
       }

+ 25 - 7
src/views/expenseManagement/expenseReimbursement/baseDataModal.vue

@@ -29,13 +29,12 @@
           </a-col>
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <a-form-model-item label="费用类型" prop="expenseType">
-              <v-select
-                code="EXPENSE_TYPE"
+              <expenseType
                 id="expenseReimbursement-expenseType"
-                v-model="form.expenseType"
-                allowClear
+                v-model="expenseTypes"
+                @change="expenseChange"
                 placeholder="请选择费用类型"
-              ></v-select>
+              ></expenseType>
             </a-form-model-item>
           </a-col>
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
@@ -104,10 +103,11 @@ import { VSelect, Upload, STable } from '@/components'
 import moment from 'moment'
 import department from './department.js'
 import employee from './employee.js'
+import expenseType from '@/views/common/expenseType.js'
 import { expenseAccountDetail, expenseAccountSave } from '@/api/expenseManagement.js'
 export default {
   name: 'BaseDataModal',
-  components: { VSelect, Upload, STable, department, employee },
+  components: { VSelect, Upload, STable, department, employee, expenseType },
   props: {
     show: [Boolean],
     itemSn: {
@@ -127,10 +127,14 @@ export default {
       },
       attachList: [],
       attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo',
+      expenseTypes: [],
       form: {
         applyPersonSn: undefined, // 申请人
         applyDepartmentSn: undefined, //  申请部门
-        expenseType: undefined, //  费用类型
+        expenseType: undefined, //  费用类型1
+        expenseType2: undefined, //  费用类型2
+        expenseTypeName: undefined, //  费用类型1
+        expenseTypeName2: undefined, //  费用类型2
         expenseDate: moment().locale('zh-cn').format('YYYY-MM'), //  费用产生月
         title: '', // 主题
         content: '' // 费用说明
@@ -193,6 +197,15 @@ export default {
     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] : ''
+      // 名称
+      this.form.expenseTypeName = opts && opts[0] ? opts[0].name : ''
+      this.form.expenseTypeName2 = opts && opts[1] ? opts[1].name : ''
+    },
     //  附件上传
     changeAttach (file) {
       this.attachList = JSON.parse(file)
@@ -212,6 +225,11 @@ export default {
           this.form.expenseAccountFilesList = ''
           this.attachList = res.data.expenseAccountFilesList
           this.$refs.attachList.setFileList(this.attachList)
+          if (this.form.expenseType) {
+            this.expenseTypes = [this.form.expenseType, this.form.expenseType2]
+          } else {
+            this.expenseTypes = []
+          }
         } else {
           this.$refs.ruleForm.resetFields()
         }

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

@@ -35,7 +35,7 @@
               <a-descriptions-item label="费用单号">{{ detailData&&detailData.expenseAccountNo || '--' }}</a-descriptions-item>
               <a-descriptions-item label="申请人">{{ detailData&&detailData.applyPersonName || '--' }}</a-descriptions-item>
               <a-descriptions-item label="申请部门">{{ detailData&&detailData.applyDepartmentName || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="费用类型">{{ detailData&&detailData.expenseTypeDictValue || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="费用类型">{{ detailData&&detailData.expenseTypeName || '--' }}<span v-if="detailData&&detailData.expenseType2">/{{ detailData&&detailData.expenseTypeName2 || '--' }}</span></a-descriptions-item>
               <a-descriptions-item label="费用发生月份">{{ detailData&&detailData.expenseDate?detailData.expenseDate.substring(0, 7) : '--' }}</a-descriptions-item>
               <a-descriptions-item label="合计金额">{{ (detailData.applyExpenseTotal || detailData.applyExpenseTotal == 0) ? detailData.applyExpenseTotal+' 元' : '--' }}</a-descriptions-item>
               <a-descriptions-item label="状态">{{ detailData&&detailData.stateDictValue || '--' }}</a-descriptions-item>

+ 12 - 6
src/views/expenseManagement/expenseReimbursement/epenseDetailModal.vue

@@ -52,7 +52,6 @@
                   <subarea
                     id="epenseDetailModal-subarea"
                     ref="subareaBox"
-                    mode="multiple"
                     @change="subareaChange"
                     placeholder="请选择所属区域"
                     v-model="form.subareaSnList"></subarea>
@@ -190,8 +189,8 @@ export default {
           this.form.provinceName = row.provinceName
           this.form.cityName = row.cityName
           if (row.subareaNameSet) {
-            this.form.subareaNameList = row.subareaNameSet
-            this.form.subareaSnList = this.$refs.subareaBox.getValByName(row.subareaNameSet)
+            this.form.subareaNameList = row.subareaNameSet.filter(item => item !== '中国')
+            this.form.subareaSnList = [this.$refs.subareaBox.getValByName(this.form.subareaNameList)[0]]
           }
         }
       }
@@ -248,21 +247,24 @@ export default {
           if (cdfList[0] == 1) {
             this.$warning({
               title: '是否存在以下情况,请按照要求填写',
-              content: <div><p>1、费用承担方至少有一个</p><p>2、带星号的列为必填项,不能为空</p></div>
+              content: <div><p>1、费用承担方至少有一个</p><p>2、带星号的列为必填项,不能为空</p></div>,
+              centered: true
             })
             return
           }
           if (cdfList[0] == 3) {
             this.$warning({
               title: '提示',
-              content: '请检查每行承担人员是否已经选择'
+              content: '请检查每行承担人员是否已经选择',
+              centered: true
             })
             return
           }
           if (cdfList[0] == 2) {
             this.$warning({
               title: '提示',
-              content: '请检查每行人员平摊费用合计是否等于承担金额'
+              content: '请检查每行人员平摊费用合计是否等于承担金额',
+              centered: true
             })
             return
           }
@@ -273,6 +275,10 @@ export default {
           form.citySn = form.citySn ? form.citySn : ''
           form.cityName = form.cityName ? form.cityName : ''
           form.expense = Math.abs(form.expense)
+          // 不是数组
+          if (!Array.isArray(form.subareaSnList)) {
+            form.subareaSnList = [form.subareaSnList]
+          }
           console.log(form)
           delete form.subareaNames
           delete form.subareaSns

+ 22 - 7
src/views/expenseManagement/expenseReimbursement/list.vue

@@ -17,13 +17,13 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="费用类型">
-                <v-select
-                  v-model="queryParam.expenseType"
-                  ref="expenseType"
+                <expenseType
                   id="salesManagementList-expenseType"
-                  code="EXPENSE_TYPE"
+                  :changeOnSelect="true"
+                  v-model="expenseTypes"
+                  @change="expenseChange"
                   placeholder="请选择费用类型"
-                  allowClear></v-select>
+                ></expenseType>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
@@ -93,6 +93,10 @@
         <template slot="totalQty" slot-scope="text, record">
           {{ record.totalQty }}
         </template>
+        <!-- 费用类型 -->
+        <template slot="expenseType" slot-scope="text, record">
+          <div>{{ record.expenseTypeName || '--' }}<span v-if="record.expenseType2">/{{ record.expenseTypeName2 || '--' }}</span></div>
+        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -150,12 +154,13 @@ import subarea from '@/views/common/subarea.js'
 import employee from './employee.js'
 import { STable, VSelect } from '@/components'
 import verifyModal from './verifyModal.vue'
+import expenseType from '@/views/common/expenseType.js'
 import { expenseAccountList, expenseAccountDelete, expenseAccountAgainEdit } from '@/api/expenseManagement'
 import baseDataModal from './baseDataModal.vue'
 export default {
   name: 'ExpenseReimbursementList',
   mixins: [commonMixin],
-  components: { STable, VSelect, subarea, verifyModal, baseDataModal, employee },
+  components: { STable, VSelect, subarea, verifyModal, baseDataModal, employee, expenseType },
   data () {
     return {
       locale,
@@ -166,12 +171,14 @@ export default {
       openBaseModal: false, // 基础信息新建
       itemSn: '', // 费用单sn
       tableHeight: 0,
+      expenseTypes: [],
       // 查询参数
       queryParam: {
         expenseDate: moment().format('YYYY-MM'), // 月份
         expenseAccountNo: '', // 费用单号
         title: '', //  主题
         expenseType: undefined, // 费用类型
+        expenseType2: undefined, // 费用类型2
         state: undefined // 状态
       },
       // 加载数据方法 必须为 Promise 对象
@@ -202,7 +209,7 @@ export default {
         { title: '费用单号', width: '12%', align: 'center', scopedSlots: { customRender: 'expenseAccountNo' } },
         { title: '申请人', dataIndex: 'applyPersonName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '申请部门', dataIndex: 'applyDepartmentName', width: '8%', align: 'left', customRender: function (text) { return text || '--' } },
-        { title: '费用类型', dataIndex: 'expenseTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '费用类型', scopedSlots: { customRender: 'expenseType' }, width: '6%', align: 'center' },
         { title: '费用发生月份', dataIndex: 'expenseDate', width: '6%', align: 'center', customRender: function (text) { return moment(text).format('YYYY年MM月') || '--' } },
         { title: '主题', dataIndex: 'title', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '合计金额', dataIndex: 'applyExpenseTotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -219,6 +226,12 @@ export default {
     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] : ''
+    },
     // 详情
     handleDetail (row) {
       this.$router.push({ name: 'expenseReimbursementListDetail', params: { sn: row.expenseAccountSn } })
@@ -285,9 +298,11 @@ export default {
         expenseAccountNo: '', // 费用单号
         title: '', //  主题
         expenseType: undefined, // 费用类型
+        expenseType2: undefined, // 费用类型2
         state: undefined, // 状态
         applyPersonSn: undefined
       }
+      this.expenseTypes = []
       this.$refs.table.refresh(true)
     },
     pageInit () {

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

@@ -165,13 +165,21 @@ export default {
       console.log(val, id, options)
       const index = id.split('-')[1]
       const row = this.dataList[index]
-      row.productTypeSn1 = val[0] ? val[0] : ''
-      row.productTypeSn2 = val[1] ? val[1] : ''
-      row.productTypeSn3 = val[2] ? val[2] : ''
-      if (options) {
-        row.productTypeName1 = options[0] ? options[0].productTypeName : ''
-        row.productTypeName2 = options[1] ? options[1].productTypeName : ''
-        row.productTypeName3 = options[2] ? options[2].productTypeName : ''
+      if (val.length > 1) {
+        row.productTypeSn1 = val[0] ? val[0] : ''
+        row.productTypeSn2 = val[1] ? val[1] : ''
+        row.productTypeSn3 = val[2] ? val[2] : ''
+        if (options) {
+          row.productTypeName1 = options[0] ? options[0].productTypeName : ''
+          row.productTypeName2 = options[1] ? options[1].productTypeName : ''
+          row.productTypeName3 = options[2] ? options[2].productTypeName : ''
+        }
+      } else if (val.length == 1) {
+        this.$set(row, 'productType', [])
+        this.$nextTick(() => {
+          this.$refs['productType-' + row.no].setDefValue([])
+        })
+        this.$message.info('不能只选择一级分类')
       }
     },
     // 添加
@@ -256,6 +264,7 @@ export default {
     },
     // 查询详情
     getDetail () {
+      this.spinning = true
       expenseAcctDetailFindProductsBySn({ detailSn: this.expenseAccountDetailSn }).then(res => {
         if (res.data && res.data.length) {
           this.dataList = res.data
@@ -291,6 +300,7 @@ export default {
             'productTypeSn3': ''
           }]
         }
+        this.spinning = false
       })
     }
   },

+ 22 - 9
src/views/expenseManagement/expenseReimbursementDetail/list.vue

@@ -28,13 +28,13 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="费用类型">
-                  <v-select
-                    v-model="queryParam.expenseType"
-                    ref="expenseType"
+                  <expenseType
                     id="expenseReimbursementDetailList-expenseType"
-                    code="EXPENSE_TYPE"
+                    v-model="expenseTypes"
+                    :changeOnSelect="true"
+                    @change="expenseChange"
                     placeholder="请选择费用类型"
-                    allowClear></v-select>
+                  ></expenseType>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -168,7 +168,7 @@
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ y: tableHeight,x:2010 }"
+        :scroll="{ y: tableHeight,x:2250 }"
         :defaultLoadData="false"
         bordered>
       </s-table>
@@ -189,13 +189,14 @@ import department from '../expenseReimbursement/department.js'
 import employee from '../expenseReimbursement/employee.js'
 import custList from '@/views/common/custList.vue'
 import supplier from '@/views/common/supplier.js'
+import expenseType from '@/views/common/expenseType.js'
 import { expenseAccountDetailList, expenseAcctDetailReport, expenseAccountDetailCount } from '@/api/expenseManagement'
 import { hdExportExcel } from '@/libs/exportExcel'
 moment.locale('zh-cn')
 export default {
   name: 'ExpenseReimbursementDetailList',
   mixins: [commonMixin],
-  components: { STable, VSelect, department, employee, subarea, rangeDate, Area, custList, supplier },
+  components: { STable, VSelect, department, employee, subarea, rangeDate, Area, custList, supplier, expenseType },
   data () {
     return {
       spinning: false,
@@ -209,6 +210,7 @@ export default {
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ],
       countData: null,
+      expenseTypes: [],
       // 查询参数
       queryParam: {
         expenseDate: undefined, // 月份
@@ -218,6 +220,7 @@ export default {
         applyPersonSn: undefined, // 申请人
         applyDepartmentSn: undefined, // 申请部门
         expenseType: undefined, //  费用类型
+        xpenseType2: undefined, //  费用类型
         accountType: undefined, // 记账类型
         accountNameSn: undefined, // 记账名称
         splitObjType: undefined, // 费用承担方类型
@@ -262,9 +265,11 @@ export default {
         { title: '费用单号', dataIndex: 'expenseAccountNo', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '申请人', dataIndex: 'applyPersonName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '申请部门', dataIndex: 'applyDepartmentName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '费用类型', dataIndex: 'expenseTypeDictValue', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '费用类型(一级)', dataIndex: 'expenseTypeName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '费用类型(二级)', dataIndex: 'expenseTypeName2', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '费用发生月份', dataIndex: 'expenseDate', width: 90, align: 'center', customRender: function (text) { return moment(text).format('YYYY年MM月') || '--' } },
         { title: '主题', dataIndex: 'title', align: 'center', width: 150, customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '详细说明', dataIndex: 'content', align: 'center', width: 150, customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '记账类型', dataIndex: 'accountTypeDictValue', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '记账名称', dataIndex: 'accountName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '财务编码', dataIndex: 'accountNameFnumber', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
@@ -289,6 +294,12 @@ export default {
     onChange (date, dateString) {
       this.queryParam.expenseDate = dateString
     },
+    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] : ''
+    },
     custChange (val) {
       this.queryParam.splitObjSn = val.key
     },
@@ -345,6 +356,7 @@ export default {
         applyPersonSn: undefined, // 申请人
         applyDepartmentSn: undefined, // 申请部门
         expenseType: undefined, //  费用类型
+        expenseType2: undefined, //  费用类型2
         accountType: undefined, // 记账类型
         accountNameSn: undefined, // 记账名称
         splitObjType: undefined, // 费用承担方类型
@@ -356,6 +368,7 @@ export default {
         provinceSn: undefined,
         citySn: undefined
       }
+      this.expenseTypes = []
       this.$refs.table.refresh(true)
     },
     pageInit () {
@@ -366,7 +379,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 195
+      this.tableHeight = window.innerHeight - tableSearchH - 215
     }
   },
   watch: {

+ 1 - 1
src/views/productManagement/shelfNoManage/changeRecordModal.vue

@@ -7,7 +7,7 @@
     v-model="isShow"
     @cancel="isShow=false"
     width="50%">
-    <a-descriptions size="small" :column="2">
+    <a-descriptions size="small" :column="1">
       <a-descriptions-item label="产品编码">
         {{ detailData&&detailData.productVO.code || '--' }}
       </a-descriptions-item>

+ 1 - 1
src/views/productManagement/shelfNoManage/editHwModal.vue

@@ -19,7 +19,7 @@
         <a-form-model-item label="产品编码">{{ nowData&&nowData.productVO.code || '--' }}</a-form-model-item>
         <a-form-model-item label="产品名称">{{ nowData&&nowData.productVO.name || '--' }}</a-form-model-item>
         <a-form-model-item label="货位编号" prop="stackPlaceCode">
-          <a-input v-model="form.stackPlaceCode" placeholder="请输入货位编号(最多10个字符)"></a-input>
+          <a-input v-model="form.stackPlaceCode" :maxlength="10" placeholder="请输入货位编号(最多10个字符)"></a-input>
         </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">