Browse Source

Merge branch 'release-sy-v1.0.0' into 'dev'

Release sy v1.0.0

See merge request project/water/shuili-vue!70
master_tdsql
潘裕艺 1 year ago
parent
commit
80ff7734e8
  1. 289
      src/views/dike/runManage/pestAnimalControl/governanceRecords/index.vue
  2. 6
      src/views/dike/runManage/superVisionInspetion/methodsManage/index.vue
  3. 2
      src/views/dike/runManage/superVisionInspetion/projectManage/projectReportPage.vue
  4. 5
      src/views/dike/runManage/superVisionInspetion/tasksManage/index.vue

289
src/views/dike/runManage/pestAnimalControl/governanceRecords/index.vue

@ -14,15 +14,18 @@ import {
updateDikeAnimalRecordData, updateDikeAnimalRecordData,
getDikeAnimalRecordDetails, getDikeAnimalRecordDetails,
deleteDikeAnimalRecordDetails, deleteDikeAnimalRecordDetails,
updateDikeAnimalRecordStatus,
} from "@/api/dike"; } from "@/api/dike";
import { uploadFileData } from "@/api/system/upload";
export default { export default {
name: "InspectionItems", name: "InspectionItems",
data() { data() {
return { return {
paramsData: { paramsData: {
status: "", status: null,
location: "", location: null,
}, },
dialogVisible: false, dialogVisible: false,
imageDialog: false, imageDialog: false,
@ -79,9 +82,9 @@ export default {
drugs: [{ drugName: "", concentration: "", dose: "" }], // drugs: [{ drugName: "", concentration: "", dose: "" }], //
}, },
planRules: { planRules: {
planId: [{ required: true, message: "请选择计划", trigger: "blur" }], planId: [{ required: true, message: "请选择计划", trigger: "change" }],
dikeCode: [ dikeCode: [
{ required: true, message: "请选择堤防名称", trigger: "blur" }, { required: true, message: "请选择堤防名称", trigger: "change" },
], ],
type: [{ required: true, message: "请选择计划", trigger: "change" }], type: [{ required: true, message: "请选择计划", trigger: "change" }],
month: [{ required: true, message: "请选择月份", trigger: "change" }], month: [{ required: true, message: "请选择月份", trigger: "change" }],
@ -181,81 +184,85 @@ export default {
type: "warning", type: "warning",
}) })
.then(() => { .then(() => {
// updateDikeAnimalRecordStatus({
// this.$message({ id: row.id,
// type: "success", status: "1",
// message: "!", }).then(() => {
// }); this.getTableData();
this.$message({
type: "success",
message: "确认成功!",
});
});
}) })
.catch(() => {}); .catch(() => {});
}, },
// //
viewOrEditPlanDetails(row, edit = false) { viewOrEditPlanDetails(row, edit = false) {
this.handleGetRemotePlanData("");
if (!edit) { if (!edit) {
this.prohibitEditing = true; this.prohibitEditing = true;
} }
getDFMaintenancePlan(row.id).then((res) => { getDFPreventionControlPlan(row.planId).then((res) => {
if (res.data) { if (res.data) {
this.planForm = res.data; this.planForm = res.data;
this.planForm.planName = res.data.name;
this.planForm.planId = res.data.id;
this.planForm.selectUser = res.data.otherConfig.selectUser;
// this.planForm.reminderCycle = res.data.instruction + res.data.month; // ?????? // this.planForm.reminderCycle = res.data.instruction + res.data.month; // ??????
this.dialogVisible = true; this.dialogVisible = true;
this.recordForm.id = row.id;
} }
}); });
getDikeAnimalRecordDetails(row.id).then((res) => { getDikeAnimalRecordDetails(row.id).then((res) => {
this.recordForm.id = row.id;
this.recordForm = res.data || this.recordForm; this.recordForm = res.data || this.recordForm;
}); });
},
handleRemove(file) { console.log("查看 >>>> ", this.planList);
console.log(file);
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.imageDialog = true;
},
handleDownload(file) {
console.log(file);
}, },
// //
submitForm(formName) { submitForm() {
console.log("this.planForm >>>>> ", this.planForm); this.$refs.planForm.validate((v) => {
this.$refs[formName].validate((valid) => { if (v) {
if (valid) { this.$refs.recordForm.validate((valid) => {
if (this.planForm.id) { if (valid) {
updateDikeAnimalRecordData({ if (this.planForm.id) {
planId: this.planForm.planId, updateDikeAnimalRecordData({
planName: this.planForm.name, planId: this.planForm.planId,
id: this.$route.query.id, planName: this.planForm.name,
dikeCode: this.$route.query.dikeCode, id: this.$route.query.id,
...this.recordForm, dikeCode: this.$route.query.dikeCode,
}).then(() => { ...this.recordForm,
this.getTableData(); }).then(() => {
this.dialogVisible = false; this.getTableData();
this.$message({ this.dialogVisible = false;
message: "保存成功", this.$message({
type: "success", message: "保存成功",
}); type: "success",
}); });
} else { });
addDikeAnimalRecordData({ } else {
planId: this.planForm.planId, addDikeAnimalRecordData({
planName: this.planForm.name, planId: this.planForm.planId,
id: null, planName: this.planForm.name,
status: "0", id: null,
dikeCode: this.$route.query.dikeCode, status: "0",
...this.recordForm, dikeCode: this.$route.query.dikeCode,
}).then(() => { ...this.recordForm,
this.getTableData(); }).then(() => {
this.dialogVisible = false; this.getTableData();
this.$message({ this.dialogVisible = false;
message: "保存成功", this.$message({
type: "success", message: "保存成功",
}); type: "success",
}); });
} });
} else { }
console.log("校验不通过"); } else {
return false; console.log("校验不通过");
return false;
}
});
} }
}); });
}, },
@ -265,9 +272,9 @@ export default {
this.dialogVisible = false; this.dialogVisible = false;
}, },
// dialog // dialog
closeDialog(planForm = "planForm") { closeDialog() {
console.log("触发关闭dialog", planForm); this.$refs.recordForm.resetFields();
this.$refs[planForm].resetFields(); this.$refs.planForm.resetFields();
this.planForm = { this.planForm = {
dikeCode: "", dikeCode: "",
name: "", name: "",
@ -277,6 +284,15 @@ export default {
location: "", location: "",
content: "", content: "",
}; };
this.recordForm = {
id: null,
location: "",
constructionStatus: "",
pest: null,
images: [],
remark: "",
drugs: [{ drugName: "", concentration: "", dose: "" }], //
};
}, },
// //
addWorkItem() { addWorkItem() {
@ -308,8 +324,8 @@ export default {
}, },
// //
resetSearch() { resetSearch() {
this.paramsData.status = ""; this.paramsData.status = null;
this.paramsData.location = ""; this.paramsData.location = null;
this.getTableData(); this.getTableData();
}, },
// //
@ -338,7 +354,6 @@ export default {
changeDikePlan(planId) { changeDikePlan(planId) {
if (planId) { if (planId) {
getDFPreventionControlPlan(planId).then((res) => { getDFPreventionControlPlan(planId).then((res) => {
console.log("res >>>>> ", res);
if (res?.data) { if (res?.data) {
const { data } = res; const { data } = res;
this.planForm.dikeCode = data.dikeCode; this.planForm.dikeCode = data.dikeCode;
@ -356,6 +371,30 @@ export default {
}); });
} }
}, },
//
beforeUpload(e) {
if (this.recordForm.images?.length >= 10) {
this.$message.warning("最多上传10张图片");
return false;
}
return true;
},
handleUpload(e) {
const { file } = e;
let fData = new FormData();
fData.append("file", file);
uploadFileData(fData)
.then((res) => {
this.recordForm.images?.push(res.url);
})
.catch((err) => {
console.log("err >>>>> ", err);
});
},
//
handleDelImages(index) {
this.recordForm.images.splice(index, 1);
},
}, },
mounted() { mounted() {
this.getDicts("dh_jh_type").then((res) => { this.getDicts("dh_jh_type").then((res) => {
@ -392,7 +431,7 @@ export default {
/> />
<span style="margin-left: 10px">状态</span> <span style="margin-left: 10px">状态</span>
<el-select v-model="paramsData.status" placeholder="请选择"> <el-select v-model="paramsData.status" placeholder="请选择">
<el-option label="全部" value="" /> <el-option label="全部" :value="null" />
<el-option <el-option
v-for="item in statusList" v-for="item in statusList"
:label="item.dictLabel" :label="item.dictLabel"
@ -463,9 +502,9 @@ export default {
>编辑</el-button >编辑</el-button
> >
<el-button <el-button
style="margin-right: 9px"
type="text" type="text"
size="small" size="small"
v-if="scope.row.status == '0'"
@click="handleConfirm(scope.row)" @click="handleConfirm(scope.row)"
v-hasPermi="['df:run:fz:record:confirm']" v-hasPermi="['df:run:fz:record:confirm']"
>确认</el-button >确认</el-button
@ -479,7 +518,7 @@ export default {
@confirm="deleteTableItem(scope.row)" @confirm="deleteTableItem(scope.row)"
> >
<el-button <el-button
style="color: red" style="color: red; margin-left: 9px"
type="text" type="text"
size="small" size="small"
slot="reference" slot="reference"
@ -831,20 +870,29 @@ export default {
/> />
<el-table-column prop="drugName" align="center" label="药物名称"> <el-table-column prop="drugName" align="center" label="药物名称">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.drugName" placeholder="请输入药物名称" /> <el-input
v-model="scope.row.drugName"
maxLength="100"
placeholder="请输入药物名称"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="concentration" align="center" label="浓度"> <el-table-column prop="concentration" align="center" label="浓度">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
v-model="scope.row.concentration" v-model="scope.row.concentration"
maxLength="100"
placeholder="请输入浓度" placeholder="请输入浓度"
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="dose" align="center" label="剂量" width="80"> <el-table-column prop="dose" align="center" label="剂量" width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.dose" placeholder="请输入剂量" /> <el-input
v-model="scope.row.dose"
maxLength="100"
placeholder="请输入剂量"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作" width="100"> <el-table-column align="center" label="操作" width="100">
@ -854,6 +902,7 @@ export default {
type="text" type="text"
size="small" size="small"
@click="addWorkItem" @click="addWorkItem"
:disabled="recordForm.drugs.length >= 10"
>添加</el-button >添加</el-button
> >
<el-popconfirm <el-popconfirm
@ -877,39 +926,51 @@ export default {
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-form-item label-width="120px" label="上传图片" prop="images"> <el-form-item label-width="120px" label="上传图片" prop="images">
<el-upload action="#" list-type="picture-card" :auto-upload="false"> <div class="flex flex-wrap">
<i slot="default" class="el-icon-plus"></i> <div
<div slot="file" slot-scope="{ file }"> style="width: 148px; height: 148px"
<img v-for="(url, index) in recordForm.images"
class="el-upload-list__item-thumbnail" :key="index"
:src="file.url" class="mr-6 mb-6 img-div-box"
alt="" >
/> <el-image
<span class="el-upload-list__item-actions"> style="width: 148px; height: 148px"
<span :src="url"
class="el-upload-list__item-preview" fit="contain"
@click="handlePictureCardPreview(file)" :preview-src-list="[url]"
> >
<i class="el-icon-zoom-in"></i> <template #error>
</span> <div
<span class="w-full flex justify-center items-center"
class="el-upload-list__item-delete" style="
@click="handleDownload(file)" height: 148px;
> border: 1px solid #f0f0f0;
<i class="el-icon-download"></i> font-style: italic;
</span> color: #ccc;
<span "
class="el-upload-list__item-delete" >
@click="handleRemove(file)" 图片加载失败
> </div>
<i class="el-icon-delete"></i> </template>
</span> </el-image>
</span> <i
class="el-icon-error del-btn-icon"
@click="handleDelImages(index)"
></i>
</div> </div>
</div>
<el-upload
action="#"
list-type="picture-card"
:http-request="handleUpload"
:auto-upload="true"
:before-upload="beforeUpload"
:showFileList="false"
accept=".jpg,.png,.jpeg"
:maxLength="10"
>
<i slot="default" class="el-icon-plus"></i>
</el-upload> </el-upload>
<el-dialog :visible.sync="imageDialog">
<img width="100%" :src="dialogImageUrl" alt="" />
</el-dialog>
</el-form-item> </el-form-item>
<el-form-item label-width="120px" label="备注" prop="remark"> <el-form-item label-width="120px" label="备注" prop="remark">
<el-input <el-input
@ -985,12 +1046,24 @@ export default {
background-color: #2b8070; background-color: #2b8070;
} }
} }
}
/deep/.el-input__count { .img-div-box {
height: 15px; position: relative;
line-height: 15px; .del-btn-icon {
margin-right: 10px; display: none;
margin-bottom: -4px; position: absolute;
top: -8px;
right: -8px;
font-size: 24px;
color: rgba(0, 0, 0, 0.5);
cursor: pointer;
}
&:hover {
.del-btn-icon {
display: block;
}
}
}
} }
</style> </style>

6
src/views/dike/runManage/superVisionInspetion/methodsManage/index.vue

@ -136,6 +136,7 @@ export default {
style="margin-right: 16px; margin-bottom: 8px; float: right" style="margin-right: 16px; margin-bottom: 8px; float: right"
type="success" type="success"
@click="handleAddMethod()" @click="handleAddMethod()"
v-hasPermi="['df:run:sup:meth:add']"
>添加</el-button >添加</el-button
> >
<el-table class="table" height="640" :data="tableData" border> <el-table class="table" height="640" :data="tableData" border>
@ -168,11 +169,13 @@ export default {
type="text" type="text"
size="small" size="small"
@click="handleEditMethod(scope.row)" @click="handleEditMethod(scope.row)"
v-hasPermi="['df:run:sup:meth:edit']"
>编辑</el-button >编辑</el-button
> >
<el-button <el-button
type="text" type="text"
size="small" size="small"
v-hasPermi="['df:run:sup:meth:view']"
@click="handlePreviewMethod(scope.row)" @click="handlePreviewMethod(scope.row)"
>预览</el-button >预览</el-button
> >
@ -180,18 +183,21 @@ export default {
type="text" type="text"
size="small" size="small"
@click="handleExportMethod(scope.row)" @click="handleExportMethod(scope.row)"
v-hasPermi="['df:run:sup:meth:down']"
>导出</el-button >导出</el-button
> >
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click="handleCopyMethod(scope.row)" @click="handleCopyMethod(scope.row)"
v-hasPermi="['df:run:sup:meth:edit']"
>复制</el-button >复制</el-button
> >
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click="handleToItemsList(scope.row)" @click="handleToItemsList(scope.row)"
v-hasPermi="['df:run:sup:meth:config']"
>配置数据项</el-button >配置数据项</el-button
> >
</template> </template>

2
src/views/dike/runManage/superVisionInspetion/projectManage/projectReportPage.vue

@ -1,7 +1,7 @@
<template> <template>
<div class="report-page"> <div class="report-page">
<div class="sticky-top flex justify-between"> <div class="sticky-top flex justify-between">
<el-button type="primary" @click="handleDownPdf">下载报告</el-button> <el-button v-hasPermi="['df:run:sup:project:down']" type="primary" @click="handleDownPdf">下载报告</el-button>
<el-button @click="$router.go(-1)">返回</el-button> <el-button @click="$router.go(-1)">返回</el-button>
</div> </div>
<div class="flex justify-center mt-16"> <div class="flex justify-center mt-16">

5
src/views/dike/runManage/superVisionInspetion/tasksManage/index.vue

@ -137,6 +137,7 @@ export default {
class="search-btn" class="search-btn"
style="margin-right: 16px; margin-bottom: 8px; float: right" style="margin-right: 16px; margin-bottom: 8px; float: right"
type="success" type="success"
v-hasPermi="['df:run:sup:task:add']"
@click="handleGoDetails()" @click="handleGoDetails()"
>添加</el-button >添加</el-button
> >
@ -153,10 +154,10 @@ export default {
/> />
<el-table-column prop="operate" align="center" label="操作"> <el-table-column prop="operate" align="center" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-hasPermi="['sz:run:jc:task:edit']" type="text" size="small" @click="handleEdit(scope.row)" <el-button v-hasPermi="['df:run:sup:task:edit']" type="text" size="small" @click="handleEdit(scope.row)"
>编辑</el-button >编辑</el-button
> >
<el-button v-hasPermi="['df:run:jc:task:delete']" type="text" size="small" @click="handleDel(scope.row)" <el-button v-hasPermi="['df:run:sup:task:delete']" type="text" size="small" @click="handleDel(scope.row)"
>删除</el-button >删除</el-button
> >
</template> </template>

Loading…
Cancel
Save