From 07db4702cc86f56e8da819674d717e5c0404e0ea Mon Sep 17 00:00:00 2001
From: heyujie <516346543@qq.com>
Date: 星期一, 20 六月 2022 17:36:48 +0800
Subject: [PATCH] get order
---
src/pages/library/components/carList.vue | 491 +++++++++++++++++++++++++++++++++---------------------
1 files changed, 301 insertions(+), 190 deletions(-)
diff --git a/src/pages/library/components/carList.vue b/src/pages/library/components/carList.vue
index 2696cc7..a30dfb2 100644
--- a/src/pages/library/components/carList.vue
+++ b/src/pages/library/components/carList.vue
@@ -20,6 +20,7 @@
</div>
<div class="right-btns">
+ <span style="margin-right: 2px">搴曞簱鐘舵�侊紙鐢熸晥/澶辨晥锛�</span>
<el-switch
:active-value="1"
:width="52"
@@ -238,7 +239,7 @@
>
<span
class="iconfont iconbianjixinxi-09"
- style=" font-size: 24px;cursor: pointer"
+ style="font-size: 24px; cursor: pointer"
@click="handleClick(scope.row)"
></span>
</el-tooltip>
@@ -249,62 +250,61 @@
popper-class="popper-caozuo1"
>
<el-tooltip
- content="鏌ユ壘姝よ溅"
- placement="top"
- popper-class="atooltip"
- >
+ content="鏌ユ壘姝よ溅"
+ placement="top"
+ popper-class="atooltip"
+ >
+ <span
+ class="iconfont iconchazhaociren-09"
+ @click="tosearch(scope.row)"
+ ></span>
+ </el-tooltip>
+ <fTemplate authority="library:set">
+ <el-tooltip
+ content="澶嶅埗"
+ placement="top"
+ popper-class="atooltip"
+ >
+ <span
+ class="iconfont iconfuzhi-09"
+ title="澶嶅埗"
+ @click="copyClick(scope.row)"
+ ></span>
+ </el-tooltip>
+ </fTemplate>
+ <fTemplate authority="library:set">
+ <el-tooltip
+ content="绉诲姩"
+ placement="top"
+ popper-class="atooltip"
+ >
+ <span
+ class="iconfont iconyidong-09"
+ title="绉诲姩"
+ @click="moveClick(scope.row)"
+ ></span>
+ </el-tooltip>
+ </fTemplate>
+ <fTemplate authority="library:set">
+ <el-tooltip
+ content="鍒犻櫎"
+ placement="top"
+ popper-class="atooltip"
+ >
+ <span
+ class="iconfont iconshanchu-09"
+ style="color: #e74c3c"
+ @click="askDelete('single', scope.row.id)"
+ title="鍒犻櫎"
+ ></span>
+ </el-tooltip>
+ </fTemplate>
<span
- class="iconfont iconchazhaociren-09"
- @click="tosearch(scope.row)"
- ></span>
- </el-tooltip>
- <fTemplate authority="library:set">
- <el-tooltip
- content="澶嶅埗"
- placement="top"
- popper-class="atooltip"
- >
- <span
- class="iconfont iconfuzhi-09"
- title="澶嶅埗"
- @click="copyClick(scope.row)"
- ></span>
- </el-tooltip>
- </fTemplate>
- <fTemplate authority="library:set">
- <el-tooltip
- content="绉诲姩"
- placement="top"
- popper-class="atooltip"
- >
- <span
- class="iconfont iconyidong-09"
- title="绉诲姩"
- @click="moveClick(scope.row)"
- ></span>
- </el-tooltip>
- </fTemplate>
- <fTemplate authority="library:set">
- <el-tooltip
- content="鍒犻櫎"
- placement="top"
- popper-class="atooltip"
- >
- <span
- class="iconfont iconshanchu-09"
- style="color: #e74c3c"
- @click="deleteThis(scope.row.id)"
- title="鍒犻櫎"
- ></span>
- </el-tooltip>
- </fTemplate>
- <span
slot="reference"
class="iconfont icongengduocaozuo-09"
style="font-size: 24px; cursor: pointer"
></span>
</el-popover>
-
</template>
</el-table-column>
</el-table>
@@ -369,8 +369,7 @@
:visible.sync="copyVisiabled"
:append-to-body="true"
okText="淇濆瓨"
- width="35%"
- class="copy"
+ custom-class="copy-dialog"
cancelText="鍙栨秷"
>
<div class="addToBase1">
@@ -436,8 +435,7 @@
:visible.sync="moveVisiabled"
:append-to-body="true"
okText="淇濆瓨"
- class="move"
- width="35%"
+ custom-class="copy-dialog"
cancelText="鍙栨秷"
>
<div class="addToBase1">
@@ -516,7 +514,9 @@
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="askDeleteShow = false">鍙� 娑�</el-button>
- <el-button type="primary" @click="handleDel">纭� 瀹�</el-button>
+ <el-button type="primary" @click="handleDel" :loading="delBtnLoading"
+ >纭� 瀹�</el-button
+ >
</span>
</el-dialog>
@@ -563,7 +563,7 @@
:model="form"
label-width="80px"
style="margin-top: 20px; margin-bottom: 30px"
- :rule="rules"
+ :rule="carRules"
>
<el-form-item label="杞︾墝鍙�" prop="carNo">
<el-input
@@ -572,7 +572,7 @@
class="inputWidth"
></el-input>
</el-form-item>
- <el-form-item label="杞﹁締绫诲瀷">
+ <el-form-item label="杞﹁締绫诲瀷" prop="carType">
<el-select
v-model="form.carType"
placeholder="璇烽�夋嫨杞﹁締绫诲瀷"
@@ -586,7 +586,7 @@
></el-option>
</el-select>
</el-form-item>
- <el-form-item label="杞﹁締鍝佺墝">
+ <el-form-item label="杞﹁締鍝佺墝" prop="carBrand">
<el-select
v-model="form.carBrand"
placeholder="璇烽�夋嫨杞﹁締鍝佺墝"
@@ -600,7 +600,7 @@
></el-option>
</el-select>
</el-form-item>
- <el-form-item label="杞﹁韩棰滆壊">
+ <el-form-item label="杞﹁韩棰滆壊" prop="carColor">
<el-select
v-model="form.carColor"
placeholder="璇烽�夋嫨杞﹁韩棰滆壊"
@@ -614,33 +614,24 @@
></el-option>
</el-select>
</el-form-item>
- <el-form-item label="杞︿富濮撳悕">
+ <el-form-item label="杞︿富濮撳悕" prop="personName">
<el-input v-model="form.personName" class="inputWidth"></el-input>
</el-form-item>
- <el-form-item label="杞︿富鎬у埆">
+ <el-form-item label="杞︿富鎬у埆" prop="sex">
<el-radio-group v-model="form.sex">
<el-radio label="鐢�"></el-radio>
<el-radio label="濂�"></el-radio>
</el-radio-group>
</el-form-item>
- <el-form-item label="韬唤璇佸彿">
+ <el-form-item label="韬唤璇佸彿" prop="idCard">
<el-input v-model="form.idCard" class="inputWidth"></el-input>
</el-form-item>
- <el-form-item label="鎵嬫満鍙�">
+ <el-form-item label="鎵嬫満鍙�" prop="phoneNum">
<el-input v-model="form.phoneNum" class="inputWidth"></el-input>
</el-form-item>
- <el-form-item label="鍏朵粬">
+ <el-form-item label="鍏朵粬" prop="reserved">
<el-input v-model="form.reserved" class="inputWidth"></el-input>
</el-form-item>
- <!-- <el-form-item style="text-align: tight">
- <el-button
- type="primary"
- @click="submitCar"
- style="margin-left: 120px"
- >淇濆瓨</el-button
- >
- <el-button @click="resetForm">鍙栨秷</el-button>
- </el-form-item> -->
</el-form>
<div class="dialog-footer">
<el-button
@@ -715,9 +706,10 @@
deleteBasePersons,
plateBatch,
updateDbTableStatus,
+ deleteDbPersonById,
+ deleteDBtablesById,
} from "@/api/baseLibrary";
import axios from "axios";
-import Upload from "./upload";
import fTemplate from "@/components/fTemplate";
import request from "@/scripts/httpRequest";
export default {
@@ -733,7 +725,53 @@
type: String,
},
},
+
+ computed: {
+ isAdmin() {
+ if (
+ sessionStorage.getItem("userInfo") &&
+ sessionStorage.getItem("userInfo") !== ""
+ ) {
+ let loginName = JSON.parse(sessionStorage.getItem("userInfo")).username;
+ return loginName === "superadmin" || loginName === "basic";
+ }
+ return false;
+ },
+ delText() {
+ switch (this.delType) {
+ case "base":
+ return ["鍒犻櫎搴曞簱", "纭畾鍒犻櫎璇ュ簳搴擄紵"];
+ case "single":
+ return ["鍒犻櫎杞﹁締淇℃伅", "纭畾鍒犻櫎璇ヨ溅杈嗕俊鎭紵"];
+ case "batch":
+ return ["鎵归噺鍒犻櫎", "纭畾鍒犻櫎璇ュ簳搴撻�変腑鐨勮溅杈嗕俊鎭紵"];
+ default:
+ return ["", ""];
+ }
+ },
+ },
data() {
+ var checkCar = (rule, value, callback) => {
+ debugger;
+ if (!value) {
+ return callback();
+ } else {
+ var result = false;
+ if (value.length === 7) {
+ var express = /^[浜触娌笣鍐�璞簯杈介粦婀樼殩椴佹柊鑻忔禉璧i剛妗傜敇鏅嬭挋闄曞悏闂借吹绮ら潚钘忓窛瀹佺惣浣块A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9鎸傚璀︽腐婢砞{1}$/;
+ result = express.test(value);
+ } else if (value.length === 8) {
+ var express2 = /^[浜触娌笣鍐�璞簯杈介粦婀樼殩椴佹柊鑻忔禉璧i剛妗傜敇鏅嬭挋闄曞悏闂借吹绮ら潚钘忓窛瀹佺惣浣块A-Z]{1}[A-Z]{1}[A-Z0-9]{5}[A-Z0-9鎸傚璀︽腐婢砞{1}$/;
+ result = express2.test(value);
+ }
+ if (result) {
+ callback();
+ } else {
+ callback(new Error("璇疯緭鍏ユ纭溅鐗屽彿鐮�"));
+ }
+ return result;
+ }
+ };
return {
dialogFormVisible: false,
addDrawer: false,
@@ -784,12 +822,11 @@
enable: 0,
reserved: "",
},
- rules: {
- carNo: [{ required: true, message: "璇疯緭鍏ヨ溅鐗屽彿", trigger: "change" }],
- // sex: [{ required: true, message: "璇峰嬀閫夋�у埆", trigger: "change" }],
- // monitorLevel: [
- // { required: true, message: "璇烽�夋嫨浜哄憳绛夌骇", trigger: "change" },
- // ],
+ carRules: {
+ carNo: [
+ { required: true, message: "璇疯緭鍏ユ椿鍔ㄥ悕绉�", trigger: "blur" },
+ // { validator: checkCar, trigger: 'blur' }
+ ],
},
tableData: [],
oldWidth: "",
@@ -804,56 +841,67 @@
multiFaceList: [],
noFaceList: [],
},
+ delBtnLoading: false,
};
},
- computed: {
- isAdmin() {
- if (
- sessionStorage.getItem("userInfo") &&
- sessionStorage.getItem("userInfo") !== ""
- ) {
- let loginName = JSON.parse(sessionStorage.getItem("userInfo")).username;
- return loginName === "superadmin" || loginName === "basic";
- }
- return false;
+ watch: {
+ "BaseManageData.selectBlacks": function (value) {
+ this.blackAngWhite();
},
- delText() {
- switch (this.delType) {
- case "base":
- return ["鍒犻櫎搴曞簱", "纭畾鍒犻櫎璇ュ簳搴擄紵"];
- case "single":
- return ["鍒犻櫎浜哄憳", "纭畾鍒犻櫎璇ュ簳搴撲汉鍛橈紵"];
- case "batch":
- return ["鎵归噺鍒犻櫎", "纭畾鍒犻櫎璇ュ簳搴撻�変腑浜哄憳锛�"];
- default:
- return ["", ""];
- }
+ "BaseManageData.selectWhites": function (value) {
+ this.blackAngWhite();
},
},
- methods: {
- handleDel() {
- if (this.delType == "single") {
- this.deleteThis();
- } else if (this.delType == "base") {
- this.deleteBase();
- } else if (this.delType == "batch") {
- this.deleteBatch();
+ mounted() {
+ this.getCarList();
+ this.VideoPhotoData.queryDictionary();
+ this.BaseManageData.queryTagList();
+ this.oldWidth = document.body.clientWidth;
+ this.oldHeight = document.body.clientHeight;
+ this.blackAngWhite();
+ window.onresize = () => {
+ let width = document.body.clientWidth;
+ let height = document.body.clientHeight;
+ if (width !== this.oldWidth && width < 1750) {
}
+ this.$nextTick(() => {
+ this.$refs.multipleTable.doLayout();
+ });
+ };
+ this.$nextTick(() => {
+ this.$refs.multipleTable.doLayout();
+ });
+ },
+ beforeDestroy() {
+ window.onresize = null;
+ },
+ methods: {
+ checkCarNo(value) {
+ var result = false;
+ if (value.length === 7) {
+ var express = /^[浜触娌笣鍐�璞簯杈介粦婀樼殩椴佹柊鑻忔禉璧i剛妗傜敇鏅嬭挋闄曞悏闂借吹绮ら潚钘忓窛瀹佺惣浣块A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9鎸傚璀︽腐婢砞{1}$/;
+ result = express.test(value);
+ } else if (value.length === 8) {
+ var express2 = /^[浜触娌笣鍐�璞簯杈介粦婀樼殩椴佹柊鑻忔禉璧i剛妗傜敇鏅嬭挋闄曞悏闂借吹绮ら潚钘忓窛瀹佺惣浣块A-Z]{1}[A-Z]{1}[A-Z0-9]{5}[A-Z0-9鎸傚璀︽腐婢砞{1}$/;
+ result = express2.test(value);
+ }
+ return result;
+ },
+ async handleDel() {
+ this.delBtnLoading = true;
+ if (this.delType == "single") {
+ await this.deleteThis();
+ } else if (this.delType == "base") {
+ await this.deleteBase();
+ } else if (this.delType == "batch") {
+ await this.deleteBatch();
+ }
+
+ this.delBtnLoading = false;
+ this.askDeleteShow = false;
},
deleteBase() {
- let token =
- sessionStorage.getItem("loginedInfo") &&
- JSON.parse(sessionStorage.getItem("loginedInfo")).access_token;
- fetch(`/data/api-v/dbtable/deleteDBtablesById?id=${this.baseObject.id}`, {
- method: "GET",
- headers: {
- "Content-Type": "application/json",
- Authorization: token,
- },
- })
- .then((res) => {
- return res.json();
- })
+ deleteDBtablesById({ id: this.baseObject.id })
.then((res) => {
if (res.success) {
this.$notify({
@@ -861,6 +909,7 @@
message: "搴曞簱鍒犻櫎鎴愬姛锛�",
});
}
+ this.askDeleteShow = false;
this.$emit("onDelete");
})
.catch((err) => {
@@ -913,6 +962,7 @@
data: fd,
});
if (res.success) {
+ debugger;
this.form.carUrls.push({ url: "/httpImage/" + res.data.picUrl });
}
},
@@ -979,24 +1029,12 @@
}
},
deleteThis() {
- let token =
- sessionStorage.getItem("loginedInfo") &&
- JSON.parse(sessionStorage.getItem("loginedInfo")).access_token;
- fetch(`/data/api-v/dbperson/deleteDbPersonById?id=${this.toDeleteId}`, {
- method: "GET",
- headers: {
- "Content-Type": "application/json",
- Authorization: token,
- },
- })
- .then((res) => {
- return res.json();
- })
+ deleteDbPersonById({ id: this.toDeleteId })
.then((data) => {
if (data.success) {
this.$notify({
type: "success",
- message: "璇ヤ汉鍛樺垹闄ゆ垚鍔燂紒",
+ message: "杞﹁締淇℃伅鍒犻櫎鎴愬姛锛�",
});
}
this.getCarList();
@@ -1008,7 +1046,7 @@
this.dialogVisible = true;
this.getCarList();
},
- async getCarList() {
+ getCarList() {
if (this.baseObject.id && this.baseObject.id !== undefined) {
this.BaseManageData.tableId = this.baseObject.id;
this.setLoadSearch(this.BaseManageData.queryPersonList());
@@ -1050,13 +1088,13 @@
if (res.success) {
this.$notify({
type: "success",
- message: "浜哄憳淇敼鎴愬姛锛�",
+ message: "杞﹁締淇℃伅淇敼鎴愬姛锛�",
});
this.dialogFormVisible = false;
} else {
this.$notify({
type: "error",
- message: "浜哄憳淇敼澶辫触锛岃閲嶈瘯锛侊紒",
+ message: "杞﹁締淇℃伅淇敼澶辫触锛岃閲嶈瘯锛侊紒",
});
}
} else {
@@ -1088,12 +1126,12 @@
if (res.success) {
this.$notify({
type: "success",
- message: "搴曞簱浜哄憳鎴愬姛鍙樻洿鐢熸晥鐘舵�侊紒",
+ message: "杞﹁締淇℃伅鎴愬姛鍙樻洿鐢熸晥鐘舵�侊紒",
});
} else {
this.$notify({
type: "error",
- message: "搴曞簱浜哄憳鍙樻洿鐢熸晥鐘舵�佸け璐ワ紒",
+ message: "杞﹁締淇℃伅鍙樻洿鐢熸晥鐘舵�佸け璐ワ紒",
});
}
},
@@ -1163,7 +1201,7 @@
this.selectedRowKeys.map((item, index) => {
ids.push(item.id);
});
- let res = await deleteBasePersons(ids);
+ let res = await deleteBasePersons({ ids: ids });
if (res.success) {
this.$notify({
type: "success",
@@ -1197,7 +1235,7 @@
if (this.selectedRowKeys.length === 0) {
this.$notify({
type: "warning",
- message: "璇烽�夋嫨瑕佸垹闄ょ殑浜哄憳",
+ message: "璇烽�夋嫨瑕佸垹闄ょ殑杞﹁締淇℃伅",
});
return;
}
@@ -1295,16 +1333,24 @@
});
}
},
- async submitCar() {
+ submitCar() {
this.$refs["formForCar"].validate(async (valid) => {
if (valid) {
let { ...json } = this.form;
+ json.carPicUrls = "";
for (let index in json.carUrls) {
if (index == 0) {
json.carPicUrls += json.carUrls[index].url.substring(11);
} else {
json.carPicUrls += ";" + json.carUrls[index].url.substring(11);
}
+ }
+ if (!this.checkCarNo(json.carNo)) {
+ this.$notify({
+ type: "warning",
+ message: "璇疯緭鍏ユ纭殑杞︾墝鍙�",
+ });
+ return;
}
json.carColor = parseInt(json.carColor);
json.carType = parseInt(json.carType);
@@ -1321,14 +1367,14 @@
if (res.success) {
this.$notify({
type: "success",
- message: res.data.msg,
+ message: "淇濆瓨鎴愬姛",
});
this.getCarList();
this.addDrawer = false;
} else {
this.$notify({
type: "error",
- message: res.data.msg,
+ message: res.msg,
});
}
} else {
@@ -1439,44 +1485,6 @@
fn.then((_) => {
this.AuthData.closeLoad();
});
- },
- },
- mounted() {
- this.getCarList();
- this.VideoPhotoData.queryDictionary();
- this.BaseManageData.queryTagList();
- this.oldWidth = document.body.clientWidth;
- this.oldHeight = document.body.clientHeight;
- this.blackAngWhite();
- window.onresize = () => {
- let width = document.body.clientWidth;
- let height = document.body.clientHeight;
- if (width !== this.oldWidth && width < 1750) {
- }
- this.$nextTick(() => {
- this.$refs.multipleTable.doLayout();
- });
- };
- this.$nextTick(() => {
- this.$refs.multipleTable.doLayout();
- });
- },
- beforeDestroy() {
- window.onresize = null;
- },
- watch: {
- baseObject: {
- handler(newVal, oldVal) {
- this.BaseManageData.cleanData();
- this.getCarList();
- },
- deep: true,
- },
- "BaseManageData.selectBlacks": function (value) {
- this.blackAngWhite();
- },
- "BaseManageData.selectWhites": function (value) {
- this.blackAngWhite();
},
},
};
@@ -1624,8 +1632,6 @@
box-shadow: 0px 2px 4px rgb(0 0 0 / 8%);
font-size: 14px;
}
- .el-drawer__body {
- }
}
}
@@ -1721,10 +1727,115 @@
padding-right: 0px !important;
}
-.copy,
-.move {
+// .copy,
+// .move {
+// .el-dialog__body {
+// padding: 0px !important;
+// }
+// }
+
+.el-dialog.copy-dialog {
+ width: 550px;
+ border-radius: 24px;
+ .el-dialog__header {
+ text-align: center;
+ }
+ .el-dialog__headerbtn .el-dialog__close {
+ color: #999999;
+ font-size: 20px;
+ }
+ .el-dialog__title {
+ line-height: 22px;
+ font-size: 16px;
+ color: #5f5f5f;
+ }
.el-dialog__body {
- padding: 0px !important;
+ padding: 20px 15px;
+ color: #5f5f5f;
+ }
+ .dialog-footer {
+ // width: 315px;
+ .el-button--info {
+ color: #999999;
+ background: #fff;
+ padding: 9px 37px;
+ font-size: 14px;
+ border: 1px solid #999999;
+ border-radius: 18px;
+ width: 150px;
+ }
+ .el-button--primary {
+ background: var(--colorCard) !important;
+ padding: 9px 37px;
+ color: #fff;
+ border: 1px solidvar(--colorCard) !important;
+ border-radius: 18px;
+ font-size: 14px;
+ width: 150px;
+ }
+ }
+ .addToBase1 {
+ position: relative;
+ .topLabel {
+ margin-top: 20px;
+ height: 40px;
+ border-bottom: 1px solid #eee;
+ font-family: PingFangSC-Medium;
+ font-size: 20px;
+ font-weight: 600;
+ line-height: 1rem;
+ color: #222222;
+ text-align: left;
+ margin-left: 15px;
+ }
+ .items {
+ width: 100%;
+ min-height: 150px;
+ margin-bottom: 10px;
+ .lable {
+ font-size: 16px;
+ font-weight: bold;
+ text-align: left;
+ margin-bottom: 10px;
+ }
+ .baseList {
+ height: 100%;
+ overflow: auto;
+ .base {
+ width: 152px;
+ padding: 5px 5px 5px 10px;
+ line-height: 30px;
+ box-sizing: border-box;
+ float: left;
+ text-align: left;
+ background: #eff1f5;
+ border-radius: 8px;
+ margin: 0 10px;
+ margin-bottom: 10px;
+ .el-checkbox__input.is-checked .el-checkbox__inner {
+ background-color: var(--colorCard);
+ border-color: var(--colorCard);
+ }
+ .el-checkbox {
+ width: 100%;
+ display: block;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ .el-checkbox__label {
+ display: inline !important;
+ padding-left: 6px;
+ line-height: 20px;
+ color: #5f5f5f;
+ }
+ }
+ }
+ .white-wrap {
+ background: #ffffff;
+ box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.16);
+ }
+ }
+ }
}
}
--
Gitblit v1.8.0