Parcourir la source

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

lilei il y a 3 mois
Parent
commit
abd9142bd8

+ 234 - 2
src/views/dealerManagement/dealerAccount/checkAccountModal.vue

@@ -1,8 +1,240 @@
 <template>
+  <a-modal
+    centered
+    class="costAdd-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="调账"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="700">
+    <div>
+      <a-spin :spinning="spinning" tip="Loading...">
+        <a-form-model
+          id="costAddModal-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-form-model-item label="客户名称" prop="dealerSn" v-if="form.defaultFlag==0">
+            嘀嘀嘀嘀嘀嘀
+          </a-form-model-item>
+          <a-form-model-item label="调账金额" prop="ruleValue1">
+            <a-input-number
+              id="costAddModal-ruleValue1"
+              v-model="form.ruleValue1"
+              style="width:90%;"
+              :max="99999999"
+              :precision="2"
+              placeholder="请输入调账金额"/>
+            <span style="margin-left:10px;">元</span>
+          </a-form-model-item>
+          <a-row :gutter="16">
+            <a-col :span="10">
+              <a-form-model-item label="调账前" prop="ruleValue1" :label-col="{span:10}" :wrapper-col="{ span: 10}">
+                1111111
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-model-item label="调账后" prop="ruleValue1" :label-col="{span:10}" :wrapper-col="{ span: 10}">
+                222222
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-form-model-item label="备注" prop="ruleValue1">
+            <a-input v-model="form.desc" style="width:90%;" :maxLength="50" type="textarea" placeholder="请输入备注(最多50字符)"/>
+          </a-form-model-item>
+        </a-form-model>
+        <div class="btn-cont">
+          <a-button type="primary" id="costAddModal-save" @click="handleSave">提交</a-button>
+          <a-button id="costAddModal-cancel" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+        </div>
+      </a-spin>
+    </div>
+    <!-- 提交  选择审批人员 -->
+    <chooseDepartUserModal :openModal="openDepartUserModal" @close="openDepartUserModal=false" @submit="handleSubmit"></chooseDepartUserModal>
+  </a-modal>
 </template>
 
 <script>
+// 组件
+import chooseDepartUserModal from './chooseDepartUserModal.vue'
+// 接口
+import { getSubsidyRuleList, createSubsidyRule } from '@/api/subsidyRule'
+export default {
+  name: 'CostAddModal',
+  components: { chooseDepartUserModal },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    pageType: { //  页面类型
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false, // 页面加载状态
+      formItemLayout: {// form表单中label设置
+        labelCol: { span: 4 },
+        wrapperCol: { span: 18 }
+      },
+      // 提交数据
+      form: {
+        defaultFlag: 0, // 0指定客户  1默认
+        dealerSn: undefined, // 客户名称
+        ruleValue1: undefined, // 服务费比例
+        ruleType: undefined, // 弹窗类型
+        effectType: undefined// 生效方式
+      },
+      // 必填项判断
+      rules: {
+        dealerSn: [{ required: true, message: '请选择客户名称', trigger: 'change' }],
+        ruleValue1: [{ required: true, message: '请输入服务费比例', trigger: 'blur' }],
+        effectType: [{ required: true, message: '请选择生效方式', trigger: 'change' }]
+      },
+      openDepartUserModal: false // 打开 选择审批人员 弹窗
+    }
+  },
+  methods: {
+    // 客户名称 change
+    custChange (val) {
+      if (val && val.key) {
+        this.form.dealerSn = val.key
+        this.getHistoryData({ dealerSn: val.key, subsidyQueryStatus: 'NOT_FINISH', ruleType: this.pageType })
+      } else {
+        this.feeDataList = null
+      }
+    },
+    // 0指定客户  1默认客户  change
+    defaultChange (e) {
+      this.form.defaultChange = e.target.value
+      if (e.target.value == '1') {
+        this.getHistoryData({ defaultFlag: 1, subsidyQueryStatus: 'NOT_FINISH', ruleType: this.pageType })
+      } else {
+        this.feeDataList = null
+      }
+    },
+    handleSubmit () {
+
+    },
+    // 获取当月/次月  历史数据值
+    getHistoryData (ajaxData) {
+      this.spinning = true
+      getSubsidyRuleList(ajaxData).then(res => {
+        if (res.status == 200) {
+          this.feeDataList = res.data
+        } else {
+          this.feeDataList = null
+        }
+        this.spinning = false
+      })
+    },
+    // 保存
+    handleSave () {
+      const _this = this
+      _this.openDepartUserModal = true
+      // this.$refs.ruleForm.validate(valid => {
+      //   if (valid) {
+      //     _this.form.ruleType = _this.pageType
+      //     _this.spinning = true
+      //     subsidyRuleSave(this.form).then(res => {
+      //       if (res.status == 200) {
+      //         if (!res.data) {
+      //           this.isShow = false
+      //           this.$message.success(res.message)
+      //           this.$emit('ok')
+      //         } else {
+      //           _this.openTip(res.data)
+      //         }
+      //       }
+      //       this.spinning = false
+      //     })
+      //   } else {
+      //     console.log('error submit!!')
+      //     return false
+      //   }
+      // })
+    },
+    openTip (code) {
+      const _this = this
+      if (code === 'IN_USE') {
+        this.$confirm({
+          title: '提示',
+          content: '将重新生成新的' + (_this.pageType === 'SERVICE_FEE' ? '服务费比例' : '运费补贴') + ',并结束当前' + (_this.pageType === 'SERVICE_FEE' ? '服务费比例。' : '运费补贴。'),
+          centered: true,
+          onOk () {
+            createSubsidyRule(_this.form).then(res => {
+              if (res.status == 200) {
+                _this.isShow = false
+                _this.$message.success(res.message)
+                _this.$emit('ok')
+              }
+            })
+          }
+        })
+      } else {
+        this.$info({
+          title: '提示',
+          content: '已存在【未开始】的' + (_this.pageType === 'SERVICE_FEE' ? '服务费比例' : '运费补贴'),
+          centered: true,
+          onOk () {
+            console.log('知道了')
+          }
+        })
+      }
+    },
+    // 重置
+    resetFormData () {
+      this.form.defaultFlag = 0
+      this.form.dealerSn = undefined
+      this.form.ruleValue1 = undefined
+      this.form.ruleType = undefined
+      this.form.effectType = undefined
+      if (this.form.defaultFlag == 0) {
+        this.$refs.dealerSubareaScopeList.resetForm()
+      }
+      this.feeDataList = null
+      this.$refs.ruleForm.resetFields()
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetFormData()
+      }
+    }
+  }
+}
 </script>
 
