|
|
@@ -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:'--'}}</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>
|