Browse Source

no message

linwenxin 5 months ago
parent
commit
335161481e

+ 32 - 0
src/api/networkContractSigning.js

@@ -39,3 +39,35 @@ export function websitContractSignDetail(params) {
     params: params
   })
 }
+
+export function fddCommonViewTemplate(params) {
+  return request({
+    url: '/fdd/common/view/template',
+    method: 'post',
+    params: params
+  })
+}
+
+export function fddCommonViewContract(params) {
+  return request({
+    url: '/fdd/common/view/contract',
+    method: 'post',
+    params: params
+  })
+}
+
+export function fddCommonDownloadContract(params) {
+  return request({
+    url: '/fdd/common/download/contract',
+    method: 'post',
+    params: params
+  })
+}
+
+export function websitContractSignConfirm(params) {
+  return request({
+    url: '/websit/contract/sign/confirm',
+    method: 'post',
+    params: params
+  })
+}

+ 20 - 0
src/permission.js

@@ -70,6 +70,16 @@ router.beforeEach(async (to, from, next) => {
                   hidden: true
                 }
               ])
+            } else if (route.code == 'networkSigning') {
+              router.addRoutes([
+                {
+                  path: '/networkSigning',
+                  code: 'networkSigning',
+                  name: 'networkSigning',
+                  component: _import(`${route.fullUrl}/index`),
+                  hidden: true
+                }
+              ])
             } else if (moduleObj[route.code] !== false && route.status) {
               lay.children.push(...buildRoute(route))
             }
@@ -86,6 +96,16 @@ router.beforeEach(async (to, from, next) => {
                 component: _import(`${route.fullUrl}/index`),
                 hidden: true
               })
+            } else if (route.code == 'networkSigning') {
+              global.antRouter.push([
+                {
+                  path: '/networkSigning',
+                  code: 'networkSigning',
+                  name: 'networkSigning',
+                  component: _import(`${route.fullUrl}/index`),
+                  hidden: true
+                }
+              ])
             } else if (moduleObj[route.code] !== false && route.status) {
               global.antRouter.push(...buildRoute(route, '', false))
             }

+ 27 - 0
src/views/networkSigning/index.vue

