qymljy před 2 roky
rodič
revize
7d60579115

+ 156 - 2
src/HDrpManagement/projectChange/components/auditAuthorization.vue

@@ -1,13 +1,167 @@
 <template>
   <div>
-    <el-button type="primary" size="mini">审核授权</el-button>
+    <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"
+  name: "auditAuthorization",
+  props:["data","auditTag"],
+  components:{tableList},
+  data(){
+    return {
+      formVisible:false,
+      projectname:"",
+      popoverShow:'',
+      list:[],
+      tablecols:[],
+      total:0,
+      form:{
+        "enterprisename":'',
+        "sa_projectid": 4378,
+        "begdate": "2023-08-12",
+        "enddate": "2024-08-12",
+        "sys_enterpriseid": 3668,
+        "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)
+    },
+    /*授权预览*/
+    async queryAudit(){
+      const res = await this.$api.requested({
+        "id": 20221213094501,
+        "content": {
+          "sys_reportid": 104,
+          "dataid": this.$route.query.id
+        },
+      })
+      console.log(res.data,'授权书')
+      this.$router.push({
+        path: res.data,
+        query: {
+          begdate: this.form.begdate,
+          enddate: this.form.enddate,
+          enterprisename:this.form.enterprisename
+        }
+      });
+    },
+    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>
 

+ 155 - 4
src/HDrpManagement/projectChange/components/initiateAuthorization.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-button type="primary" size="mini">发起授权</el-button>
+    <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-drawer
         title="新建项目商机"
         :visible.sync="formVisible"
@@ -14,7 +14,59 @@
           <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="form.projectname" placeholder="请输入项目名称" disabled></el-input>
+                <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-popover
+                    placement="top"
+                    width="600"
+                    trigger="click"
+                    v-model="popoverShow">
+                  <el-input style="width:200px;" placeholder="搜索" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
+                  </el-input>
+                  <tableList height="600px"  style="margin-top: 10px"   :layout="tablecols" :data="list" :opwidth="200" :custom="true" @rowClick="rowClick"
+                  >
+                    <template v-slot:customcol="scope">
+                      <div v-if="scope.column.columnname === 'leader'">
+                        <span>{{scope.column.data['leader'][0]?scope.column.data['leader'][0].name:'&#45;&#45;'}}</span>
+                      </div>
+                      <p v-else>{{scope.column.data[scope.column.columnname]?scope.column.data[scope.column.columnname]:'--'}}</p>
+                    </template>
+                  </tableList>
+                  <div  class="container normal-panel" style="text-align:right">
+                    <el-pagination
+                        background
+                        @size-change="handleSizeChange"
+                        @current-change="handleCurrentChange"
+                        :current-page="param.content.pageNumber"
+                        :page-sizes="[20, 50, 100, 200]"
+                        :page-size="20"
+                        layout="total,sizes, prev, pager, next, jumper"
+                        :total="total">
+                    </el-pagination>
+                  </div>
+                  <el-input v-model="form.enterprisename" readonly slot="reference" placeholder="请选择客户" ></el-input>
+                </el-popover>
+              </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>
@@ -22,30 +74,129 @@
       </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="primary" :loading="loading" @click="onSave" class="normal-btn-width">确 定</el-button>
+        <el-button size="small" type="primary"  @click="onSave" class="normal-btn-width">确 定</el-button>
       </div>
     </el-drawer>
   </div>
 </template>
 
 <script>
+import tableList from '@/components/table/index5';
 export default {
   /*发起授权*/
   name: "initiateAuthorization",
+  props:["data","disabled","auditTag","flagTag"],
+  components:{tableList},
   data(){
     return {
       formVisible:false,
+      projectname:"",
+      popoverShow:'',
+      list:[],
+      tablecols:[],
+      total:0,
       form:{
+        "enterprisename":'',
         "sa_projectid": 4378,
         "begdate": "2023-08-12",
         "enddate": "2024-08-12",
-        "sys_enterpriseid": 3668
+        "sys_enterpriseid": 3668,
+        "date":[]
+      },
+      param:{
+        "id": 20221027143702,
+        "content": {
+          "sa_projectid":0,
+          "pageNumber": 1,
+          "pageSize": 20,
+          "where": {
+            "condition": ""
+          }
+        }
+      },
+      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.listData()
+    },
+    /*选择客户*/
+    rowClick(row){
+      this.form.sys_enterpriseid = row.sys_enterpriseid
+      this.form.enterprisename = row.enterprisename
+      this.popoverShow = false
+    },
+    /*可选客户*/
+    async listData(){
+      this.param.content.sa_projectid = this.$route.query.id
+      const res = await this.$api.requested(this.param)
+      this.list = res.data
+      this.total = res.total
+    },
+    /*授权预览*/
+    async queryAudit(){
+      const res = await this.$api.requested({
+        "id": 20221213094501,
+        "content": {
+          "sys_reportid": 104,
+          "dataid": this.$route.query.id
+        },
+      })
+      console.log(res.data,'授权书')
+      this.$router.push({
+        path: res.data,
+        query: {
+          begdate: this.form.begdate,
+          enddate: this.form.enddate,
+          enterprisename:this.form.enterprisename
+        }
+      });
+    },
+    changeDate(){
+      console.log(this.form.date)
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.param.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.listData()
+    },
+    onSave(){
+      this.$refs.form.validate(async (valid)=>{
+        if (!valid) return false
+        this.form.begdate = this.form.date[0]
+        this.form.enddate = this.form.date[1]
+        const res = await this.$api.requested({
+          "id": 20230810161704,
+          "content": this.form
+        })
+        this.tool.showMessage(res,()=>{
+          this.$emit('onSuccess')
+          this.formVisible = false
+          this.$refs.form.resetFields()
+        })
+      })
+    },
     onClose(){}
 
+  },
+  created() {
+    this.tablecols = this.tool.tabelCol(this.$route.name).customerTable.tablecols
   }
 }
 </script>

+ 16 - 4
src/HDrpManagement/projectChange/modules/detail.vue

@@ -24,10 +24,10 @@
       </div>
       <!-- <mindmap ref="mindmap" class="inline-16" :id="this.$route.query.id" name="project"></mindmap> -->
       <putPeople style=" display: inline-block !important;" @putSuccess="putSuccess" v-if="flagTag !== ''" :isbpm="isbpm" :rowData="mainData" :flagTag="flagTag" :disabled="mainData.disabled" @onClose="onSuccess"/>
-<!--      &lt;!&ndash;   发起授权   &ndash;&gt;
-      <initiate-authorization class="inline-16"></initiate-authorization>
-      &lt;!&ndash;   审核授权   &ndash;&gt;
-      <audit-authorization class="inline-16"></audit-authorization>-->
+      <!--   发起授权   -->
+      <initiate-authorization  v-if="tool.checkAuth($route.name,'initiateAuthorization')" class="inline-16" :data="mainData"  @onSuccess="onSuccess" :disabled="mainData.disabled" :auditTag="auditTag" :flagTag="flagTag" ></initiate-authorization>
+      <!--   审核授权   -->
+      <audit-authorization class="inline-16" v-if="tool.checkAuth($route.name,'auditAuthorization')" :data="mainData" @onSuccess="onSuccess" :auditTag="auditTag"></audit-authorization>
 
       <projectRecovery class="inline-16" :data="mainData" v-if="tool.checkAuth($route.name,'recovery')  && (mainData.status === '已结案' || mainData.status === '已失败')" :disabled="mainData.disabled" @onRecovery="onSuccess"></projectRecovery>
       <duplicatesProject class="inline-16" :data="mainData" v-if="tool.checkAuth($route.name,'queryDuplicates') " :disabled="mainData.disabled" @dialogClose="dialogClose"></duplicatesProject>
@@ -147,6 +147,7 @@ export default {
       userInfo:JSON.parse(window.sessionStorage.getItem('active_account')),
       nowStage:'',
       flagTag:'',
+      auditTag:'',
       flag:0,
       tagFlag:false,
       put:{
@@ -316,6 +317,17 @@ export default {
             this.flagTag = 0
           }
         }
+        for (let k=0;k<res.data.systemtag.length;k++){
+          if (res.data.systemtag[k] === '授权中'){
+            this.auditTag = '授权中'
+            break
+          }else if (res.data.systemtag[k] === '已授权'){
+            this.auditTag = '已授权'
+            break
+          }else {
+            this.auditTag = ""
+          }
+        }
       }
       this.$refs.details.$refs.tag.queryTag()
       this.put.putFlag = this.flagTag

+ 1 - 1
src/HManagement/clueManage/clue_private/modules/edit.vue

@@ -305,7 +305,7 @@ export default {
       this.form.enterprisename = this.data.enterprisename_customer
       this.form.totalinvestment !== 0 ? this.form.totalinvestment =  this.tool.formatAmount(this.form.totalinvestment,2): this.form.totalinvestment =''
       this.form.costofconstruction !== 0 ? this.form.costofconstruction =  this.tool.formatAmount(this.form.costofconstruction,2): this.form.costofconstruction =''
-      console.log(this.form,'form1111')
+      this.queryIsuppictured(JSON.parse(sessionStorage.getItem('active_account')).hrid)
       if (this.form.isuppictured === 1){
         this.uppictured = JSON.parse(sessionStorage.getItem('active_account')).name
       }else {