浏览代码

项目授权调整

qymljy 2 年之前
父节点
当前提交
5f31825937

+ 145 - 65
src/HDrpManagement/projectChange/components/auditAuthorization.vue

@@ -9,44 +9,64 @@
         append-to-body
         :show-close="false"
         @close="onClose">
-      <div class="drawer__panel">
-        <el-row :gutter="10">
-          <el-form :model="form" :rules="rules" ref="form" label-width="125px" label-position="right" size="mini">
-            <el-col :span="24">
-              <el-form-item label="项目名称:" prop="projectname">
-                <el-input v-model="projectname" placeholder="请输入项目名称" disabled></el-input>
-              </el-form-item>
+      <div class="drawer__panel" v-if="auditList.length > 0">
+        <div style="border: 1px solid #c4c4c4;margin-bottom: 20px" v-for="(item,index) in auditList" :key="item.rowindex">
+          <el-row :gutter="10" style="margin: 20px 0 20px 0">
+            <el-col :span="11" :offset="1">
+              <span style="font-size: 14px">
+                发起授权人:{{item.initiateauthby}}
+              </span>
             </el-col>
-            <el-col :span="24">
-              <el-form-item label="客户名称:" prop="enterprisename">
-                  <el-input v-model="form.enterprisename"  placeholder="请选择客户" disabled></el-input>
-              </el-form-item>
+            <el-col :span="11">
+              <span style="font-size: 14px">
+                发起时间:{{item.initiateauthdate}}
+              </span>
             </el-col>
-            <el-col :span="24">
-              <el-form-item label="授权书有效期:" prop="date">
-                <el-date-picker
-                    @change="changeDate"
-                    v-model="form.date"
-                    value-format="yyyy-MM-dd"
-                    type="daterange"
-                    range-separator="至"
-                    start-placeholder="开始日期"
-                    end-placeholder="结束日期">
-                </el-date-picker>
-              </el-form-item>
+          </el-row>
+          <el-row :gutter="10">
+            <el-form :model="form" :rules="rules" ref="form" label-width="125px" label-position="right" size="mini">
+              <el-col :span="23">
+                <el-form-item label="项目名称:" >
+                  <el-input v-model="item.projectname" placeholder="请输入项目名称" disabled></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="23">
+                <el-form-item label="客户名称:" :rules="{ required: true, message: '请选择客户', trigger: 'change'}">
+                  <el-input v-model="item.enterprisename"  placeholder="请选择客户" disabled></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="23">
+                <el-form-item label="授权书有效期:"  :rules="{ required: true, message: '请选择授权书有效期', trigger: 'change'}">
+                  <el-date-picker
+                      @change="changeDate"
+                      v-model="dateList[index]"
+                      :clearable="false"
+                      value-format="yyyy-MM-dd"
+                      type="daterange"
+                      range-separator="至"
+                      start-placeholder="开始日期"
+                      end-placeholder="结束日期">
+                  </el-date-picker>
+                </el-form-item>
+              </el-col>
+            </el-form>
+          </el-row>
+          <el-row :gutter="10" style="margin: 0 0 20px 0">
+            <el-col :span="11" :offset="1">
+              <span style="color: #3874f6;font-size: 14px" @click="queryAudit(item)">预览授权书</span>
             </el-col>
-            <el-col :span="24">
-              <el-form-item >
-                <span style="color: #3874f6" @click="queryAudit">预览授权书</span>
-              </el-form-item>
-            </el-col>
-          </el-form>
-        </el-row>
+          </el-row>
+          <div style="text-align: center;margin-bottom: 20px">
+            <el-button size="small" type="warning" @click="noPass(item)" class="normal-btn-width">不通过</el-button>
+            <el-button size="small" type="primary"  @click="onApproved(item)" class="normal-btn-width">审核通过</el-button>
+          </div>
+        </div>
+      </div>
+      <div class="drawer__panel" v-else>
+        <el-empty description="暂无记录" :image-size="40"></el-empty>
       </div>
-      <div class="fixed__btn__panel">
+      <div  class="fixed__btn__panel">
         <el-button  size="small" @click="onClose" class="normal-btn-width inline-16">取 消</el-button>