@@ -0,0 +1,27 @@
+<template>
+  <div></div>
+</template>
+
+<script>
+import { websitContractSignSign } from '@/api/networkContractSigning'
+export default {
+  created() {
+    if (this.$route?.query?.id) {
+      websitContractSignSign({
+        id: this.$route?.query?.id,
+        returnUrl: `${window.location.href.split('#')?.[0]}#/networkSigning?id=${this.$route?.query?.id}`
+      }).then(res => {
+        if (res.data.jump) {
+          window.open(res.data.url, '_blank')
+        } else {
+          window.location.href = `${
+            window.location.href.split('#')?.[0]
+          }#/setting/networkSigning/networkContractSigning?id=${this.$route?.query?.id}`
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style></style>

+ 157 - 9
src/views/setting/networkSigning/networkContractSigning/index.vue

@@ -20,12 +20,51 @@
               :form-attributes="{ size: 'mini' }"
             >
               <zj-form-module title="基础信息" label-width="110px" :form-data="formData" :form-items="items" />
-              <zj-form-module title="附件信息" label-width="110px" :form-data="formData" :form-items="items2" />
+              <zj-form-module title="附件信息" label-width="0px" :form-data="formData" :form-items="items2">
+                <div
+                  slot="header"
+                  v-if="!adminWebsitIds.includes(formData.parentId)"
+                  style="width: 100%; text-align: right"
+                >
+                  <el-button type="primary" size="mini" @click="qianyueanniu">签约</el-button>
+                </div>
+              </zj-form-module>
             </zj-form-container>
           </zj-page-fill>
         </zj-page-container>
       </el-dialog>
     </div>
+    <el-dialog title="审核" width="700px" :modal="false" :visible.sync="shenheBool" :before-close="shenheClose">
+      <el-form ref="form" :model="form" label-width="120px" size="mini">
+        <el-form-item label="网点名称">
+          <span>{{ `(${formData.websitId})${formData.websitName}` }}</span>
+        </el-form-item>
+        <el-form-item label="合同名称">
+          <span>{{ form.contractName }}</span>
+        </el-form-item>
+        <el-form-item label="签约成功时间">
+          <span>{{ form.validDate }}</span>
+        </el-form-item>
+        <el-form-item label="签约过期时间">
+          <span>{{ form.expireDate }}</span>
+        </el-form-item>
+        <el-form-item label="审核结果">
+          <el-radio-group v-model="form.status">
+            <el-radio label="OK">审核通过</el-radio>
+            <el-radio label="REJECT">审核驳回</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="审核备注">
+          <el-input type="textarea" v-model="form.remark"></el-input>
+        </el-form-item>
+        <el-form-item>
+          <div style="text-align: right">
+            <el-button @click="shenheClose">取消</el-button>
+            <el-button type="primary" @click="shenhequeding">确定</el-button>
+          </div>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
   </template-page>
 </template>
 
@@ -37,10 +76,12 @@ import {
   websitContractSignListExport,
   websitContractSignCancel,
   websitContractSignSign,
-  websitContractSignDetail
+  websitContractSignDetail,
+  fddCommonViewContract,
+  fddCommonViewTemplate,
+  fddCommonDownloadContract,
+  websitContractSignConfirm
 } from '@/api/networkContractSigning'
-import { commonTemplateDownload } from '@/api/common.js'
-import { required, requiredValueMin } from '@/components/template/rules_verify.js'
 import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage },
@@ -59,10 +100,18 @@ export default {
       formBool: false,
       formType: 0,
       formData: {},
-      formRules: {}
+      formRules: {},
+      shenheBool: false,
+      form: {}
     }
   },
   computed: {
+    userData() {
+      return JSON.parse(localStorage.getItem('greemall_user'))
+    },
+    adminWebsitIds() {
+      return this?.userData?.adminWebsitIds || []
+    },
     optionsEvensGroup() {
       return []
     },
@@ -196,7 +245,7 @@ export default {
           name: 'slot-component',
           md: 24,
           formItemAttributes: {
-            label: '已选工程师',
+            label: '',
             prop: 'items'
           },
           render: (h, { props }) => {
@@ -258,9 +307,59 @@ export default {
                       render: (h, { row, column, index }) => {
                         return (
                           <div style="padding-left:10px">
-                            <el-button type="text" onClick={() => {}}>
-                              查看合同
-                            </el-button>
+                            {!row.fadadaContractId && row.fadadaTemplateId ? (
+                              <el-button
+                                type="text"
+                                onClick={() => {
+                                  fddCommonViewTemplate({ templateId: row.fadadaTemplateId }).then(res => {
+                                    window.open(res.data, '_blank')
+                                  })
+                                }}
+                              >
+                                查看模板
+                              </el-button>
+                            ) : null}
+                            {row.fadadaContractId ? (
+                              <el-button
+                                type="text"
+                                onClick={() => {
+                                  fddCommonViewContract({
+                                    contractId: row.fadadaContractId
+                                  }).then(res => {
+                                    window.open(res.data, '_blank')
+                                  })
+                                }}
+                              >
+                                查看合同
+                              </el-button>
+                            ) : null}
+                            {row.contractStatus == 'OK' && this.adminWebsitIds.includes(this.formData?.parentId) ? (
+                              <el-button
+                                type="text"
+                                onClick={() => {
+                                  fddCommonDownloadContract({
+                                    contractId: row.fadadaContractId
+                                  }).then(res => {
+                                    window.open(res.data, '_blank')
+                                  })
+                                }}
+                              >
+                                下载合同
+                              </el-button>
+                            ) : null}
+                            {row.contractStatus == 'WAIT' && this.adminWebsitIds.includes(this.formData?.parentId) ? (
+                              <el-button
+                                type="text"
+                                onClick={() => {
+                                  this.form = { ...row }
+                                  this.$nextTick(() => {
+                                    this.shenheBool = true
+                                  })
+                                }}
+                              >
+                                审核
+                              </el-button>
+                            ) : null}
                           </div>
                         )
                       }
@@ -275,6 +374,23 @@ export default {
       ]
     }
   },
+  created() {
+    if (this.$route?.query?.id) {
+      this.openWindow(() => {
+        websitContractSignDetail({
+          id: this.$route?.query?.id
+        }).then(res => {
+          this.formData = {
+            ...res.data
+          }
+          this.$nextTick(() => {
+            this.formType = 1
+            this.formBool = true
+          })
+        })
+      })
+    }
+  },
   methods: {
     // 列表请求函数
     getList: websitContractSignList,
@@ -333,6 +449,38 @@ export default {
           }
         }
       })
+    },
+    shenheClose() {
+      this.shenheBool = false
+    },
+    shenhequeding() {
+      websitContractSignConfirm({
+        id: this.form.id,
+        remark: this.form.remark,
+        status: this.form.status
+      }).then(res => {
+        this.$message({ type: 'success', message: '审核成功!' })
+        this.shenheClose()
+        this.openWindow(() => {
+          websitContractSignDetail({
+            id: row.id
+          }).then(res => {
+            this.formData = {
+              ...res.data
+            }
+          })
+        })
+      })
+    },
+    qianyueanniu() {
+      websitContractSignSign({
+        id: this.formData.id,
+        returnUrl: `${window.location.href.split('#')?.[0]}#/networkSigning?id=${this.formData.id}`
+      }).then(res => {
+        if (res.data.jump) {
+          window.open(res.data.url, '_blank')
+        }
+      })
     }
   }
 }