index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  1. <template>
  2. <template-page
  3. ref="pageRef"
  4. :getList="getList"
  5. :exportList="exportList"
  6. :columnParsing="columnParsing"
  7. :optionsEvensGroup="optionsEvensGroup"
  8. :tableAttributes="tableAttributes"
  9. :tableEvents="tableEvents"
  10. :operation="operation()"
  11. >
  12. <div class="cartographer_big">
  13. <el-dialog title="签约信息" width="100%" :modal="false" :visible.sync="formBool" :before-close="handleClose">
  14. <zj-page-container v-if="formBool">
  15. <zj-page-fill class="neibuview">
  16. <zj-form-container
  17. ref="formRef"
  18. :form-data="formData"
  19. :form-rules="formRules"
  20. :form-attributes="{ size: 'mini' }"
  21. >
  22. <zj-form-module title="基础信息" label-width="110px" :form-data="formData" :form-items="items" />
  23. <zj-form-module title="附件信息" label-width="0px" :form-data="formData" :form-items="items2">
  24. <div
  25. slot="header"
  26. v-if="!adminWebsitIds.includes(formData.parentId)"
  27. style="width: 100%; text-align: right"
  28. >
  29. <el-button type="primary" size="mini" @click="qianyueanniu">签约</el-button>
  30. </div>
  31. </zj-form-module>
  32. </zj-form-container>
  33. </zj-page-fill>
  34. </zj-page-container>
  35. </el-dialog>
  36. </div>
  37. <el-dialog title="审核" width="700px" :modal="false" :visible.sync="shenheBool" :before-close="shenheClose">
  38. <el-form ref="form" :model="form" label-width="120px" size="mini">
  39. <el-form-item label="网点名称">
  40. <span>{{ `(${formData.websitId})${formData.websitName}` }}</span>
  41. </el-form-item>
  42. <el-form-item label="合同名称">
  43. <span>{{ form.contractName }}</span>
  44. </el-form-item>
  45. <el-form-item label="签约成功时间">
  46. <span>{{ form.validDate }}</span>
  47. </el-form-item>
  48. <el-form-item label="签约过期时间">
  49. <span>{{ form.expireDate }}</span>
  50. </el-form-item>
  51. <el-form-item label="审核结果">
  52. <el-radio-group v-model="form.status">
  53. <el-radio label="OK">审核通过</el-radio>
  54. <el-radio label="REJECT">审核驳回</el-radio>
  55. </el-radio-group>
  56. </el-form-item>
  57. <el-form-item label="审核备注">
  58. <el-input type="textarea" v-model="form.remark"></el-input>
  59. </el-form-item>
  60. <el-form-item>
  61. <div style="text-align: right">
  62. <el-button @click="shenheClose">取消</el-button>
  63. <el-button type="primary" @click="shenhequeding">确定</el-button>
  64. </div>
  65. </el-form-item>
  66. </el-form>
  67. </el-dialog>
  68. </template-page>
  69. </template>
  70. <script>
  71. import TemplatePage from '@/components/template/template-page-1.vue'
  72. import import_mixin from '@/components/template/import_mixin.js'
  73. import {
  74. websitContractSignList,
  75. websitContractSignListExport,
  76. websitContractSignCancel,
  77. websitContractSignSign,
  78. websitContractSignDetail,
  79. fddCommonViewContract,
  80. fddCommonViewTemplate,
  81. fddCommonDownloadContract,
  82. websitContractSignConfirm
  83. } from '@/api/networkContractSigning'
  84. import operation_mixin from '@/components/template/operation_mixin.js'
  85. export default {
  86. components: { TemplatePage },
  87. mixins: [import_mixin, operation_mixin],
  88. data() {
  89. return {
  90. // 表格属性
  91. tableAttributes: {
  92. selectColumn: false
  93. },
  94. // 表格事件
  95. tableEvents: {
  96. 'selection-change': this.selectionChange
  97. },
  98. recordSelected: [],
  99. formBool: false,
  100. formType: 0,
  101. formData: {},
  102. formRules: {},
  103. shenheBool: false,
  104. form: {}
  105. }
  106. },
  107. computed: {
  108. userData() {
  109. return JSON.parse(localStorage.getItem('greemall_user'))
  110. },
  111. adminWebsitIds() {
  112. return this?.userData?.adminWebsitIds || []
  113. },
  114. optionsEvensGroup() {
  115. return []
  116. },
  117. items() {
  118. return [
  119. {
  120. name: 'el-input',
  121. md: 12,
  122. attributes: {
  123. disabled: true,
  124. placeholder: '请输入'
  125. },
  126. formItemAttributes: {
  127. label: '上级网点编号',
  128. prop: 'parentId'
  129. }
  130. },
  131. {
  132. name: 'el-input',
  133. md: 12,
  134. attributes: {
  135. disabled: true,
  136. placeholder: '请输入'
  137. },
  138. formItemAttributes: {
  139. label: '上级网点名称',
  140. prop: 'parentName'
  141. }
  142. },
  143. {
  144. name: 'el-input',
  145. md: 12,
  146. attributes: {
  147. disabled: true,
  148. placeholder: '请输入'
  149. },
  150. formItemAttributes: {
  151. label: '网点编号',
  152. prop: 'websitId'
  153. }
  154. },
  155. {
  156. name: 'el-input',
  157. md: 12,
  158. attributes: {
  159. disabled: true,
  160. placeholder: '请输入'
  161. },
  162. formItemAttributes: {
  163. label: '网点名称',
  164. prop: 'websitName'
  165. }
  166. },
  167. {
  168. name: 'el-input',
  169. md: 6,
  170. attributes: {
  171. disabled: true,
  172. placeholder: '请输入'
  173. },
  174. formItemAttributes: {
  175. label: '法大大法人id',
  176. prop: 'fadadaCustomerId'
  177. }
  178. },
  179. {
  180. name: 'el-input',
  181. md: 6,
  182. attributes: {
  183. disabled: true,
  184. placeholder: '请输入'
  185. },
  186. formItemAttributes: {
  187. label: '法人实名流水号',
  188. prop: 'fadadaWebsitNo'
  189. }
  190. },
  191. {
  192. name: 'el-input',
  193. md: 6,
  194. attributes: {
  195. disabled: true,
  196. placeholder: '请输入'
  197. },
  198. formItemAttributes: {
  199. label: '个人实名状态',
  200. prop: 'authStatus'
  201. }
  202. },
  203. {
  204. name: 'el-input',
  205. md: 6,
  206. attributes: {
  207. disabled: true,
  208. placeholder: '请输入'
  209. },
  210. formItemAttributes: {
  211. label: '法大大网点id',
  212. prop: 'fadadaWebsitNo'
  213. }
  214. },
  215. {
  216. name: 'el-input',
  217. md: 6,
  218. attributes: {
  219. disabled: true,
  220. placeholder: '请输入'
  221. },
  222. formItemAttributes: {
  223. label: '网点实名流水号',
  224. prop: 'fadadaWebsitNo'
  225. }
  226. },
  227. {
  228. name: 'el-input',
  229. md: 6,
  230. attributes: {
  231. disabled: true,
  232. placeholder: '请输入'
  233. },
  234. formItemAttributes: {
  235. label: '创建时间',
  236. prop: 'createTime'
  237. }
  238. }
  239. ]
  240. },
  241. items2() {
  242. return [
  243. {
  244. name: 'slot-component',
  245. md: 24,
  246. formItemAttributes: {
  247. label: '',
  248. prop: 'items'
  249. },
  250. render: (h, { props }) => {
  251. var { formData } = props
  252. return (
  253. <div>
  254. <zj-table
  255. columns={[
  256. {
  257. columnAttributes: {
  258. label: '序号',
  259. prop: ''
  260. },
  261. render: (h, { row, column, index }) => {
  262. return <div style="padding-left:10px">{index + 1}</div>
  263. }
  264. },
  265. {
  266. columnAttributes: {
  267. label: '附件名称',
  268. prop: 'contractName'
  269. }
  270. },
  271. {
  272. columnAttributes: {
  273. label: '附件状态',
  274. prop: 'contractStatus'
  275. },
  276. render: (h, { row, column, index }) => {
  277. return (
  278. <div style="padding-left:10px">
  279. {{ WAIT_SIGN: '待签约', WAIT: '待审核', OK: '审核通过' }[row.contractStatus]}
  280. </div>
  281. )
  282. }
  283. },
  284. {
  285. columnAttributes: {
  286. label: '签约成功时间',
  287. prop: 'validDate'
  288. }
  289. },
  290. {
  291. columnAttributes: {
  292. label: '签约过期时间',
  293. prop: 'expireDate'
  294. }
  295. },
  296. {
  297. columnAttributes: {
  298. label: '审核人',
  299. prop: 'confirmBy'
  300. }
  301. },
  302. {
  303. columnAttributes: {
  304. label: '操作'
  305. },
  306. render: (h, { row, column, index }) => {
  307. return (
  308. <div style="padding-left:10px">
  309. {!row.fadadaContractId && row.fadadaTemplateId ? (
  310. <el-button
  311. type="text"
  312. onClick={() => {
  313. fddCommonViewTemplate({ templateId: row.fadadaTemplateId }).then(res => {
  314. window.open(res.data, '_blank')
  315. })
  316. }}
  317. >
  318. 查看模板
  319. </el-button>
  320. ) : null}
  321. {row.fadadaContractId ? (
  322. <el-button
  323. type="text"
  324. onClick={() => {
  325. fddCommonViewContract({
  326. contractId: row.fadadaContractId
  327. }).then(res => {
  328. window.open(res.data, '_blank')
  329. })
  330. }}
  331. >
  332. 查看合同
  333. </el-button>
  334. ) : null}
  335. {row.contractStatus == 'OK' && this.adminWebsitIds.includes(this.formData?.parentId) ? (
  336. <el-button
  337. type="text"
  338. onClick={() => {
  339. fddCommonDownloadContract({
  340. contractId: row.fadadaContractId
  341. }).then(res => {
  342. window.open(res.data, '_blank')
  343. })
  344. }}
  345. >
  346. 下载合同
  347. </el-button>
  348. ) : null}
  349. {row.contractStatus == 'WAIT' && this.adminWebsitIds.includes(this.formData?.parentId) ? (
  350. <el-button
  351. type="text"
  352. onClick={() => {
  353. this.form = { ...row }
  354. this.$nextTick(() => {
  355. this.shenheBool = true
  356. })
  357. }}
  358. >
  359. 审核
  360. </el-button>
  361. ) : null}
  362. </div>
  363. )
  364. }
  365. }
  366. ]}
  367. tableData={this.formData.items}
  368. ></zj-table>
  369. </div>
  370. )
  371. }
  372. }
  373. ]
  374. }
  375. },
  376. created() {
  377. if (this.$route?.query?.id) {
  378. this.openWindow(() => {
  379. websitContractSignDetail({
  380. id: this.$route?.query?.id
  381. }).then(res => {
  382. this.formData = {
  383. ...res.data
  384. }
  385. this.$nextTick(() => {
  386. this.formType = 1
  387. this.formBool = true
  388. })
  389. })
  390. })
  391. }
  392. },
  393. methods: {
  394. // 列表请求函数
  395. getList: websitContractSignList,
  396. // 导出
  397. exportList: websitContractSignListExport,
  398. // 表格列解析渲染数据更改
  399. columnParsing(item, defaultData) {
  400. return defaultData
  401. },
  402. // 获取勾选框数据
  403. selectionChange(data) {
  404. this.recordSelected = data
  405. },
  406. openWindow(cb) {
  407. this.$nextTick(() => {
  408. cb?.()
  409. })
  410. },
  411. handleClose() {
  412. this.$refs?.pageRef?.refreshList()
  413. this.$data.formData = this.$options.data().formData
  414. this.formType = 0
  415. this.formBool = false
  416. },
  417. operation() {
  418. return this.operationBtn({
  419. viewContract: {
  420. click: ({ row, index, column }) => {
  421. this.openWindow(() => {
  422. websitContractSignDetail({
  423. id: row.id
  424. }).then(res => {
  425. this.formData = {
  426. ...res.data
  427. }
  428. this.$nextTick(() => {
  429. this.formType = 1
  430. this.formBool = true
  431. })
  432. })
  433. })
  434. }
  435. },
  436. loseEfficacy: {
  437. prompt: '是否确定设为失效?',
  438. conditions: ({ row, index, column }) => {
  439. return true
  440. },
  441. click: ({ row, index, column }) => {
  442. websitContractSignCancel({
  443. id: row.id
  444. }).then(res => {
  445. this.$message({ type: 'success', message: '设置成功!' })
  446. this.$refs?.pageRef?.refreshList()
  447. })
  448. }
  449. }
  450. })
  451. },
  452. shenheClose() {
  453. this.shenheBool = false
  454. },
  455. shenhequeding() {
  456. websitContractSignConfirm({
  457. id: this.form.id,
  458. remark: this.form.remark,
  459. status: this.form.status
  460. }).then(res => {
  461. this.$message({ type: 'success', message: '审核成功!' })
  462. this.shenheClose()
  463. this.openWindow(() => {
  464. websitContractSignDetail({
  465. id: row.id
  466. }).then(res => {
  467. this.formData = {
  468. ...res.data
  469. }
  470. })
  471. })
  472. })
  473. },
  474. qianyueanniu() {
  475. websitContractSignSign({
  476. id: this.formData.id,
  477. returnUrl: `${window.location.href.split('#')?.[0]}#/networkSigning?id=${this.formData.id}`
  478. }).then(res => {
  479. if (res.data.jump) {
  480. window.open(res.data.url, '_blank')
  481. }
  482. })
  483. }
  484. }
  485. }
  486. </script>
  487. <style lang="scss" scoped>
  488. .neibuview {
  489. box-sizing: border-box;
  490. padding-left: 16px;
  491. ::v-deep & > .zj-page-fill-scroll {
  492. box-sizing: border-box;
  493. padding-right: 16px;
  494. & > div:nth-child(1) {
  495. margin-top: 20px;
  496. }
  497. }
  498. }
  499. </style>