-        <el-button size="small" type="warning" @click="noPass" class="normal-btn-width">不通过</el-button>
-        <el-button size="small" type="primary"  @click="onApproved" class="normal-btn-width">审核通过</el-button>
       </div>
     </el-drawer>
   </div>
@@ -67,6 +87,8 @@ export default {
       list:[],
       tablecols:[],
       total:0,
+      auditList:[],
+      dateList:[],
       form:{
         "enterprisename":'',
         "sa_projectid": '',
@@ -76,6 +98,17 @@ export default {
         "date":[],
         "isPass": 1
       },
+      param:{
+        "id": 20230816124004,
+        "content": {
+          "sa_projectid":'',
+          "pageNumber": 1,
+          "pageSize": 999,
+          "where": {
+            "condition": ""
+          }
+        }
+      },
       rules:{
         enterprisename:[
           { required: true, message: '请选择客户', trigger: 'change'},
@@ -89,13 +122,25 @@ export default {
   methods:{
     visibleShow(){
       this.formVisible = true
-      this.projectname = this.data.projectname
+      this.listData()
+      /*this.projectname = this.data.projectname
       this.form.sa_projectid = this.data.sa_projectid
       this.form.sys_enterpriseid = this.data.sys_enterpriseid
       this.form.enterprisename = this.data.enterprisename
       this.form.begdate = this.data.begdate_auth
       this.form.enddate = this.data.enddate_auth
-      this.form.date = [this.data.begdate_auth,this.data.enddate_auth]
+      this.form.date = [this.data.begdate_auth,this.data.enddate_auth]*/
+    },
+    async listData(){
+      this.param.content.sa_projectid = this.$route.query.id
+      const res = await this.$api.requested(this.param)
+      console.log(res.data,'可审核授权')
+      this.auditList = res.data
+      res.data.forEach((item,index)=>{
+        this.dateList[index] = [item.begdate_auth,item.enddate_auth]
+      })
+      console.log(this.dateList)
+
     },
     changeDate(){
       console.log(this.form.date)
@@ -103,7 +148,8 @@ export default {
       this.form.enddate = this.form.date[1]
     },
     /*授权预览*/
-    async queryAudit(){
+    async queryAudit(item){
+      console.log(item)
       const res = await this.$api.requested({
         "id": 20221213094501,
         "content": {
@@ -114,53 +160,87 @@ export default {
       let page = this.$router.resolve({
         path:res.data,
         query: {
-          begdate: this.form.begdate,
-          enddate: this.form.enddate,
-          enterprisename:this.form.enterprisename
+          begdate: item.begdate_auth,
+          enddate: item.enddate_auth,
+          enterprisename:item.enterprisename
         }
       })
       page.href = page.href.replace(/#\//g,'')
       window.open('http://61.164.207.46:8000/' + page.href, '_blank');
       /*window.open('https://oms.idcgroup.com.cn:8079/' + page.href, '_blank');*/
     },
-    onApproved(){
-      console.log(this.form,'form表单')
-      this.$refs.form.validate(async (valid)=>{
-        if (!valid) return false
-        this.form.isPass = 1
-        this.form.begdate = this.form.date[0]
-        this.form.enddate = this.form.date[1]
+    open() {
+      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.$message({
+          type: 'success',
+          message: '删除成功!'
+        });
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        });
+      });
+    },
+    onApproved(item){
+      this.$confirm('该项目授权申请确认通过?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        closeOnClickModal:false,
+        type: 'warning'
+      }).then(async () => {
         const res = await this.$api.requested({
-          "id": 20230810161804,
-          "content": this.form
+          "id": "20230810161804",
+          "content": {
+            "sa_project_authorizationid":item.sa_project_authorizationid,
+            "begdate": item.begdate_auth,
+            "enddate": item.enddate_auth,
+            "isPass":"1"
+          }
         })
         this.tool.showMessage(res,()=>{
-          this.$emit('onSuccess')
-          this.formVisible = false
-          this.$refs.form.resetFields()
+          this.listData()
         })
-      })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消'
+        });
+      });
     },
-    noPass(){
-      this.$refs.form.validate(async (valid)=>{
-        if (!valid) return false
-        this.form.isPass = 0
-        this.form.begdate = this.form.date[0]
-        this.form.enddate = this.form.date[1]
+    noPass(item){
+      this.$confirm('该项目授权申请确认不通过?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        closeOnClickModal:false,
+        type: 'warning'
+      }).then(async () => {
         const res = await this.$api.requested({
-          "id": 20230810161804,
-          "content": this.form
+          "id": "20230810161804",
+          "content": {
+            "sa_project_authorizationid":item.sa_project_authorizationid,
+            "begdate": item.begdate_auth,
+            "enddate": item.enddate_auth,
+            "isPass":"0"
+          }
         })
         this.tool.showMessage(res,()=>{
-          this.$emit('onSuccess')
-          this.formVisible = false
-          this.$refs.form.resetFields()
+          this.listData()
         })
-      })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消'
+        });
+      });
     },
     onClose(){
       this.formVisible = false
-      this.$refs.form.resetFields()
+      this.$emit('onSuccess')
     }
   },
   created() {

+ 174 - 0
src/HDrpManagement/projectChange/components/auditAuthorizationCopy.vue

@@ -0,0 +1,174 @@
+<template>
+  <div>
+    <el-button :type="auditTag  !== '授权中' || data.status === '已失败' || data.status === '已结案' ?'':'primary'" size="mini" @click="visibleShow" :disabled="auditTag !== '授权中' || data.status === '已失败' || data.status === '已结案'">审核授权</el-button>
+    <el-drawer
+        title="审核授权"
+        :visible.sync="formVisible"
+        size="700px"
+        direction="rtl"
+        append-to-body
+        :show-close="false"
+        @close="onClose">
+      <div class="drawer__panel">
+        <el-row :gutter="10">
+          <el-form :model="form" :rules="rules" ref="form" label-width="125px" label-position="right" size="mini">
+            <el-col :span="24">
+              <el-form-item label="项目名称:" prop="projectname">
+                <el-input v-model="projectname" placeholder="请输入项目名称" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="客户名称:" prop="enterprisename">
+                  <el-input v-model="form.enterprisename"  placeholder="请选择客户" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="授权书有效期:" prop="date">
+                <el-date-picker
+                    @change="changeDate"
+                    v-model="form.date"
+                    value-format="yyyy-MM-dd"
+                    type="daterange"
+                    range-separator="至"
+                    start-placeholder="开始日期"
+                    end-placeholder="结束日期">
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item >
+                <span style="color: #3874f6" @click="queryAudit">预览授权书</span>
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </el-row>
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button  size="small" @click="onClose" class="normal-btn-width inline-16">取 消</el-button>
+        <el-button size="small" type="warning" @click="noPass" class="normal-btn-width">不通过</el-button>
+        <el-button size="small" type="primary"  @click="onApproved" class="normal-btn-width">审核通过</el-button>
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import tableList from '@/components/table/index5';
+export default {
+  /*审核授权*/
+  name: "auditAuthorization",
+  props:["data","auditTag"],
+  components:{tableList},
+  data(){
+    return {
+      formVisible:false,
+      projectname:"",
+      popoverShow:'',
+      list:[],
+      tablecols:[],
+      total:0,
+      form:{
+        "enterprisename":'',
+        "sa_projectid": '',
+        "begdate": "",
+        "enddate": "",
+        "sys_enterpriseid": '',
+        "date":[],
+        "isPass": 1
+      },
+      rules:{
+        enterprisename:[
+          { required: true, message: '请选择客户', trigger: 'change'},
+        ],
+        date:[
+          { required: true, message: '请选择授权书有效期', trigger: 'change'},
+        ],
+      }
+    }
+  },
+  methods:{
+    visibleShow(){
+      this.formVisible = true
+      this.projectname = this.data.projectname
+      this.form.sa_projectid = this.data.sa_projectid
+      this.form.sys_enterpriseid = this.data.sys_enterpriseid
+      this.form.enterprisename = this.data.enterprisename
+      this.form.begdate = this.data.begdate_auth
+      this.form.enddate = this.data.enddate_auth
+      this.form.date = [this.data.begdate_auth,this.data.enddate_auth]
+    },
+    changeDate(){
+      console.log(this.form.date)
+      this.form.begdate = this.form.date[0]
+      this.form.enddate = this.form.date[1]
+    },
+    /*授权预览*/
+    async queryAudit(){
+      const res = await this.$api.requested({
+        "id": 20221213094501,
+        "content": {
+          "sys_reportid": 104,
+          "dataid": this.$route.query.id
+        },
+      })
+      let page = this.$router.resolve({
+        path:res.data,
+        query: {
+          begdate: this.form.begdate,
+          enddate: this.form.enddate,
+          enterprisename:this.form.enterprisename
+        }
+      })
+      page.href = page.href.replace(/#\//g,'')
+      window.open('http://61.164.207.46:8000/' + page.href, '_blank');
+      /*window.open('https://oms.idcgroup.com.cn:8079/' + page.href, '_blank');*/
+    },
+    onApproved(){
+      console.log(this.form,'form表单')
+      this.$refs.form.validate(async (valid)=>{
+        if (!valid) return false
+        this.form.isPass = 1
+        this.form.begdate = this.form.date[0]
+        this.form.enddate = this.form.date[1]
+        const res = await this.$api.requested({
+          "id": 20230810161804,
+          "content": this.form
+        })
+        this.tool.showMessage(res,()=>{
+          this.$emit('onSuccess')
+          this.formVisible = false
+          this.$refs.form.resetFields()
+        })
+      })
+    },
+    noPass(){
+      this.$refs.form.validate(async (valid)=>{
+        if (!valid) return false
+        this.form.isPass = 0
+        this.form.begdate = this.form.date[0]
+        this.form.enddate = this.form.date[1]
+        const res = await this.$api.requested({
+          "id": 20230810161804,
+          "content": this.form
+        })
+        this.tool.showMessage(res,()=>{
+          this.$emit('onSuccess')
+          this.formVisible = false
+          this.$refs.form.resetFields()
+        })
+      })
+    },
+    onClose(){
+      this.formVisible = false
+      this.$refs.form.resetFields()
+    }
+  },
+  created() {
+    this.tablecols = this.tool.tabelCol(this.$route.name).customerTable.tablecols
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 2 - 2
src/HDrpManagement/projectChange/components/initiateAuthorization.vue

@@ -1,8 +1,8 @@
 <template>
   <div>
-    <el-button :type="!disabled || flagTag !== 2 || auditTag === '已授权' || data.status === '已失败' || data.status === '已结案' ?'':'primary'" size="mini" @click="visibleShow" :disabled="!disabled || flagTag !== 2 || auditTag === '已授权' || data.status === '已失败' || data.status === '已结案'">发起授权</el-button>
+    <el-button :type="!disabled || flagTag !== 2  || data.status === '已失败' || data.status === '已结案' ?'':'primary'" size="mini" @click="visibleShow" :disabled="!disabled || flagTag !== 2  || data.status === '已失败' || data.status === '已结案'">发起授权</el-button>
     <el-drawer
-        title="新建项目商机"
+        title="发起授权"
         :visible.sync="formVisible"
         size="700px"
         direction="rtl"

+ 1 - 1
src/HDrpManagement/projectChange/modules/detail.vue

@@ -323,7 +323,7 @@ export default {
             break
           }else if (res.data.systemtag[k] === '已授权'){
             this.auditTag = '已授权'
-            break
+
           }else {
             this.auditTag = ""
           }

+ 2 - 2
src/components/attachment_list/index.vue

@@ -43,11 +43,11 @@
           </div>
           <div v-else>
             <el-button type="text" size="small" @click="download(scope.row)" :disabled="status === '已失败' || status === '已结案'">下 载</el-button>
-            <el-button :disabled="onlyread || status === '已失败' || status === '已结案'" class="inline-16" type="text" size="small" @click="editAttachment(scope.row)" >编 辑</el-button>
+            <el-button :disabled="onlyread || status === '已失败' || status === '已结案' || scope.row.document.match('授权书【IBP')" class="inline-16" type="text" size="small" @click="editAttachment(scope.row)" >编 辑</el-button>
             <el-popconfirm
               title="确定删除当前附件吗?"
               @confirm="deleteAttachment(scope.row)">
-              <el-button :disabled="onlyread || status === '已失败' || status === '已结案'" slot="reference" size="small" type="text" >删 除</el-button>
+              <el-button :disabled="onlyread || status === '已失败' || status === '已结案' || scope.row.document.match('授权书【IBP')" slot="reference" size="small" type="text" >删 除</el-button>
             </el-popconfirm>
           </div>
         </template>