|
|
@ -143,8 +143,17 @@ |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-edit" |
|
|
|
@click="handleUpdate(scope.row)" |
|
|
|
@click="handleUpdate(scope.row, true)" |
|
|
|
v-if="scope.row.status !== '0'" |
|
|
|
>{{ formatStatusText(scope.row) }}</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-edit" |
|
|
|
@click="handleUpdate(scope.row, true)" |
|
|
|
v-hasPermi="['df:bzhjs:edit']" |
|
|
|
v-if="scope.row.status == 0 || scope.row.status == null" |
|
|
|
>自评审核</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
@ -153,6 +162,11 @@ |
|
|
|
icon="el-icon-delete" |
|
|
|
@click="handleDelete(scope.row)" |
|
|
|
v-hasPermi="['df:bzhjs:remove']" |
|
|
|
v-if=" |
|
|
|
scope.row.status == 0 || |
|
|
|
scope.row.status == 2 || |
|
|
|
scope.row.status == null |
|
|
|
" |
|
|
|
>删除</el-button |
|
|
|
> |
|
|
|
</template> |
|
|
@ -178,7 +192,11 @@ |
|
|
|
> |
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
|
|
|
<el-form-item label="堤防名称" prop="dikeCode"> |
|
|
|
<linkDike :form="form" v-if="open" /> |
|
|
|
<linkDike |
|
|
|
:form="form" |
|
|
|
v-if="open" |
|
|
|
:disabled="!(statusBtnShow(['0', '2']) || !this.form.status)" |
|
|
|
/> |
|
|
|
<!-- <el-select |
|
|
|
v-model="form.dikeCode" |
|
|
|
placeholder="请选择堤防名称" |
|
|
@ -194,7 +212,10 @@ |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="验收申请" prop="acceptanceAttachment"> |
|
|
|
<myUpload :fileList="fileList1" /> |
|
|
|
<myUpload |
|
|
|
:fileList="fileList1" |
|
|
|
:disabled="!(statusBtnShow(['0', '2']) || !this.form.status)" |
|
|
|
/> |
|
|
|
<!-- <el-upload |
|
|
|
class="upload-demo" |
|
|
|
:action="uploadUrl" |
|
|
@ -582,8 +603,39 @@ |
|
|
|
</table> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="ipt-wrap" v-if="statusBtnShow(['1', '2', '3', '4'])"> |
|
|
|
<div class="listTitle"> |
|
|
|
<span>意见</span> |
|
|
|
</div> |
|
|
|
<el-input |
|
|
|
type="textarea" |
|
|
|
:rows="3" |
|
|
|
placeholder="请输入意见" |
|
|
|
v-model="form.auditOpinion" |
|
|
|
:disabled="!statusBtnShow(['1', '2'])" |
|
|
|
> |
|
|
|
</el-input> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
@click="submitForm()" |
|
|
|
v-if="statusBtnShow(['0', '1', '2', '3'])" |
|
|
|
>{{ formatBtnText() }}</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
type="warning" |
|
|
|
@click="submitForm(true)" |
|
|
|
v-if="statusBtnShow(['1'])" |
|
|
|
>驳 回</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
@click="submitForm()" |
|
|
|
v-if="statusBtnShow(['0']) || !this.form.status" |
|
|
|
>确 定</el-button |
|
|
|
> |
|
|
|
<el-button @click="cancel">取 消</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
@ -657,7 +709,9 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 表单参数 |
|
|
|
form: {}, |
|
|
|
form: { |
|
|
|
// status: "0", //新增 |
|
|
|
}, |
|
|
|
// 表单校验 |
|
|
|
rules: { |
|
|
|
dikeCode: [ |
|
|
@ -675,8 +729,17 @@ export default { |
|
|
|
reason: {}, |
|
|
|
}, |
|
|
|
totalScore: 0, |
|
|
|
statusHandle: false, |
|
|
|
statusType: { |
|
|
|
0: "新增", |
|
|
|
1: "已上报", |
|
|
|
2: "被驳回", |
|
|
|
3: "审核通过", |
|
|
|
4: "已备案", |
|
|
|
}, |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: {}, |
|
|
|
created() { |
|
|
|
this.getList(); |
|
|
|
this.getEval(); |
|
|
@ -745,6 +808,7 @@ export default { |
|
|
|
score: {}, |
|
|
|
reason: {}, |
|
|
|
}; |
|
|
|
this.reset(); |
|
|
|
}, |
|
|
|
/** 查询堤防标准化建设列表 */ |
|
|
|
getList() { |
|
|
@ -766,6 +830,7 @@ export default { |
|
|
|
// 取消按钮 |
|
|
|
cancel() { |
|
|
|
this.open = false; |
|
|
|
this.statusHandle = false; |
|
|
|
this.reset(); |
|
|
|
}, |
|
|
|
// 表单重置 |
|
|
@ -780,6 +845,7 @@ export default { |
|
|
|
createTime: null, |
|
|
|
updateUid: null, |
|
|
|
updateTime: null, |
|
|
|
status: null, |
|
|
|
}; |
|
|
|
this.resetForm("form"); |
|
|
|
}, |
|
|
@ -831,8 +897,45 @@ export default { |
|
|
|
this.open = true; |
|
|
|
this.title = "添加堤防标准化建设"; |
|
|
|
}, |
|
|
|
formatStatusText(row) { |
|
|
|
console.log("formatStatusText", row); |
|
|
|
let status = row.status; |
|
|
|
return this.statusType[status]; |
|
|
|
}, |
|
|
|
|
|
|
|
formatBtnText() { |
|
|
|
let data = this.form; |
|
|
|
let status = JSON.parse(JSON.stringify(data.status)); |
|
|
|
switch (status) { |
|
|
|
case "0": |
|
|
|
return "上 报"; |
|
|
|
case "1": |
|
|
|
return "审 核"; |
|
|
|
case "2": |
|
|
|
return "重新上报"; |
|
|
|
case "3": |
|
|
|
return "备 案"; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
statusBtnShow(typeList) { |
|
|
|
console.log("statusBtnShowtypeList", typeList); |
|
|
|
console.log("statusBtnShowform", this.form); |
|
|
|
console.log("-----------"); |
|
|
|
|
|
|
|
// let data = this.form; |
|
|
|
let data = JSON.parse(JSON.stringify(this.form)); |
|
|
|
// let status = JSON.parse(JSON.stringify(data.status)); |
|
|
|
if (data.status) { |
|
|
|
return typeList.includes(data.status); |
|
|
|
} else { |
|
|
|
return false; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
/** 修改按钮操作 */ |
|
|
|
handleUpdate(row) { |
|
|
|
handleUpdate(row, statusHandle = false) { |
|
|
|
this.statusHandle = statusHandle; |
|
|
|
this.reset(); |
|
|
|
const id = row.id || this.ids; |
|
|
|
getBzhjs(id).then((response) => { |
|
|
@ -848,14 +951,28 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
/** 提交按钮 */ |
|
|
|
submitForm() { |
|
|
|
submitForm(status) { |
|
|
|
this.form.acceptanceAttachment = this.fileList1.length |
|
|
|
? JSON.stringify(this.fileList1) |
|
|
|
: null; |
|
|
|
this.$refs["form"].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
console.log("----------", status); |
|
|
|
// return; |
|
|
|
this.form.score = JSON.stringify(this.evalForm); |
|
|
|
if (this.form.id != null) { |
|
|
|
if (this.statusHandle) { |
|
|
|
if (status) { |
|
|
|
this.form.status = "2"; |
|
|
|
} else if (this.form.status == "2") { |
|
|
|
this.form.status = "1"; |
|
|
|
} else if (this.form.status == "1") { |
|
|
|
this.form.status = "3"; |
|
|
|
} else { |
|
|
|
this.form.status = parseInt(this.form.status) + 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
updateBzhjs(this.form).then((response) => { |
|
|
|
if (response.code === 200) { |
|
|
|
this.msgSuccess("修改成功"); |
|
|
@ -864,6 +981,8 @@ export default { |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.form.status = "0"; |
|
|
|
this.form.auditOpinion = ""; |
|
|
|
addBzhjs(this.form).then((response) => { |
|
|
|
if (response.code === 200) { |
|
|
|
this.msgSuccess("新增成功"); |
|
|
@ -982,6 +1101,10 @@ export default { |
|
|
|
margin-top: 0; |
|
|
|
} |
|
|
|
|
|
|
|
.ipt-wrap { |
|
|
|
margin-top: 30px; |
|
|
|
} |
|
|
|
|
|
|
|
.tableBox { |
|
|
|
height: 600px; |
|
|
|
overflow-y: auto; |
|
|
|