-<style>
-</style>
+<style lang="less">
+  .costAdd-modal{
+    .formList{
+      margin-left:42px;
+    }
+    .formBoxList{
+      div{
+        margin-bottom:5px;
+      }
+    }
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 30px;
+    }
+  }
+</style>

+ 183 - 3
src/views/dealerManagement/dealerAccount/checkRecordModal.vue

@@ -1,8 +1,188 @@
 <template>
+  <!-- 调账记录 -->
+  <a-drawer
+    :title="'调账记录'+titVal"
+    placement="right"
+    closable
+    :visible="isShow"
+    class="lookUpCustomers-modal"
+    @close="isShow=false"
+    width="75%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" id="dealerAccountNewList-form" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="申请日期" prop="time">
+                <rangeDate
+                  ref="rangeDate"
+                  :showTime="false"
+                  :today="false"
+                  :value="queryParam.time"
+                  id="tireSalesDealerList-time"
+                  @change="dateChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="入账类型">
+                <v-select
+                  v-model="queryParam.dealerLevel"
+                  ref="dealerLevel"
+                  id="tireSalesDealerList-dealerLevel"
+                  code="DEALER_LEVEL"
+                  placeholder="请选择入账类型"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="审核状态">
+                <v-select
+                  v-model="queryParam.dealerLevel"
+                  ref="dealerLevel"
+                  id="tireSalesDealerList-dealerLevel"
+                  code="DEALER_LEVEL"
+                  placeholder="请选择审核状态"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="dealerAccountNewList-refresh">查询</a-button>
+              <a-button style="margin:0 5px" @click="resetSearchForm" :disabled="disabled" id="dealerAccountNewList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+70+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :pageSize="30"
+        :scroll="{ y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <!-- 轮胎补贴金额 -->
+        <template slot="moneyNum" slot-scope="text, record">
+          <span v-if="$hasPermissions('B_salesDetail')" class="link-bule" @click="handleDetail(record)">111111111111</span>
+          <span v-else>111111111111</span>
+        </template>
+      </s-table>
+    </a-spin>
+    <!-- 审核进度 -->
+    <verifyModal v-drag :openModal="openVerifyModal" :itemId="itemId" :itemSn="itemSn" @close="openVerifyModal=false"></verifyModal>
+  </a-drawer>
 </template>
 
 <script>
-</script>
+import { commonMixin } from '@/utils/mixin'
+// 组件
+import { STable, VSelect } from '@/components'
+import chooseDealer from '@/views/dealerManagement/provincialWarehouseManagement/chooseDealer.vue'
+import { saveBatchDealerList } from '@/api/provinceServiceCenter'
+import rangeDate from '@/views/common/rangeDate.vue'
+import verifyModal from './verifyModal.vue'
+// 接口
+import { dealerUserList } from '@/api/dealer'
 
