index.vue 15 KB

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