From cec9008c7bdbb373c400d53330642be3891a84d5 Mon Sep 17 00:00:00 2001
From: odc.xiaohui <xiaohui@Q1>
Date: 星期五, 24 二月 2023 16:56:57 +0800
Subject: [PATCH] 2023/2/24 肖辉 屏蔽门前三包统计 修改重置按钮
---
src/components/dispatch/index.vue | 104 ++++++++++++++-------------------------------------
1 files changed, 29 insertions(+), 75 deletions(-)
diff --git a/src/components/dispatch/index.vue b/src/components/dispatch/index.vue
index 978fe10..844362f 100644
--- a/src/components/dispatch/index.vue
+++ b/src/components/dispatch/index.vue
@@ -47,9 +47,7 @@
<el-select
v-model="dispatch.enforcementTeam"
placeholder="閫夋嫨涓槦"
- :disabled="
- squadronOptions.length !== 0 && squadronOptions ? false : true
- "
+ :disabled="!(squadronOptions.length !== 0 && squadronOptions)"
@change="handleMidChange"
>
<el-option
@@ -66,9 +64,7 @@
<el-select
v-model="dispatch.lawEnforcer"
placeholder="璇烽�夋嫨浜哄憳"
- :disabled="
- personOptions.length !== 0 && personOptions ? false : true
- "
+ :disabled="!(personOptions.length !== 0 && personOptions)"
@change="handlePerChange"
>
<el-option
@@ -111,7 +107,7 @@
</div>
</el-form>
<div class="map">
- <!-- <MyMap></MyMap> -->
+ <MyMap style="width: 600px; height: 400px"></MyMap>
</div>
<div class="footer">
<el-button type="primary" @click="handleDispatch">纭畾</el-button>
@@ -120,16 +116,17 @@
</div>
</template>
<script>
-import MyMap from "@/components/map";
-import { parseTime } from "@/utils/index";
+// import MyMap from "@/components/map";
+import MyMap from "@/components/map/leafletMap.vue";
export default {
components: {
MyMap,
},
- props: ["id", "changeDialog", "refresh", "mytype"],
+ props: ["id", "changeDialog", "refresh", "mytype", "isGetData"],
created() {
// 鍒ゆ柇杞﹁締绫诲瀷
this.mytype === 1 ? this.getLawCarList() : this.getSoilCarList();
+ this.isGetDispatchData = this.isGetData ? this.isGetData : false;
this.getDepartList();
},
data() {
@@ -150,13 +147,6 @@
callback();
} else {
callback(new Error("娲鹃仯鎰忚涓嶈兘涓虹┖"));
- }
- };
- const checkDistance = (rule, value, callback) => {
- if (value) {
- callback();
- } else {
- callback(new Error("璺濈涓嶈兘涓虹┖"));
}
};
const checkTeam = (rule, value, callback) => {
@@ -218,12 +208,6 @@
dispatchOpinion: [
{ required: true, trigger: "change", validator: checkOpinion },
],
- // distance: [
- // { required: true, trigger: "change", validator: checkDistance },
- // ],
- // enforcementTeam: [
- // { required: true, trigger: 'change', validator: checkTeam }
- // ],
lawEnforcer: [
{ required: true, trigger: "change", validator: checkPerson },
],
@@ -238,57 +222,38 @@
},
],
},
- carOptions: [
- {
- label: "杞﹁締涓�",
- value: 1,
- },
- {
- label: "杞﹁締浜�",
- value: 2,
- },
- ],
+ carOptions: [],
departOptions: [],
- carOptions: [
- {
- label: "杞﹁締涓�",
- value: 1,
- },
- {
- label: "杞﹁締浜�",
- value: 2,
- },
- ],
squadronOptions: [],
personOptions: [],
+ isGetDispatchData: true
};
},
methods: {
// 鎵ц璋冨害
handleDispatch() {
- console.log(this.dispatch);
this.$refs.form.validate((valid) => {
- console.log(valid);
if (valid) {
- const { dispatch, id } = this;
- // dispatch.disposeDate = new Date();
- console.log(id);
- dispatch.baseCaseId = id;
- console.log(dispatch);
- this.$axios({
- method: "post",
- url: `sccg/dispatch_handle/dispatch`,
- data: dispatch,
- }).then((res) => {
- this.$message({
- type: res.code === 200 ? "success" : "error",
- message: res.code === 200 ? "璋冨害鎴愬姛" : res.message,
+ if (this.isGetDispatchData) {
+ this.$emit('getDispatchData', this.dispatch);
+ } else {
+ const { dispatch, id } = this;
+ dispatch.baseCaseId = id;
+ this.$axios({
+ method: "post",
+ url: `sccg/dispatch_handle/dispatch`,
+ data: dispatch,
+ }).then((res) => {
+ this.$message({
+ type: res.code === 200 ? "success" : "error",
+ message: res.code === 200 ? "璋冨害鎴愬姛" : res.message,
+ });
+ this.refresh();
});
- this.$emit("changeDialog", { flag: false });
- this.refresh();
- });
+ }
+ this.$emit("changeDialog", { flag: false });
} else {
- return false;
+ this.$message.warning('璇锋鏌ュ繀濉」');
}
});
},
@@ -303,17 +268,15 @@
url: `sccg/car_Manage/query_enforce?current=1&size=1000`,
}).then((res) => {
this.carOptions = res.data.records;
- console.log(res, this.carOptions);
});
},
// 鑾峰彇娓e湡杞﹁締
getSoilCarList() {
this.$axios({
method: "get",
- url: `sccg/car_Manage/query_slag?current=1&size=1000`,
+ url: `sccg/car_Manage/query_enforce?current=1&size=1000`,
}).then((res) => {
this.carOptions = res.data.records;
- console.log(res);
});
},
// 鑾峰彇椤剁骇閮ㄩ棬
@@ -327,7 +290,6 @@
},
// 鑾峰彇涓槦
async getTeamList(id) {
- console.log(id);
await this.$axios({
method: "get",
url: `sccg/depart/query_father_children?fatherId=${id}`,
@@ -336,18 +298,15 @@
this.squadronOptions = res.data;
})
.catch((err) => {
- console.log(err);
});
},
// 鑾峰彇閮ㄩ棬涓嬬殑鐢ㄦ埛
async getDepartUserList(id) {
- console.log(id);
await this.$axios({
method: "get",
url: `sccg/admin/getDepartUser/${id}`,
})
.then((res) => {
- console.log(res);
if (res.code === 200) {
this.personOptions = res.data;
} else {
@@ -374,9 +333,6 @@
this.dispatch.contactWay = "";
this.dispatch.lawEnforcerName = "";
await this.getTeamList(id);
- // if (this.squadronOptions.length === 0) {
- // await this.getDepartUserList(id);
- // }
},
// 涓槦鏇存敼
async handleMidChange(id) {
@@ -406,9 +362,7 @@
watch: {
"squadronOptions.length": {
handler(newval, oldval) {
- console.log(newval);
if (newval === 0) {
- console.log(1);
this.$message({
type: "warning",
message: "璇ラ儴闂ㄤ笅娌℃湁涓槦",
@@ -454,4 +408,4 @@
padding: 10px 20px;
}
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.8.0