From a0654f2c21511a0e16b977427a563a3ccdfd1fba Mon Sep 17 00:00:00 2001
From: kongdeqiang <123456>
Date: 星期二, 14 三月 2023 15:34:06 +0800
Subject: [PATCH] 搜索bug
---
src/views/your/area-manage/areaManage.vue | 174 ++++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 116 insertions(+), 58 deletions(-)
diff --git a/src/views/your/area-manage/areaManage.vue b/src/views/your/area-manage/areaManage.vue
index bbec1da..6779ed3 100644
--- a/src/views/your/area-manage/areaManage.vue
+++ b/src/views/your/area-manage/areaManage.vue
@@ -13,9 +13,9 @@
openTip ? "鍏抽棴鎻愮ず" : "寮�鍚彁绀�"
}}</Button>
<Input
- v-model="searchForm.name"
+ v-model="searchForm2.name"
suffix="ios-search"
- @on-change="getDataList"
+ @on-change="getDataList2"
placeholder="杈撳叆閰嶉�佸湴鍖烘悳绱�"
clearable
style="width: 250px"
@@ -66,9 +66,16 @@
<FormItem label="鐗囧尯鎻忚堪" prop="description">
<Input v-model="areaForm.description" />
</FormItem>
- <FormItem label="閰嶉�佸憳" prop="userId">
- <Select v-model="areaForm.userId" filterable>
- <Option v-for="item in userList" :value="item.id">{{ item.nickname }}</Option>
+ <!--<FormItem label="閰嶉�佸憳" prop="userId">-->
+ <!--<Select v-model="areaForm.userId" filterable>-->
+ <!--<Option :value="0" :key="0" selected>璇烽�夋嫨</Option>-->
+ <!--<Option v-for="item in userList" :value="item.id">{{ item.nickname }}</Option>-->
+ <!--</Select>-->
+ <!--</FormItem>-->
+ <FormItem label="閰嶉�佽溅杈�" prop="carId">
+ <Select v-model="areaForm.carId" filterable>
+ <Option value="" key="" selected>璇烽�夋嫨</Option>
+ <Option v-for="item in carList" :value="item.id">{{ item.carNo }}</Option>
</Select>
</FormItem>
</Form>
@@ -92,14 +99,14 @@
<Row class="operation" style="padding-bottom: 20px">
<Button @click="addCustomer" type="primary" icon="md-add">娣诲姞</Button>
<Button @click="init" icon="md-refresh">鍒锋柊</Button>
- <Input v-model="searchForm.name" suffix="ios-search" @on-change="getCustList" placeholder="杈撳叆鍟嗘埛鍚嶇О鎼滅储" clearable style="width: 250px"
+ <Input v-model="searchForm.customerName" suffix="ios-search" @on-change="getCustList" placeholder="杈撳叆鍟嗘埛鍚嶇О鎼滅储" clearable style="width: 250px"
/>
</Row>
<Table :loading="loading" border :columns="columns3" :data="data3" ref="table"
sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect">
</Table>
<Row type="flex" justify="end" class="page">
- <Page :current="searchForm.pageNumber" :total="total2"
+ <Page :current.sync="searchForm.pageNumber" :total="total2"
:page-size="searchForm.pageSize"
@on-change="changePage1"
@on-page-size-change="changePageSize"
@@ -107,7 +114,6 @@
size="small"
show-total
show-elevator
- show-sizer
></Page>
</Row>
</Modal>
@@ -130,9 +136,9 @@
<FormItem label="鍟嗘埛鍚嶇О" prop="name">
<Input v-model="customerForm.name" />
</FormItem>
- <FormItem label="鍟嗘埛缂栧彿" prop="code">
- <Input v-model="customerForm.code" />
- </FormItem>
+ <!--<FormItem label="鍟嗘埛缂栧彿" prop="code">-->
+ <!--<Input v-model="customerForm.code" />-->
+ <!--</FormItem>-->
<Row :gutter="0">
<Col span="12">
@@ -147,15 +153,15 @@
</Col>
</Row>
<Row :gutter="0">
- <Col span="12">
- <Form-item label="涓婃閰嶉�佹棩鏈�" prop="lastTime">
- <Row>
- <Col>
- <Date-picker @on-change="change1" type="date" value="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" v-model="customerForm.lastTime"></Date-picker>
- </Col>
- </Row>
- </Form-item>
- </Col>
+ <!--<Col span="12">-->
+ <!--<Form-item label="涓婃閰嶉�佹棩鏈�" prop="lastTime">-->
+ <!--<Row>-->
+ <!--<Col>-->
+ <!--<Date-picker @on-change="change1" type="date" value="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" v-model="customerForm.lastTime"></Date-picker>-->
+ <!--</Col>-->
+ <!--</Row>-->
+ <!--</Form-item>-->
+ <!--</Col>-->
<Col span="12">
<FormItem label="鑱旂郴鏂瑰紡" prop="phone">
<Input v-model="customerForm.phone"/>
@@ -316,7 +322,16 @@
modalTitle: "",
modalTitle2: "",
modalTitle3: "",
+ carList:[],
searchForm: {
+ // 鎼滅储妗嗗垵濮嬪寲瀵硅薄
+ pageNumber: 1, // 褰撳墠椤垫暟
+ pageSize: 10, // 椤甸潰澶у皬
+ sort: "createTime", // 榛樿鎺掑簭瀛楁
+ order: "desc", // 榛樿鎺掑簭鏂瑰紡
+ key: "",
+ },
+ searchForm2: {
// 鎼滅储妗嗗垵濮嬪寲瀵硅薄
pageNumber: 1, // 褰撳墠椤垫暟
pageSize: 10, // 椤甸潰澶у皬
@@ -327,7 +342,6 @@
areaForm: {
},
customerForm: {
- kstatus : 1
},
areaSectionForm: {
},
@@ -361,10 +375,13 @@
title: "鐗囧尯鎻忚堪",
key: "description",
width: 442,
+ render: (h, params) => {
+ return h("div",params.row.description=="undefined" ? '':params.row.description);
+ }
},
{
- title: "閰嶉�佷汉",
- key: "nickName",
+ title: "閰嶉�佽溅杈�",
+ key: "carNo",
width: 200,
},
{
@@ -516,33 +533,33 @@
key: "phone",
width: 135,
},
- {
- title: "鐘舵��",
- key: "status",
- width:100,
- render: (h, params) => {
- let re = "";
- if (params.row.status == 0) {
- return h("div", [
- h("Badge", {
- props: {
- status: "success",
- text: "姝e父",
- },
- }),
- ]);
- } else if (params.row.status == 1) {
- return h("div", [
- h("Badge", {
- props: {
- status: "error",
- text: "涓嶆椿璺�",
- },
- }),
- ]);
- }
- },
- },
+ // {
+ // title: "鐘舵��",
+ // key: "status",
+ // width:100,
+ // render: (h, params) => {
+ // let re = "";
+ // if (params.row.status == 0) {
+ // return h("div", [
+ // h("Badge", {
+ // props: {
+ // status: "success",
+ // text: "姝e父",
+ // },
+ // }),
+ // ]);
+ // } else if (params.row.status == 1) {
+ // return h("div", [
+ // h("Badge", {
+ // props: {
+ // status: "error",
+ // text: "涓嶆椿璺�",
+ // },
+ // }),
+ // ]);
+ // }
+ // },
+ // },
{
title: "鑱旂郴浜�",
key: "linker",
@@ -668,7 +685,6 @@
changePage1(v) {
this.searchForm.pageNumber = v;
this.getCustomerList(this.areaSectionId);
- this.clearSelectAll();
},
changePageSize(v) {
this.searchForm.pageSize = v;
@@ -692,8 +708,19 @@
}
});
},
+ getDataList2() {
+ this.loading = true;
+ getArea(this.searchForm2).then((res) => {
+ this.loading = false;
+ if (res.success) {
+ this.data = res.result.records;
+ this.total = res.result.total;
+ }
+ });
+ },
getCustList() {
this.loading = true;
+ this.searchForm.pageNumber=1;
getCustomer(this.searchForm).then((res) => {
this.loading = false;
if (res.success) {
@@ -701,11 +728,19 @@
this.total2 = res.result.total;
}
});
+ this.$emit('update:current',this.searchForm.pageNumber);
},
getAllUser(){
getDriver({type:1}).then((res)=>{
if (res.success){
this.userList=res.result;
+ }
+ });
+ },
+ getAllCar(){
+ getAll().then((res)=>{
+ if (res.success){
+ this.carList=res.result;
}
});
},
@@ -719,11 +754,20 @@
}
});
},
+ getAreaSectionList2(areaId) {
+ this.loading = true;
+ this.searchForm2.areaId=areaId;
+ getAreaSection(this.searchForm2).then((res) => {
+ this.loading = false;
+ if (res.success) {
+ this.data2 = res.result.records;
+ }
+ });
+ },
getCustomerList(areaSectionId) {
this.loading = true;
this.searchForm.areaSectionId=areaSectionId;
getCustomer(this.searchForm).then((res) => {
- console.log(this.searchForm)
this.loading = false;
if (res.success) {
this.data3 = res.result.records;
@@ -759,6 +803,15 @@
this.roleModalVisible = false;
},
submitArea() {
+ if(this.areaForm.userId==undefined){
+ this.areaForm.userId=0;
+ }
+ if(this.areaForm.description==undefined){
+ this.areaForm.description="";
+ }
+ if(this.areaForm.carId==undefined){
+ this.areaForm.carId="";
+ }
this.$refs.areaForm.validate((valid) => {
if (valid) {
if (this.modalType == 0) {
@@ -791,14 +844,16 @@
},
submitCustomer() {
this.$refs.areaSectionForm.validate((valid) => {
- this.customerForm.lastTime = this.lastTime;
+ //this.customerForm.lastTime = this.lastTime;
this.customerForm.areaSectionId = this.areaSectionId;
this.customerForm.areaId = this.areaId;
- this.customerForm.kstatus = 1;
+
if (valid) {
+ this.$delete(this.customerForm,'receives')
if (this.modalType == 0) {
// 娣诲姞
this.submitLoading = true;
+ this.customerForm.kstatus = 0;
addCustomer(this.customerForm).then((res) => {
this.submitLoading = false;
if (res.success) {
@@ -869,7 +924,7 @@
},
equipment(row) {
this.areaId = row.id
- this.getAreaSectionList(row.id);
+ this.getAreaSectionList2(row.id);
this.modalType = 0;
this.modalTitle2 = "鐗囧尯娈典俊鎭�";
this.$refs.areaForm.resetFields();
@@ -884,9 +939,11 @@
this.$refs.areaForm.resetFields();
delete this.areaForm.id;
this.customerVisible = true;
+ console.log(this.areaSectionId);
},
addCar() {
- this.getAllUser();
+ //this.getAllUser();
+ this.getAllCar();
this.modalType = 0;
this.modalTitle = "娣诲姞";
this.$refs.areaForm.resetFields();
@@ -910,7 +967,8 @@
this.addCustomerVisible = true;
},
edit(v) {
- this.getAllUser();
+ //this.getAllUser();
+ this.getAllCar()
this.modalType = 1;
this.modalTitle = "缂栬緫";
this.$refs.areaForm.resetFields();
@@ -1302,4 +1360,4 @@
this.init();
},
};
-</script>
\ No newline at end of file
+</script>
--
Gitblit v1.9.1