Browse Source

update

master_tdsql
awsl 1 month ago
parent
commit
96dca4f599
  1. 3
      src/components/linkNameSelect/linkDike.vue
  2. 7
      src/components/myUpload/index.vue
  3. 137
      src/views/dike/managementGuarantee/standardizationConstruction/listPage/index.vue

3
src/components/linkNameSelect/linkDike.vue

@ -36,6 +36,7 @@
:remote-method="remoteMethod" :remote-method="remoteMethod"
:loading="loading" :loading="loading"
@change="handleChange" @change="handleChange"
:disabled="disabled"
> >
<el-option <el-option
v-for="dict in dikeNameOptions" v-for="dict in dikeNameOptions"
@ -50,7 +51,7 @@
<script> <script>
import { listJbxx, getJbxx } from "@/api/yg/dike/jbxx"; import { listJbxx, getJbxx } from "@/api/yg/dike/jbxx";
export default { export default {
props: ["form", "isMultiple"], props: ["form", "isMultiple",'disabled'],
data() { data() {
return { return {
loading: false, loading: false,

7
src/components/myUpload/index.vue

@ -11,8 +11,9 @@
:on-exceed="handleExceed" :on-exceed="handleExceed"
:on-success="submitUpload" :on-success="submitUpload"
:file-list="fileList" :file-list="fileList"
:disabled="disabled"
> >
<el-button size="small" type="primary" plain> <el-button size="small" type="primary" plain :disabled="disabled">
<i class="el-icon-upload el-icon--right"></i> <i class="el-icon-upload el-icon--right"></i>
点击上传 点击上传
</el-button> </el-button>
@ -32,6 +33,10 @@ export default {
return []; return [];
}, },
}, },
disabled:{
type:Boolean,
default:false
}
}, },
data() { data() {
return { return {

137
src/views/dike/managementGuarantee/standardizationConstruction/listPage/index.vue

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

Loading…
Cancel
Save