InsuranceContractForm.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. <template>
  2. <div>
  3. <zj-form-container v-if="formDialog" ref="formRef" :form-data="formData" :form-attributes="{ size: 'mini' }">
  4. <zj-form-module
  5. v-if="formData.pgOrderBase"
  6. title="工单信息"
  7. label-width="110px"
  8. :formData="formData.pgOrderBase"
  9. :formItems="formItems"
  10. :column="3"
  11. >
  12. </zj-form-module>
  13. <zj-form-module title="申请信息" label-width="110px" :formData="formData" :formItems="formItems2" :column="3">
  14. </zj-form-module>
  15. <template
  16. v-if="[3].includes(type) && formData.workerInvolveApplyItems && formData.workerInvolveApplyItems.length"
  17. >
  18. <template v-for="(item, index) in formData.workerInvolveApplyItems">
  19. <zj-form-module
  20. :key="`${index}1`"
  21. :title="`网点审核`"
  22. label-width="100px"
  23. :form-data="item"
  24. :form-items="formItems3"
  25. :column="3"
  26. >
  27. </zj-form-module>
  28. <zj-form-module
  29. v-if="!!item.examineStatus"
  30. :key="`${index}2`"
  31. :title="`中心审核`"
  32. label-width="100px"
  33. :form-data="item"
  34. :form-items="formItems4"
  35. :column="3"
  36. >
  37. </zj-form-module>
  38. </template>
  39. </template>
  40. </zj-form-container>
  41. <zj-form-container
  42. v-if="formDialog && [1, 2].includes(type)"
  43. ref="formRef1"
  44. :form-data="formData1"
  45. :form-attributes="{ size: 'mini' }"
  46. >
  47. <zj-form-module title="网点审核" label-width="100px" :form-data="formData1" :form-items="formItems3" :column="3">
  48. </zj-form-module>
  49. </zj-form-container>
  50. <zj-form-container
  51. v-if="formDialog && [2].includes(type)"
  52. ref="formRef2"
  53. :form-data="formData2"
  54. :form-attributes="{ size: 'mini' }"
  55. >
  56. <zj-form-module title="中心审核" label-width="100px" :form-data="formData2" :form-items="formItems4" :column="3">
  57. </zj-form-module>
  58. </zj-form-container>
  59. <div v-if="type === 0 || type === 1" style="text-align: right">
  60. <el-button
  61. size="mini"
  62. @click="
  63. () => {
  64. $emit('success')
  65. }
  66. "
  67. >
  68. 取消
  69. </el-button>
  70. <el-button v-if="type == 1" size="mini" type="primary" @click="networkAudit">网点审批</el-button>
  71. <el-button v-if="type == 2" size="mini" type="primary" @click="centralAudit">中心审批</el-button>
  72. </div>
  73. </div>
  74. </template>
  75. <script>
  76. import { workerApplyDetail, workerApplyWebsitAppeal, workerApplyAppeal } from '@/api/difficultyExpenseApproval.js'
  77. import { required } from '@/components/template/rules_verify.js'
  78. export default {
  79. props: {
  80. type: {
  81. type: Number,
  82. default: null
  83. },
  84. item: {
  85. type: Object,
  86. default: null
  87. }
  88. },
  89. data() {
  90. return {
  91. formDialog: false,
  92. formData: {
  93. applyWorkerName: '',
  94. applyWorkerNumber: '',
  95. applyWorkerPhone: '',
  96. auditTime: '',
  97. companyWechatId: '',
  98. companyWechatName: '',
  99. createBy: '',
  100. createTime: '',
  101. id: 0,
  102. image: '',
  103. maintenancePricePass: 0,
  104. orderBaseId: '',
  105. pgOrderBase: {},
  106. principal: '',
  107. problemDescription: '',
  108. reason: '',
  109. remark: '',
  110. status: 0,
  111. updateBy: '',
  112. updateTime: '',
  113. userId: '',
  114. websitAuditTime: '',
  115. websitCustomerCharges: 0,
  116. websitId: '',
  117. websitMaintenancePricePass: 0,
  118. websitName: '',
  119. websitPrincipal: '',
  120. websitRemark: '',
  121. workerInvolveApplyItems: []
  122. },
  123. formData1: {
  124. auditTime: '',
  125. involveApplyId: '',
  126. maintenancePricePass: 0,
  127. principal: '',
  128. remark: '',
  129. status: 0,
  130. websitAuditTime: '',
  131. websitCustomerCharges: 0,
  132. websitMaintenancePricePass: 0,
  133. websitPrincipal: '',
  134. websitRemark: '',
  135. websitStatus: 0
  136. },
  137. formData2: {
  138. auditTime: '',
  139. involveApplyId: '',
  140. maintenancePricePass: 0,
  141. principal: '',
  142. remark: '',
  143. status: 0,
  144. websitAuditTime: '',
  145. websitCustomerCharges: 0,
  146. websitMaintenancePricePass: 0,
  147. websitPrincipal: '',
  148. websitRemark: '',
  149. websitStatus: 0
  150. },
  151. formRules: {}
  152. }
  153. },
  154. computed: {
  155. formItems() {
  156. return [
  157. {
  158. md: 6,
  159. name: 'el-input',
  160. attributes: { disabled: true },
  161. formItemAttributes: { label: '工单单号', prop: 'id' }
  162. },
  163. {
  164. md: 6,
  165. name: 'el-input',
  166. attributes: { disabled: true },
  167. formItemAttributes: { label: '工单类型', prop: 'orderSmallTypeText' }
  168. },
  169. {
  170. md: 6,
  171. name: 'el-input',
  172. attributes: { disabled: true },
  173. formItemAttributes: { label: '客户姓名', prop: 'userName' }
  174. },
  175. {
  176. md: 6,
  177. name: 'el-input',
  178. attributes: { disabled: true },
  179. formItemAttributes: { label: '客户电话', prop: 'userMobile' }
  180. },
  181. {
  182. md: 12,
  183. name: 'el-input',
  184. attributes: { disabled: true },
  185. formItemAttributes: { label: '客户地址', prop: 'address' }
  186. },
  187. {
  188. md: 6,
  189. name: 'el-input',
  190. attributes: { disabled: true },
  191. formItemAttributes: { label: '主要工程师', prop: 'workerName' }
  192. },
  193. {
  194. md: 6,
  195. name: 'el-input',
  196. attributes: { disabled: true },
  197. formItemAttributes: { label: '完工时间', prop: 'overTime' }
  198. }
  199. ]
  200. },
  201. formItems2() {
  202. return [
  203. {
  204. md: 12,
  205. name: 'el-input',
  206. attributes: { disabled: true },
  207. formItemAttributes: { label: '所属网点', prop: 'websitName' }
  208. },
  209. {
  210. md: 6,
  211. name: 'el-input',
  212. attributes: { disabled: true },
  213. formItemAttributes: { label: '申请人', prop: 'applyWorkerName' }
  214. },
  215. {
  216. md: 6,
  217. name: 'el-input',
  218. attributes: { disabled: true },
  219. formItemAttributes: { label: '申请时间', prop: 'createTime' }
  220. },
  221. {
  222. name: 'el-input',
  223. md: 24,
  224. attributes: {
  225. disabled: [2, 3].includes(this.type),
  226. type: 'textarea',
  227. rows: 3,
  228. placeholder: '请输入'
  229. },
  230. formItemAttributes: {
  231. label: '申请理由',
  232. prop: 'reason',
  233. rules: [...required]
  234. }
  235. },
  236. {
  237. name: 'el-input',
  238. md: 24,
  239. attributes: {
  240. disabled: [2, 3].includes(this.type),
  241. type: 'textarea',
  242. rows: 3,
  243. placeholder: '请输入'
  244. },
  245. formItemAttributes: {
  246. label: '问题描述',
  247. prop: 'problemDescription',
  248. rules: [...required]
  249. }
  250. }
  251. ]
  252. },
  253. formItems3() {
  254. return [
  255. {
  256. md: 12,
  257. name: 'el-radio',
  258. options: [
  259. { label: '通过审核', value: '5' },
  260. { label: '驳回可重申', value: '2' },
  261. { label: '驳回不可申诉', value: '4' }
  262. ],
  263. attributes: {
  264. disabled: [2, 3].includes(this.type)
  265. },
  266. formItemAttributes: {
  267. label: '网点审批',
  268. prop: 'websitStatus',
  269. rules: [...required]
  270. }
  271. },
  272. {
  273. md: 6,
  274. name: 'el-input',
  275. attributes: { disabled: [2, 3].includes(this.type) },
  276. formItemAttributes: { label: '申请费用', prop: 'websitMaintenancePricePass', rules: [...required] }
  277. },
  278. {
  279. md: 6,
  280. name: 'el-radio',
  281. options: [
  282. { label: '是', value: '1' },
  283. { label: '否', value: '2' }
  284. ],
  285. attributes: {
  286. disabled: [2, 3].includes(this.type)
  287. },
  288. formItemAttributes: {
  289. label: '是否向客户收费',
  290. prop: 'websitCustomerCharges',
  291. rules: [...required]
  292. }
  293. },
  294. {
  295. md: 6,
  296. name: 'el-input',
  297. attributes: { disabled: true },
  298. formItemAttributes: { label: '网点审核人', prop: 'websitPrincipal' }
  299. },
  300. {
  301. md: 6,
  302. name: 'el-input',
  303. attributes: { disabled: true },
  304. formItemAttributes: { label: '网点审核时间', prop: 'websitAuditTime' }
  305. },
  306. {
  307. name: 'el-input',
  308. md: 24,
  309. attributes: {
  310. disabled: [2, 3].includes(this.type),
  311. type: 'textarea',
  312. rows: 3,
  313. placeholder: '请输入'
  314. },
  315. formItemAttributes: {
  316. label: '审核备注',
  317. prop: 'websitRemark',
  318. rules: [...required]
  319. }
  320. }
  321. ]
  322. },
  323. formItems4() {
  324. return [
  325. {
  326. md: 12,
  327. name: 'el-radio',
  328. options: [
  329. { label: '通过审核', value: '5' },
  330. { label: '驳回可重申', value: '2' },
  331. { label: '驳回不可申诉', value: '4' }
  332. ],
  333. attributes: {
  334. disabled: [3].includes(this.type)
  335. },
  336. formItemAttributes: {
  337. label: '中心审批',
  338. prop: 'status',
  339. rules: [...required]
  340. }
  341. },
  342. {
  343. md: 6,
  344. name: 'el-input',
  345. attributes: { disabled: true },
  346. formItemAttributes: { label: '中心审核人', prop: 'principal' }
  347. },
  348. {
  349. md: 6,
  350. name: 'el-input',
  351. attributes: { disabled: true },
  352. formItemAttributes: { label: '中心审核时间', prop: 'auditTime' }
  353. },
  354. {
  355. md: 6,
  356. name: 'el-radio',
  357. options: [],
  358. attributes: {
  359. disabled: [3].includes(this.type)
  360. },
  361. formItemAttributes: {
  362. label: '审批费用',
  363. prop: 'maintenancePricePass',
  364. rules: [...required]
  365. }
  366. },
  367. {
  368. name: 'el-input',
  369. md: 24,
  370. attributes: {
  371. disabled: [3].includes(this.type),
  372. type: 'textarea',
  373. rows: 3,
  374. placeholder: '请输入'
  375. },
  376. formItemAttributes: {
  377. label: '审核备注',
  378. prop: 'remark',
  379. rules: [...required]
  380. }
  381. }
  382. ]
  383. }
  384. },
  385. created() {
  386. workerApplyDetail({
  387. orderBaseId: this.item.orderBaseId
  388. }).then(res => {
  389. this.formData = { ...res.data }
  390. this.formDialog = true
  391. })
  392. },
  393. methods: {
  394. networkAudit() {
  395. this.$refs.formRef.validate(valid0 => {
  396. if (valid0) {
  397. this.$refs.formRef1.validate((valid, invalidFields, errLabels) => {
  398. if (valid) {
  399. workerApplyWebsitAppeal({
  400. ...this.formData,
  401. workerInvolveApplyItem: [...this.formData1]
  402. }).then(res => {
  403. this.$message({
  404. type: 'success',
  405. message: '审核成功'
  406. })
  407. this.$emit('success')
  408. })
  409. }
  410. })
  411. }
  412. })
  413. },
  414. centralAudit() {
  415. this.$refs.formRef2.validate((valid, invalidFields, errLabels) => {
  416. if (valid) {
  417. workerApplyAppeal({
  418. ...this.formData,
  419. ...this.formData2
  420. }).then(res => {
  421. this.$message({
  422. type: 'success',
  423. message: '审核成功'
  424. })
  425. this.$emit('success')
  426. })
  427. }
  428. })
  429. }
  430. }
  431. }
  432. </script>
  433. <style lang="scss" scoped></style>