evaluate.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. <template>
  2. <div class="app-container">
  3. <div class="title-container">
  4. <breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
  5. </div>
  6. <y-page-list-layout :page-list="pageData" :page-para="listQuery" :get-page-list="assetsEvaluateDeclarePage">
  7. <template slot="left">
  8. <el-input v-model="listQuery.orderId" placeholder="订单号" clearable style="width: 200px;float: left;">
  9. </el-input>
  10. <el-input v-model="listQuery.name" placeholder="项目名称" clearable
  11. style="margin-left: 20px;width: 200px;float: left;">
  12. </el-input>
  13. <el-input v-model="listQuery.reportNo" placeholder="报告号" clearable
  14. style="margin-left: 20px;width: 200px;float: left;">
  15. </el-input>
  16. <el-select clearable v-model="listQuery.commissionRateId" placeholder="提成类型"
  17. style="margin-left: 20px;width: 200px;float: left;">
  18. <el-option v-for="(c, id) in cates" :value="c.id" :label="c.name">{{ c.name }}</el-option>
  19. </el-select>
  20. <!-- <el-select clearable v-model="listQuery.declareType" placeholder="申报类型"
  21. style="margin-left: 20px;width: 200px;float: left;">
  22. <el-option :value="true" label="产品">产品</el-option>
  23. <el-option :value="false" label="订单">订单</el-option>
  24. </el-select> -->
  25. <el-select clearable v-model="listQuery.declareResult" placeholder="审核状态"
  26. style="margin-left: 20px;width: 200px;float: left;">
  27. <el-option value="待申报" label="待申报"></el-option>
  28. <el-option value="审核中" label="审核中"></el-option>
  29. <el-option value="审核通过" label="审核通过"></el-option>
  30. <el-option value="审核拒绝" label="审核拒绝"></el-option>
  31. </el-select>
  32. <el-button class="filter-item" style="margin-left:20px;float: left;" type="primary" @click="searchList()"
  33. round>搜索
  34. </el-button>
  35. <el-button class="filter-item" style="float: left;" round type="success" @click="resetSearch()">重置
  36. </el-button>
  37. </template>
  38. <parentTable :data="pageData.records" slot="table" style="width: 100%;">
  39. <el-table-column label="订单号" width="150" align="center">
  40. <template slot-scope="{row}">
  41. <span>{{ row.orderId }}</span>
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="项目名称" width="150" align="center">
  45. <template slot-scope="{row}">
  46. <span>{{ row.name ? row.name : row.orderName }}</span>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="报告号" width="200" align="center">
  50. <template slot-scope="{row}">
  51. <span>{{ row.reportNo ? row.reportNo : '--' }}</span>
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="评估对象类别" align="center">
  55. <template slot-scope="{row}">
  56. <span>{{ row.businessObjectType }}</span>
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="委托人" align="center">
  60. <template slot-scope="{row}">
  61. <span>{{ row.bailor }}</span>
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="委托联系人" align="center">
  65. <template slot-scope="{row}">
  66. <span>{{ row.bailorContactName }}</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="委托人电话" width="150" align="center">
  70. <template slot-scope="{row}">
  71. <span>{{ row.bailorContactTel }}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="客户名称" align="center">
  75. <template slot-scope="{row}">
  76. <span>{{ row.clienteleName }}</span>
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="业务来源" align="center">
  80. <template slot-scope="{row}">
  81. <span>{{ row.clienteleSubName }}</span>
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="负责人" align="center">
  85. <template slot-scope="{row}">
  86. <span>{{ row.principal }}</span>
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="下单时间" align="center">
  90. <template slot-scope="{row}">
  91. <span>{{ row.orderCreated }}</span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column label="提成类型" width="150" align="center">
  95. <template slot-scope="{row}">
  96. <span style="color:red">{{ row.commissionType ? row.commissionType : '--' }}</span>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="申报类型" align="center">
  100. <template slot-scope="{row}">
  101. <span style="font-weight: bold;">{{ row.reportNo ? '产品' : '订单' }}</span>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="审核状态" align="center">
  105. <template slot-scope="{row}">
  106. <el-tag v-if="row.declareResult == null" type="info" effect="plain">待申报</el-tag>
  107. <el-tag v-else-if="row.declareResult == '审核中'" type="warning" effect="plain">审核中</el-tag>
  108. <el-tag v-else-if="row.declareResult == '审核通过'" type="success" effect="plain">通过</el-tag>
  109. <el-tag v-else-if="row.declareResult == '审核拒绝'" type="danger" effect="plain">拒绝</el-tag>
  110. </template>
  111. </el-table-column>
  112. <el-table-column fixed="right" label="操作" align="center">
  113. <template slot-scope="{row}">
  114. <div>
  115. <el-button v-if="row.declareResult == null || row.declareResult == '审核拒绝'" type="text"
  116. size="small" @click="openAssetsAchievementRatioDialog(row)">申报</el-button>
  117. <el-button
  118. v-if="row.declareResult == '审核中' || row.declareResult == '审核通过' || row.declareResult == '审核拒绝'"
  119. type="text" size="small" @click="checkDetail(row.id)">查看</el-button>
  120. </div>
  121. </template>
  122. </el-table-column>
  123. </parentTable>
  124. </y-page-list-layout>
  125. <el-dialog :visible.sync="assetsAchievementRatioDialogVisible" @closed="resetBusinessPerformanceDistributionForm()"
  126. width="40%">
  127. <div v-if="businessPerformanceDistributionForm.distributionList !== null" class="createMajor-main-container">
  128. <div class="postInfo-container">
  129. <div>
  130. <el-divider content-position="left">
  131. <h3 class="title">
  132. <div class="avatar-wrapper icon-title">申报</div>
  133. <div class="icon-info">评估人员提成申报</div>
  134. </h3>
  135. </el-divider>
  136. </div>
  137. <el-form :model="declareForm" ref="declareForm" :rules="rules">
  138. <el-form-item label="业务分类:" prop="commissionRateId" label-width="140px"
  139. class="postInfo-container-item">
  140. <el-select clearable v-model="declareForm.commissionRateId" placeholder="请选择业务分类"
  141. style="width: 100%;" @change="getAssetsEvaluateCateDetail()">
  142. <el-option v-for="(c, id) in cates" :value="c.id" :label="c.name">{{ c.name }}</el-option>
  143. </el-select>
  144. </el-form-item>
  145. <el-form-item label="提成比例:" prop="ratio" label-width="140px" class="postInfo-container-item">
  146. <el-input v-model="declareForm.ratio" :placeholder="ratioPlaceholderData" type="number"
  147. :disabled="cateDetail == null || cateDetail.maxRatio == null">
  148. <template #suffix>
  149. %
  150. </template>
  151. </el-input>
  152. </el-form-item>
  153. </el-form>
  154. <p style="color: red;">绩效比例&参与时长:</p>
  155. <el-row style="margin-top: 10px;margin-left: 40px;" v-for="(member, index) in assetsBusinessMembers"
  156. :key="index" class="row-style">
  157. <el-col>
  158. <p style="width: 65px; display: inline-block; text-align: right;">
  159. {{ member.memberName }}:
  160. </p>
  161. <el-input-number
  162. v-model="businessPerformanceDistributionForm.distributionList[index].performanceDistribution"
  163. :precision="2" :step="0.1" :max="100">
  164. </el-input-number>
  165. <p style="margin-left: 5px; margin-right: 15px; display: inline-block;">
  166. %
  167. </p>
  168. <el-input-number
  169. v-model="businessPerformanceDistributionForm.distributionList[index].participationDuration"
  170. :step="1">
  171. </el-input-number>
  172. <p style="margin-left: 5px; display: inline-block;">
  173. 小时
  174. </p>
  175. <p style="margin-left: 15px; display: inline-block;">
  176. <span v-if="member.memberType === '项目负责人'" style="color: blueviolet;">
  177. * {{ member.memberType }}
  178. </span>
  179. <span v-if="member.memberType === '项目参与人'">
  180. * {{ member.memberType }}
  181. </span>
  182. <span v-if="member.memberType === '签字师'" style="color: red;">
  183. * {{ member.memberType }}
  184. </span>
  185. </p>
  186. </el-col>
  187. </el-row>
  188. </div>
  189. </div>
  190. <span v-if="businessPerformanceDistributionForm.distributionList !== null" slot="footer" class="dialog-footer">
  191. <el-button @click="assetsAchievementRatioDialogVisible = false">取 消</el-button>
  192. <el-button v-if="showDistributionButton" type="primary" @click="assetsDeclare()">提 交</el-button>
  193. </span>
  194. </el-dialog>
  195. </div>
  196. </template>
  197. <script>
  198. import YPageListLayout from '@/components/YPageListLayout'
  199. import Breadcrumb from '@/components/Breadcrumb'
  200. export default {
  201. name: 'declareAssetEvaluate',
  202. components: {
  203. Breadcrumb,
  204. YPageListLayout,
  205. },
  206. filters: {
  207. },
  208. data() {
  209. var checkRatioValue = (rule, value, callback) => {
  210. if (this.cateDetail.maxRatio !== undefined && this.cateDetail.maxRatio !== null) {
  211. if (this.declareForm.ratio >= this.cateDetail.minRatio && this.declareForm.ratio <= this.cateDetail.maxRatio) {
  212. callback();
  213. } else {
  214. return callback(new Error('提成比例须在 ' + this.cateDetail.minRatio + "% - " + this.cateDetail.maxRatio + "% 之间"));
  215. }
  216. } else {
  217. callback();
  218. }
  219. };
  220. return {
  221. rules: {
  222. commissionRateId: [
  223. { required: true, message: '业务分类不能为空', trigger: 'blur' }
  224. ],
  225. ratio: [
  226. { required: true, message: '提成比例不能为空', trigger: 'blur' },
  227. { required: true, validator: checkRatioValue, trigger: 'blur' }
  228. ]
  229. },
  230. ratioPlaceholderData: "请输入提成比例",
  231. pageData: { records: [] },
  232. listQuery: {
  233. page: 1,
  234. size: 10,
  235. descs: 'id',
  236. name: null,
  237. reportNo: null
  238. },// 项目所有参与人信息
  239. assetsBusinessMembers: [],
  240. cates: [],
  241. cateDetail: null,
  242. declareDialog: false,
  243. declareForm: {
  244. orderId: null,
  245. name: null,
  246. reportNo: null,
  247. businessId: null,
  248. productionId: null,
  249. businessType: 'COMMISSION_DECLARE_ASSET_EVALUATE',
  250. commissionRateId: null,
  251. ratio: null,
  252. definedLowLimitAmount: null
  253. },
  254. showDistributionButton: null,
  255. assetsAchievementRatioDialogVisible: false,
  256. // 资产绩效比例表单
  257. businessPerformanceDistributionForm: {
  258. businessId: null,
  259. businessType: null,
  260. reportNo: null,
  261. userType: null,
  262. distributionList: []
  263. }
  264. }
  265. },
  266. created() {
  267. this.listQuery.name = this.$route.query.name;
  268. this.listQuery.reportNo = this.$route.query.reportNo;
  269. this.assetsEvaluateDeclarePage();
  270. this.getAssetsEvaluateCate();
  271. },
  272. methods: {
  273. resetSearch() {
  274. this.$router.push({ query: {} });
  275. this.orderDate = '';
  276. this.listQuery = {
  277. current: 1,
  278. size: 10,
  279. descs: 'id',
  280. name: null,
  281. reportNo: null
  282. }
  283. this.assetsEvaluateDeclarePage()
  284. },
  285. searchList() {
  286. this.listQuery.current = 1;
  287. this.assetsEvaluateDeclarePage();
  288. },
  289. assetsEvaluateDeclarePage() {
  290. this.$api.commissonDeclare.assetsEvaluateDeclarePage(this.listQuery).then(res => {
  291. if (res.code === 200) {
  292. this.pageData = res.data;
  293. }
  294. })
  295. },
  296. getAssetsEvaluateCate() {
  297. this.$api.businessCommissionRate.cateList("ASSET_BUSINESS", "EVALUATOR").then(res => {
  298. if (res.code === 200) {
  299. this.cates = res.data;
  300. }
  301. })
  302. },
  303. getAssetsEvaluateCateDetail() {
  304. this.$api.businessCommissionRate.detail(this.declareForm.commissionRateId).then(res => {
  305. if (res.code === 200) {
  306. this.cateDetail = res.data;
  307. this.declareForm.definedLowLimitAmount = this.cateDetail.lowLimitAmount;
  308. if (res.data.maxRatio == null) {
  309. this.declareForm.ratio = this.cateDetail.minRatio;
  310. } else {
  311. this.declareForm.ratio = null;
  312. this.ratioPlaceholderData = "请输入提成比例 " + this.cateDetail.minRatio + "%" + " - " + this.cateDetail.maxRatio + "%";
  313. }
  314. }
  315. })
  316. },
  317. checkDetail(id) {
  318. this.$router.push(`/income/assets/declare/detail?businessId=${id}&businessType=COMMISSION_DECLARE_ASSET_EVALUATE&doWorkflow=${false}&back=${'/income/assets/declare/evaluate'}&couldEdit=${false}`)
  319. },
  320. // 打开绩效比例分配弹窗
  321. openAssetsAchievementRatioDialog(row) {
  322. this.businessPerformanceDistributionForm.distributionList = [];
  323. this.assetsAchievementRatioDialogVisible = true;
  324. this.declareForm.name = row.name;
  325. this.declareForm.reportNo = row.reportNo;
  326. this.declareForm.businessId = row.businessId;
  327. this.declareForm.productionId = row.productionId;
  328. this.getPerformanceDistributionList(row);
  329. },
  330. // 获取资产绩效分配信息list
  331. getPerformanceDistributionList(row) {
  332. this.businessPerformanceDistributionForm.businessId = row.businessId;
  333. this.businessPerformanceDistributionForm.businessType = 'ASSET_BUSINESS';
  334. this.businessPerformanceDistributionForm.reportNo = row.reportNo;
  335. // 人员类型(市场人员/评估人员)
  336. this.businessPerformanceDistributionForm.userType = '评估人员';
  337. let selectDTO = this.businessPerformanceDistributionForm;
  338. selectDTO.distributionList = null;
  339. this.$api.businessPerformanceDistribution.getPerformanceDistributionList(this.businessPerformanceDistributionForm).then(res => {
  340. if (res.code === 200 && res.data !== null && res.data.length > 0) {
  341. this.businessPerformanceDistributionForm.distributionList = res.data;
  342. this.getAssetsBusinessMembers(false, row);
  343. this.showDistributionButton = false;
  344. } else {
  345. this.showDistributionButton = true;
  346. this.getAssetsBusinessMembers(true, row);
  347. }
  348. })
  349. },
  350. // 获取项目参与人信息
  351. getAssetsBusinessMembers(state, row) {
  352. let assetsBusinessMembersDTO = { businessId: null, reportNo: null };
  353. assetsBusinessMembersDTO.businessId = row.businessId;
  354. assetsBusinessMembersDTO.reportNo = row.reportNo;
  355. this.$api.assets.getAssetsBusinessMembers(assetsBusinessMembersDTO).then(res => {
  356. // 返回不为空,且没有绩效分配信息
  357. if (res.code === 200 && res.data !== null) {
  358. this.assetsBusinessMembers = res.data;
  359. if (state) {
  360. this.businessPerformanceDistributionForm.distributionList = [];
  361. for (let i = 0; i < this.assetsBusinessMembers.length; i++) {
  362. let memberInfo = { memberId: this.assetsBusinessMembers[i].memberId, performanceDistribution: 0, participationDuration: 0, memberType: this.assetsBusinessMembers[i].memberType }
  363. if (memberInfo.memberType === '签字师') {
  364. memberInfo.performanceDistribution = 8;
  365. }
  366. this.businessPerformanceDistributionForm.distributionList.push(memberInfo)
  367. }
  368. }
  369. }
  370. })
  371. },
  372. // 重置绩效分配表单
  373. resetBusinessPerformanceDistributionForm() {
  374. this.assetsAchievementRatioDialogVisible = false;
  375. this.businessPerformanceDistributionForm.businessId = null;
  376. this.businessPerformanceDistributionForm.businessType = null;
  377. this.businessPerformanceDistributionForm.reportNo = null;
  378. },
  379. // 新增评估人员绩效申报
  380. assetsDeclare() {
  381. this.$refs.declareForm.validate(valid => {
  382. if (valid) {
  383. const sum = this.businessPerformanceDistributionForm.distributionList.reduce((accumulator, obj) => {
  384. return accumulator + obj.performanceDistribution;
  385. }, 0);
  386. if (sum === 100) {
  387. this.declareForm.distributionDto = this.businessPerformanceDistributionForm;
  388. this.$api.commissonDeclare.assetsDeclare(this.declareForm).then(res => {
  389. if (res.code === 200) {
  390. this.$notify({
  391. title: '成功',
  392. message: '提成申报已提交',
  393. type: 'success',
  394. duration: 2000
  395. });
  396. this.resetBusinessPerformanceDistributionForm();
  397. this.assetsEvaluateDeclarePage();
  398. this.declareDialog = false;
  399. } else {
  400. this.$notify({
  401. title: '失败',
  402. message: '提成申报提交失败,请联系管理员',
  403. type: 'error',
  404. duration: 2000
  405. });
  406. }
  407. })
  408. } else {
  409. this.$notify({
  410. title: '警告',
  411. message: '所有人员分配的绩效之和必须等于100%!',
  412. type: 'error',
  413. duration: 3000
  414. });
  415. }
  416. }
  417. })
  418. }
  419. }
  420. }
  421. </script>
  422. <style lang="scss" scoped>
  423. /deep/.doWarehouseClass {
  424. border-radius: 10px;
  425. }
  426. .real-amount {
  427. /deep/ .el-form-item__label {
  428. color: red;
  429. font-weight: bold
  430. }
  431. }
  432. </style>