浏览代码

feature: 添加合同提交审批

liuyaqi 2 年之前
父节点
当前提交
75582d8133
共有 3 个文件被更改,包括 115 次插入3 次删除
  1. 4 0
      src/api/contract/index.js
  2. 96 0
      src/views/contract/components/ApplyContract.vue
  3. 15 3
      src/views/contract/index.vue

+ 4 - 0
src/api/contract/index.js

@@ -36,4 +36,8 @@ export default {
   getDynamicsList(query) {
     return micro_request.postRequest(basePath, 'CtrContract', 'DynamicsList', query)
   },
+  // 提交审核
+  commit(query) {
+    return micro_request.postRequest(basePath, 'CtrContract', 'Commit', query)
+  },
 }

+ 96 - 0
src/views/contract/components/ApplyContract.vue

@@ -0,0 +1,96 @@
+<!--
+ * @Author: wanglj 471442253@qq.com
+ * @Date: 2022-12-26 14:34:34
+ * @LastEditors: wanglj
+ * @LastEditTime: 2023-01-13 09:41:38
+ * @Description: file content
+ * @FilePath: \opms_frontend\src\views\customer\components\allocate.vue
+-->
+<template>
+  <el-dialog title="提交审核" :visible.sync="visible" width="50%" @close="handleClose">
+    <el-form ref="form" label-width="150px" :model="form" :rules="rules">
+      <el-form-item label="合同模板" prop="contractModel">
+        <el-radio-group v-model="form.contractModel">
+          <el-radio label="大数模板" />
+          <el-radio label="客户模板" />
+        </el-radio-group>
+      </el-form-item>
+      <el-form-item label="条款情况" prop="terms">
+        <el-radio-group v-model="form.terms">
+          <el-radio label="接纳全部条款" />
+          <el-radio label="不接纳全部条款" />
+        </el-radio-group>
+      </el-form-item>
+      <el-form-item label="付款条件" prop="payTerms">
+        <el-input
+          v-model="form.payTerms"
+          maxlength="500"
+          placeholder="请输入付款条件"
+          resize="none"
+          :rows="5"
+          show-word-limit
+          type="textarea" />
+      </el-form-item>
+    </el-form>
+    <span slot="footer">
+      <el-button size="mini" type="primary" @click="handleSubmit">确定</el-button>
+      <el-button size="mini" @click="visible = false">取消</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+  import contractApi from '@/api/contract'
+  import to from 'await-to-js'
+  export default {
+    components: {},
+    data() {
+      return {
+        visible: false,
+        form: {
+          id: 0,
+          contractModel: '',
+          terms: '',
+          payTerms: '',
+          file: [
+            // {
+            //   spaceId: '',
+            //   fileId: '',
+            //   fileName: '',
+            //   fileSize: 0,
+            //   fileType: '',
+            // },
+          ],
+        },
+        rules: {
+          contractModel: [{ required: true, trigger: 'blur', message: '请选择合同模板' }],
+          terms: [{ required: true, trigger: 'blur', message: '请选择条款情况' }],
+          payTerms: [{ required: true, trigger: 'blur', message: '请选择付款条件' }],
+        },
+      }
+    },
+    methods: {
+      handleClose() {
+        this.form = {
+          id: 0,
+          contractModel: '',
+          terms: '',
+          payTerms: '',
+          file: [],
+        }
+      },
+      async handleSubmit() {
+        const [valid] = await to(this.$refs.form.validate())
+        if (valid == false) return
+        if (this.form.file.length == 0) return this.$message.warning('附件不能为空')
+        const [err, res] = await to(contractApi.commit(this.form))
+        if (err) return
+        this.$message.success(res.msg)
+        this.visible = false
+        this.$emit('refresh')
+      },
+    },
+  }
+</script>
+
+<style></style>

+ 15 - 3
src/views/contract/index.vue

@@ -113,6 +113,9 @@
       </el-table-column>
       <el-table-column align="center" fixed="right" label="操作" width="90px">
         <template slot-scope="scope">
+          <el-button v-if="scope.row.approStatus == '10'" type="text" @click="handleApply(scope.row.id)">
+            提交审核
+          </el-button>
           <el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>
           <el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
         </template>
@@ -130,6 +133,7 @@
     <Edit ref="edit" @contractSave="contractSave" />
     <!-- 转移合同 -->
     <Transfer ref="transfer" :contract-id="contractId" @transferSave="contractSave" />
+    <ApplyContract ref="applyContract" @refresh="queryData" />
   </div>
 </template>
 
@@ -139,20 +143,24 @@
   import Edit from './components/Edit'
   import TableTool from '@/components/table/TableTool'
   import Transfer from './components/Transfer'
+  import ApplyContract from './components/ApplyContract'
   export default {
     name: 'OpenSea',
     components: {
       Edit,
       TableTool,
       Transfer,
+      ApplyContract,
     },
     data() {
       return {
         height: this.$baseTableHeight(2),
         approStatusOption: [
-          { id: 1, label: '审批中' },
-          { id: 2, label: '已拒绝' },
-          { id: 3, label: '已通过' },
+          { id: '10', label: '待提交审核' },
+          { id: '20', label: '待审核' },
+          { id: '30', label: '审核已同意' },
+          { id: '40', label: '审核已拒绝' },
+          { id: '50', label: '审核已撤销' },
         ],
         contractId: [], //当前合同id
         listLoading: false,
@@ -298,6 +306,10 @@
         this.total = res.data.total
         this.listLoading = false
       },
+      handleApply(id) {
+        this.$refs.applyContract.form.id = id
+        this.$refs.applyContract.visible = true
+      },
       reset() {
         this.queryForm = {
           pageNum: 1,