-<style>
-</style>
+export default {
+  name: 'AddDealerModal',
+  mixins: [commonMixin],
+  components: { STable, VSelect, chooseDealer, rangeDate, verifyModal },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      titVal: '(经销商名称)',
+      queryParam: { time: [], dealerLevel: '' },
+      openVerifyModal: true, // 审核进度弹窗
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '申请时间', dataIndex: 'dealerTypeName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '审核时间', dataIndex: 'dealerTypeName1', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '记账日期', dataIndex: 'dealerTypeName2', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入账类型', dataIndex: 'dealerTypeName3', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '金额(¥)', dataIndex: 'dealerLevelDictValue', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核状态', dataIndex: 'dealerTypeName4', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'moneyNum' }, width: '10%', align: 'center' },
+        { title: '备注', dataIndex: 'createDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return dealerUserList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            // 计算表格序号
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+          }
+          this.disabled = false
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    // 审核进度
+    handleDetail () {
+      this.openVerifyModal = true
+    },
+    //  日期选择  change
+    dateChange (date) {
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
+      this.queryParam.bizBeginDate = date[0] ? date[0].replace(/-/g, '') : ''
+      this.queryParam.bizEndDate = date[1] ? date[1].replace(/-/g, '') : ''
+    },
+    handleAddDealer (list) {
+      const newList = list.map(item => {
+        return {
+          dealerSn: item.dealerSn,
+          dealerName: item.dealerName,
+          dealerLevel: item.dealerLevel
+        }
+      })
+      this.spinning = true
+      saveBatchDealerList(newList).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+        }
+        this.spinning = false
+        this.$emit('ok')
+        this.isShow = false
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>

+ 185 - 0
src/views/dealerManagement/dealerAccount/chooseDepartUserModal.vue

@@ -0,0 +1,185 @@
+<template>
+  <a-modal
+    centered
+    class="departUser-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="选择审批人员"
+    v-model="isShow"
+    @cancel="cancel"
+    :width="700">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div>
+        <div class="departUser-con">
+          <a-form-model
+            id="departUser-form"
+            ref="ruleForm"
+            :model="form"
+            :rules="rules"
+            :label-col="formItemLayout.labelCol"
+            :wrapper-col="formItemLayout.wrapperCol">
+            <a-form-model-item label="申请人员" prop="applyPersonSn">
+              <employee style="width: 100%;" @change="employeeChange" id="departUser-Employee" v-model="form.applyPersonSn"></employee>
+            </a-form-model-item>
+            <a-form-model-item label="审批人员" prop="approvers">
+              <dingDepartUser
+                ref="departUserApp"
+                @loaded="uploading=false"
+                id="departUser-approvers"
+                :disabled="uploading"
+                v-model="form.approvers"
+                @change="changeApprovers"
+                allowClear
+                placeholder="请选择审批人员"
+              ></dingDepartUser>
+            </a-form-model-item>
+            <a-form-model-item label="抄送人" prop="ccList">
+              <dingDepartUser
+                ref="departUserCc"
+                @loaded="uploading=false"
+                :disabled="uploading"
+                id="departUser-ccList"
+                v-model="form.ccList"
+                allowClear
+                placeholder="请选择抄送人"
+              ></dingDepartUser>
+            </a-form-model-item>
+          </a-form-model>
+        </div>
+        <div class="btn-cont">
+          <a-button type="primary" id="departUser-save" @click="handleSave">确定</a-button>
+          <a-button :loading="uploading" style="margin-left: 15px;" @click="updateUser">刷新人员</a-button>
+          <a-button id="departUser-back" @click="cancel" style="margin-left: 15px;">取消</a-button>
+        </div>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { VSelect, Upload } from '@/components'
+import dingDepartUser from '@/views/common/dingDepartUser.js'
+import employee from '@/views/expenseManagement/expenseReimbursement/employee.js'
+import { sign } from 'core-js/fn/number'
+export default {
+  name: 'ChooseDepartUserModal',
+  components: { dingDepartUser, employee, VSelect, Upload },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      uploading: false,
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 16 }
+      },
+      form: {
+        applyPersonSn: undefined,
+        approvers: [], // 审批人
+        ccList: [] // 抄送人
+      },
+      rules: {
+        applyPersonSn: [
+          { required: true, message: '请选择申请人员', trigger: 'change' }
+        ],
+        approvers: [
+          { required: true, type: 'array', message: '请选择审批人员', trigger: 'change' }
+        ]
+      }
+    }
+  },
+  methods: {
+    // 申请人员
+    employeeChange (v, r) {
+      this.$nextTick(() => {
+        this.$refs.ruleForm.validateField(['applyPersonSn'])
+      })
+    },
+    updateUser () {
+      this.uploading = true
+      this.$refs.departUserApp.updateDeptUser()
+      this.$refs.departUserCc.updateDeptUser()
+    },
+    changeApprovers (value) {
+      this.form.approvers = value
+      this.$refs.ruleForm.clearValidate()
+    },
+    getTreeVal (data) {
+      const ret = []
+      data.map(item => {
+        ret.push(item.value)
+      })
+      return ret.join(',')
+    },
+    // 确定
+    handleSave (e) {
+      e.preventDefault()
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          if (form.approvers) {
+            form.approvers = this.getTreeVal(form.approvers)
+          }
+          if (form.ccList) {
+            form.ccList = this.getTreeVal(form.ccList)
+          }
+          this.$emit('submit', form)
+          this.$emit('close')
+        } else {
+          return false
+        }
+      })
+    },
+    getDetail (data) {
+      this.form = Object.assign(this.form, {
+        applyPersonSn: data.applyPersonSn
+      })
+    },
+    resetForm () {
+      this.$nextTick(() => {
+        this.$refs.ruleForm.resetFields()
+      })
+      this.form = {
+        applyPersonSn: undefined,
+        ccList: undefined,
+        approvers: undefined
+      }
+    },
+    cancel () {
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetForm()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .departUser-modal{
+    .ant-modal-body {
+      padding: 30px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 16 - 7
src/views/dealerManagement/dealerAccount/detail.vue

@@ -7,8 +7,8 @@
           <template slot="subTitle">
             <a id="salesEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
             <span class="subTitle-word text-overflow" style="margin:0 15px;">轮胎补贴金额(箭冠汽配东莞店):<span style="font-size:20px;">11212121</span></span>
-            <a-button type="danger" style="margin-right:15px;" ghost id="settingsIndex-addArea">调账</a-button>
-            <a-button type="primary" class="button-info" ghost id="settingsIndex-addArea">调整记录</a-button>
+            <a-button type="danger" style="margin-right:15px;" ghost id="settingsIndex-addArea" @click="openCheckAccountModal=true">调账</a-button>
+            <a-button type="primary" class="button-info" ghost id="settingsIndex-addArea" @click="openCheckRecordModal=true">调整记录</a-button>
           </template>
         </a-page-header>
       </div>
@@ -68,12 +68,17 @@
           :columns="columns"
           :data="loadData"
           :defaultLoadData="false"
-          :style="{ height: tableHeight+70+'px' }"
-          :scroll="{ y: tableHeight }"
+          :pageSize="30"
+          :style="{ height: tableHeight+60+'px' }"
+          :scroll="{ y: tableHeight-10 }"
           bordered>
         </s-table>
       </a-card>
-    </a-spin>
+    </a-spin>
+    <!-- 调账 -->
+    <check-account-modal v-drag :openModal="openCheckAccountModal" @ok="$refs.table.refresh(true)" @close="openCheckAccountModal = false" />
+    <!-- 调账记录 -->
+    <check-record-modal v-drag :openModal="openCheckRecordModal" @ok="$refs.table.refresh(true)" @close="openCheckRecordModal = false" />
   </div>
 </template>
 
@@ -82,17 +87,21 @@ import { commonMixin } from '@/utils/mixin'
 // 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
+import checkAccountModal from './checkAccountModal.vue'
+import checkRecordModal from './checkRecordModal.vue'
 // 接口
 import { queryDealerScopePage, bizuserScopeDelete, findById, queryAreaScope, queryDealerScope, saveAreaScope, saveDealerScope } from '@/api/bizuser'
 export default {
   name: 'SettingsIndex',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect, rangeDate, checkAccountModal, checkRecordModal },
   data () {
     return {
       spinning: false,
       tableHeight: 0, // 表格高度
       disabled: false, //  查询、重置按钮是否可操作
+      openCheckAccountModal: false, // 打开调账弹窗
+      openCheckRecordModal: false, // 打开调账记录弹窗
       // 查询参数
       queryParam: {
         hasDetail: 0,
@@ -302,7 +311,7 @@ export default {
     setTableH () {
       console.log('1111:', this.$refs)
       const searchHeight = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - searchHeight - 340
+      this.tableHeight = window.innerHeight - searchHeight - 240
     }
   },
   watch: {

+ 102 - 0
src/views/dealerManagement/dealerAccount/verifyModal.vue

@@ -0,0 +1,102 @@
+<template>
+  <a-modal
+    centered
+    :footer="null"
+    :maskClosable="false"
+    title="费用报销单审核进度"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="50%">
+    <p>说明:以下信息来自钉钉</p>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: 500 }"
+        :showPagination="false"
+        :defaultLoadData="false"
+        bordered>
+      </s-table>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { STable } from '@/components'
+import { getProcessInstance } from '@/api/expenseManagement'
+export default {
+  name: 'VerifyModal',
+  components: { STable },
+  props: {
+    openModal: {
+      type: Boolean,
+      default: false
+    },
+    itemSn: { // 费用单sn
+      type: [Number, String],
+      default: ''
+    },
+    itemId: {// 费用单id
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal,
+      columns: [{ title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
+        { title: '人员姓名', width: '12%', dataIndex: 'approvalName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '人员类型', dataIndex: 'processTaskType', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'approvalStateDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审批意见', dataIndex: 'approvalOpinion', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '附件', dataIndex: 'attachmentNames', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作时间', dataIndex: 'approvalTime', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        delete parameter.tableId
+        delete parameter.index
+        return getProcessInstance({ businessType: 'EXPENSES', businessSn: this.itemSn }).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data ? res.data[0] ? res.data[0].opinionList ? res.data[0].opinionList : [] : [] : []
+            const no = 0
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  watch: {
+    openModal (nVal, oVal) {
+      this.isShow = nVal
+    },
+    isShow (nVal, oVal) {
+      if (!nVal) {
+        this.$emit('close')
+        this.$refs.table.clearTable()
+      } else {
+        this.$nextTick(() => {
+          this.$refs.table.refresh()
+        })
+      }
+    },
+    itemSn (nVal, oVal) {
+
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 10 - 11
src/views/setting/tireSubsidySetting/addSubsidyList.vue

@@ -66,7 +66,7 @@
           :style="{ height: tableHeight+70+'px' }"
           :columns="columns"
           :data="loadData"
-          :scroll="{ y: tableHeight-120}"
+          :scroll="{ y: tableHeight}"
           :defaultLoadData="false"
           bordered>
           <!-- 客户名称 -->
@@ -277,10 +277,9 @@ export default {
     isSameQuarter (inputVal) {
       const currentDate = new Date()
       const quarterNum = this.getYearAndQuarter(currentDate).quarter
-      // 根据正则匹配字符串中季度值
-      const inputQuarter = parseInt(inputVal.match(/(\d)季度/), 10)
-      console.log('季度值:', quarterNum, inputQuarter)
-      return quarterNum === inputQuarter
+      const yearNum = currentDate.getFullYear()
+      const fullWord = yearNum + '年' + quarterNum + '季度'
+      return fullWord === inputVal
     },
     // 新增
     handleAdd () {
@@ -324,12 +323,12 @@ export default {
         dealerName: row.dealerEntity && row.dealerEntity.dealerName ? row.dealerEntity.dealerName : undefined,
         defaultFlag: row.defaultFlag,
         ruleSn: row.ruleSn,
-        ruleTarget1: row.ruleTarget1,
-        ruleValue1: row.ruleValue1,
-        ruleTarget2: row.ruleTarget2,
-        ruleValue2: row.ruleValue2,
-        ruleTarget3: row.ruleTarget3,
-        ruleValue3: row.ruleValue3
+        ruleTarget1: row.ruleTarget1 || undefined,
+        ruleValue1: row.ruleValue1 || undefined,
+        ruleTarget2: row.ruleTarget2 || undefined,
+        ruleValue2: row.ruleValue2 || undefined,
+        ruleTarget3: row.ruleTarget3 || undefined,
+        ruleValue3: row.ruleValue3 || undefined
       }
       this.$refs.editSubsidyModal.getFormData(sendData)
       this.openEditSubsidyModal = true

+ 33 - 23
src/views/setting/tireSubsidySetting/addSubsidyModal.vue

@@ -37,7 +37,7 @@
                 v-model="form.ruleTarget1"
                 :min="1"
                 style="width:80px;margin:0 6px;"
-                :max="99999999"
+                :max="999999"
                 id="addSubsidyModal-ruleTarget1"
                 :precision="0"
                 placeholder="请输入"/>条,每条补贴
@@ -46,43 +46,43 @@
                 :min="0.01"
                 id="addSubsidyModal-ruleValue1"
                 style="width:80px;margin:0 6px;"
-                :max="99999999"
+                :max="999999"
                 :precision="2"
                 placeholder="请输入"/>元
             </div>
             <div>
               大于等于<a-input-number
                 v-model="form.ruleTarget2"
-                :min="form.ruleTarget1*1+1"
+                :min="form.ruleTarget1"
                 style="width:80px;margin:0 6px;"
-                :max="99999999"
+                :max="999999"
                 id="addSubsidyModal-ruleTarget2"
                 :precision="0"
                 placeholder="请输入"/>条,每条补贴
               <a-input-number
                 v-model="form.ruleValue2"
-                :min="form.ruleValue1*1+0.01"
+                :min="form.ruleValue1"
                 id="addSubsidyModal-ruleValue2"
                 style="width:80px;margin:0 6px;"
-                :max="99999999"
+                :max="999999"
                 :precision="2"
                 placeholder="请输入"/>元
             </div>
             <div>
               大于等于<a-input-number
                 v-model="form.ruleTarget3"
-                :min="form.ruleTarget2*1+1"
+                :min="form.ruleTarget2"
                 style="width:80px;margin:0 6px;"
-                :max="99999999"
+                :max="999999"
                 id="addSubsidyModal-ruleTarget3"
                 :precision="0"
                 placeholder="请输入"/>条,每条补贴
               <a-input-number
                 v-model="form.ruleValue3"
-                :min="form.ruleValue2*1+0.01"
+                :min="form.ruleValue2"
                 id="addSubsidyModal-ruleValue3"
                 style="width:80px;margin:0 6px;"
-                :max="99999999"
+                :max="999999"
                 :precision="2"
                 placeholder="请输入"/>元
             </div>
@@ -166,6 +166,7 @@ export default {
     // 0指定客户  1默认客户  change
     defaultChange (e) {
       this.form.defaultFlag = e.target.value
+      this.form.dealerSn = undefined
       if (e.target.value == '1') {
         this.getHistoryData({ defaultFlag: 1, subsidyQueryStatus: 'NOT_FINISH', ruleType: this.pageType })
       } else {
@@ -195,7 +196,7 @@ export default {
           delete newForm.dealerSn
           const flag = _this.isValid(newForm)
           if (!flag) {
-            _this.$message.error('季度增量补贴【条数】与【补贴】不能为空!')
+            _this.$message.error('季度增量补贴【条数】与【补贴】不符合填写规则!')
             return
           }
 
@@ -221,21 +222,30 @@ export default {
     },
     // 为空判断
     isValid (obj) {
-      // 检查阶梯1是否有值
-      const hasStep1 = obj.ruleTarget1 && obj.ruleValue1
-      // 检查阶梯2是否有值
-      const hasStep2 = obj.ruleTarget2 && obj.ruleValue2
-      // 检查阶梯3是否有值
-      const hasStep3 = obj.ruleTarget3 && obj.ruleValue3
-      // 情况1: 阶梯1必须有值
-      if (!hasStep1) {
+      const { ruleTarget1, ruleValue1, ruleTarget2, ruleValue2, ruleTarget3, ruleValue3 } = obj
+
+      // 检查第一阶梯是否填写
+      if (ruleTarget1 === undefined || ruleValue1 === undefined || typeof ruleValue1 !== 'number') {
         return false
       }
-      // 情况2: 如果阶梯3有值,阶梯1和阶梯2都不能为空
-      if (hasStep3 && (!hasStep1 || !hasStep2)) {
-        return false
+
+      // 如果第三阶梯存在,检查第二阶梯是否存在以及值是否正确
+      if (ruleTarget3 !== undefined || ruleValue3 !== undefined) {
+        if (ruleTarget2 === undefined || ruleValue2 === undefined || typeof ruleValue2 !== 'number') {
+          return false
+        }
+        if (ruleValue1 >= ruleValue2 || (ruleValue3 !== undefined && ruleValue2 >= ruleValue3) || ruleTarget1 >= ruleTarget2 || (ruleTarget3 !== undefined && ruleTarget2 >= ruleTarget3)) {
+          return false
+        }
+      }
+
+      // 如果只有第二阶梯存在(没有第三阶梯),检查值是否正确
+      if (ruleTarget2 !== undefined && ruleValue2 !== undefined && (ruleTarget3 === undefined && ruleValue3 === undefined)) {
+        if (ruleValue1 >= ruleValue2 || ruleTarget1 >= ruleTarget2) {
+          return false
+        }
       }
-      // 如果以上条件都满足,返回true
+      // 所有条件都满足,返回true
       return true
     },
     openTip (code) {

+ 10 - 7
src/views/setting/tireSubsidySetting/costAddModal.vue

@@ -35,9 +35,9 @@
             <a-input-number
               id="costAddModal-ruleValue1"
               v-model="form.ruleValue1"
-              :min="0.01"
+              :min="0"
               style="width:90%;"
-              :max="pageType==='SERVICE_FEE'?100:99999999"
+              :max="pageType==='SERVICE_FEE'?100:99"
               :precision="2"
               :placeholder="'请输入'+(pageType==='SERVICE_FEE'?'服务费比例':'运费补贴')"/>
             <span style="margin-left:10px;">{{ pageType==='SERVICE_FEE'?'%':'元' }}</span>
@@ -53,7 +53,7 @@
             </a-radio-group>
           </a-form-model-item>
           <div class="formList formBoxList" v-if="feeDataList&&feeDataList.length>0">
-            <div v-for="item in feeDataList" :key="item.id">{{ item.effectType==1?'当前':'次月' }}{{ pageType==='SERVICE_FEE'?'服务费比例':'运费补贴' }}:{{ item.ruleValue1 }}{{ pageType==='SERVICE_FEE'?'%':'元' }};</div>
+            <div v-for="item in feeDataList" :key="item.id">{{ item.effectType==1?'当前':'次月' }}{{ pageType==='SERVICE_FEE'?'服务费比例':'运费补贴' }}:{{ item.ruleValue1 }}{{ pageType==='SERVICE_FEE'?'%':'元' }}</div>
           </div>
         </a-form-model>
         <div class="btn-cont">
@@ -122,6 +122,7 @@ export default {
     // 0指定客户  1默认客户  change
     defaultChange (e) {
       this.form.defaultChange = e.target.value
+      this.form.dealerSn = undefined
       if (e.target.value == '1') {
         this.getHistoryData({ defaultFlag: 1, subsidyQueryStatus: 'NOT_FINISH', ruleType: this.pageType })
       } else {
@@ -150,14 +151,16 @@ export default {
           subsidyRuleSave(this.form).then(res => {
             if (res.status == 200) {
               if (!res.data) {
-                this.isShow = false
-                this.$message.success(res.message)
-                this.$emit('ok')
+                _this.isShow = false
+                _this.$message.success(res.message)
+                _this.$emit('ok')
               } else {
                 _this.openTip(res.data)
               }
             }
-            this.spinning = false
+            _this.spinning = false
+          }).catch(err => {
+            _this.spinning = false
           })
         } else {
           console.log('error submit!!')

+ 11 - 11
src/views/setting/tireSubsidySetting/costCollectionList.vue

@@ -66,7 +66,7 @@
           :style="{ height: tableHeight+70+'px' }"
           :columns="columns"
           :data="loadData"
-          :scroll="{ y: tableHeight-120}"
+          :scroll="{ y: tableHeight}"
           :defaultLoadData="false"
           bordered>
           <!-- 客户名称 -->
@@ -170,8 +170,8 @@ export default {
         provinceSn: undefined, // 省
         citySn: undefined, // 市
         districtSn: undefined, // 区
-        ruleType: undefined,//页面类型
-        subsidyQueryStatus: 'NOT_FINISH'//状态默认值
+        ruleType: undefined, // 页面类型
+        subsidyQueryStatus: 'NOT_FINISH'// 状态默认值
       },
       totalData: null, // 合计
       rules: {
@@ -212,18 +212,18 @@ export default {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '区域', dataIndex: 'subareaArea.subareaName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'dealerEntity.dealerName', width: '14%', align: 'center', scopedSlots: { customRender: 'customName' }, ellipsis: true },
-        { title: '开始时间', dataIndex: 'ruleStartDate', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '结束时间', dataIndex: 'ruleEndDate', width: '14%', align: 'center', scopedSlots: { customRender: 'endDate' } },
-        { title: '状态', dataIndex: 'statusDictValue', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '区域', dataIndex: 'subareaArea.subareaName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealerEntity.dealerName', width: '20%', align: 'left', scopedSlots: { customRender: 'customName' }, ellipsis: true },
+        { title: '开始时间', dataIndex: 'ruleStartDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '结束时间', dataIndex: 'ruleEndDate', width: '12%', align: 'center', scopedSlots: { customRender: 'endDate' } },
+        { title: '状态', dataIndex: 'statusDictValue', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
       if (this.pageType === 'SERVICE_FEE') {
-        arr.splice(7, 0, { title: '服务费比例(%)', dataIndex: 'ruleValue1', width: '14%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(7, 0, { title: '服务费比例(%)', dataIndex: 'ruleValue1', width: '12%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       } else {
-        arr.splice(7, 0, { title: '运费补贴(元)', dataIndex: 'ruleValue1', width: '14%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(7, 0, { title: '运费补贴(元)', dataIndex: 'ruleValue1', width: '12%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }

+ 35 - 24
src/views/setting/tireSubsidySetting/editModal.vue

@@ -29,9 +29,9 @@
               <a-input-number
                 id="editTireSettingModal-ruleValue1"
                 v-model="form.ruleValue1"
-                :min="0.01"
+                :min="0"
                 style="width:90%;"
-                :max="pageType==='SERVICE_FEE'?100:99999999"
+                :max="pageType==='SERVICE_FEE'?100:99"
                 :precision="2"
                 :placeholder="'请输入'+(pageType==='SERVICE_FEE'?'服务费比例':'运费补贴')"/>
               <span style="margin-left:10px;">{{ pageType==='SERVICE_FEE'?'%':'元' }}</span>
@@ -53,43 +53,43 @@
                   :min="0.01"
                   id="addSubsidyModal-ruleValue1"
                   style="width:80px;margin:0 6px;"
-                  :max="99999999"
+                  :max="999999"
                   :precision="2"
                   placeholder="请输入"/>元
               </div>
               <div>
                 大于等于<a-input-number
                   v-model="form.ruleTarget2"
-                  :min="form.ruleTarget1*1+1"
+                  :min="form.ruleTarget1"
                   style="width:80px;margin:0 6px;"
-                  :max="99999999"
+                  :max="999999"
                   id="addSubsidyModal-ruleTarget2"
                   :precision="0"
                   placeholder="请输入"/>条,每条补贴
                 <a-input-number
                   v-model="form.ruleValue2"
-                  :min="form.ruleValue1*1+0.01"
+                  :min="form.ruleValue1"
                   id="addSubsidyModal-ruleValue2"
                   style="width:80px;margin:0 6px;"
-                  :max="99999999"
+                  :max="999999"
                   :precision="2"
                   placeholder="请输入"/>元
               </div>
               <div>
                 大于等于<a-input-number
                   v-model="form.ruleTarget3"
-                  :min="form.ruleTarget2*1+1"
+                  :min="form.ruleTarget2"
                   style="width:80px;margin:0 6px;"
-                  :max="99999999"
+                  :max="999999"
                   id="addSubsidyModal-ruleTarget3"
                   :precision="0"
                   placeholder="请输入"/>条,每条补贴
                 <a-input-number
                   v-model="form.ruleValue3"
-                  :min="form.ruleValue2*1+0.01"
+                  :min="form.ruleValue2"
                   id="addSubsidyModal-ruleValue3"
                   style="width:80px;margin:0 6px;"
-                  :max="99999999"
+                  :max="999999"
                   :precision="2"
                   placeholder="请输入"/>元
               </div>
@@ -163,7 +163,7 @@ export default {
             delete newForm.ruleStartDate
             const flag = _this.isValid(newForm)
             if (!flag) {
-              _this.$message.error('季度增量补贴【条数】与【补贴】不能为空!')
+              _this.$message.error('季度增量补贴【条数】与【补贴】不符合填写规则!')
               return
             }
           }
@@ -188,22 +188,32 @@ export default {
       })
     },
     // 为空判断
+    // 为空判断
     isValid (obj) {
-      // 检查阶梯1是否有值
-      const hasStep1 = obj.ruleTarget1 && obj.ruleValue1
-      // 检查阶梯2是否有值
-      const hasStep2 = obj.ruleTarget2 && obj.ruleValue2
-      // 检查阶梯3是否有值
-      const hasStep3 = obj.ruleTarget3 && obj.ruleValue3
-      // 情况1: 阶梯1必须有值
-      if (!hasStep1) {
+      const { ruleTarget1, ruleValue1, ruleTarget2, ruleValue2, ruleTarget3, ruleValue3 } = obj
+
+      // 检查第一阶梯是否填写
+      if (ruleTarget1 === undefined || ruleValue1 === undefined || typeof ruleValue1 !== 'number') {
         return false
       }
-      // 情况2: 如果阶梯3有值,阶梯1和阶梯2都不能为空
-      if (hasStep3 && (!hasStep1 || !hasStep2)) {
-        return false
+
+      // 如果第三阶梯存在,检查第二阶梯是否存在以及值是否正确
+      if (ruleTarget3 !== undefined || ruleValue3 !== undefined) {
+        if (ruleTarget2 === undefined || ruleValue2 === undefined || typeof ruleValue2 !== 'number') {
+          return false
+        }
+        if (ruleValue1 >= ruleValue2 || (ruleValue3 !== undefined && ruleValue2 >= ruleValue3) || ruleTarget1 >= ruleTarget2 || (ruleTarget3 !== undefined && ruleTarget2 >= ruleTarget3)) {
+          return false
+        }
+      }
+
+      // 如果只有第二阶梯存在(没有第三阶梯),检查值是否正确
+      if (ruleTarget2 !== undefined && ruleValue2 !== undefined && (ruleTarget3 === undefined && ruleValue3 === undefined)) {
+        if (ruleValue1 >= ruleValue2 || ruleTarget1 >= ruleTarget2) {
+          return false
+        }
       }
-      // 如果以上条件都满足,返回true
+      // 所有条件都满足,返回true
       return true
     },
     // 错误提示语
@@ -234,6 +244,7 @@ export default {
     },
     // 获取编辑数据
     getFormData (getData) {
+      console.log('111111111:', getData)
       this.form = getData
     }
   },