| @@ -35,9 +35,9 @@ | |||||
| </van-col> | </van-col> | ||||
| </van-row> | </van-row> | ||||
| <van-swipe-cell v-for="item in samplingList" stop-propagation> | |||||
| <van-swipe-cell v-for="(item,index) in samplingList" stop-propagation> | |||||
| <template #left> | <template #left> | ||||
| <van-button square type="danger" style="height: 30px" text="删除" :click="removeRow(item.id)"/> | |||||
| <van-button square type="danger" style="height: 30px" text="删除" @click="removeRow(item.id,index)"/> | |||||
| </template> | </template> | ||||
| <van-row style="text-align: center;line-height: 30px;border: 1px solid #FFF"> | <van-row style="text-align: center;line-height: 30px;border: 1px solid #FFF"> | ||||
| <van-col span="8" > | <van-col span="8" > | ||||
| @@ -498,6 +498,10 @@ | |||||
| updateSampling | updateSampling | ||||
| } from "../../api/authenticRight"; | } from "../../api/authenticRight"; | ||||
| import {getDeptList} from "../../api/biddingHall"; | import {getDeptList} from "../../api/biddingHall"; | ||||
| import {Dialog} from "vant"; | |||||
| import {Toast} from "vant"; | |||||
| import {getInfo} from "../../api/login"; | |||||
| import {getMember} from "../../api/project"; | |||||
| export default { | export default { | ||||
| name: "authenticRightApply", | name: "authenticRightApply", | ||||
| @@ -611,6 +615,7 @@ export default { | |||||
| options: [ | options: [ | ||||
| ], | ], | ||||
| userId :null, | |||||
| } | } | ||||
| }, | }, | ||||
| created(){ | created(){ | ||||
| @@ -622,6 +627,13 @@ export default { | |||||
| }) | }) | ||||
| } | } | ||||
| }) | }) | ||||
| getInfo().then(response => { | |||||
| console.log(response) | |||||
| this.userId = response.user.userId | |||||
| /* getMember(response.user.userId).then(response => { | |||||
| console.log(response) | |||||
| });*/ | |||||
| }); | |||||
| }, | }, | ||||
| methods:{ | methods:{ | ||||
| changeDept(val){ | changeDept(val){ | ||||
| @@ -639,7 +651,6 @@ export default { | |||||
| this.value11=0 | this.value11=0 | ||||
| this.value2=0 | this.value2=0 | ||||
| this.value22=0 | this.value22=0 | ||||
| this.getList() | |||||
| } | } | ||||
| }) | }) | ||||
| }else if(val==2){ | }else if(val==2){ | ||||
| @@ -649,13 +660,12 @@ export default { | |||||
| this.queryParams.cooperativeName = null | this.queryParams.cooperativeName = null | ||||
| listSamplingDept(this.queryParams).then(res => { | listSamplingDept(this.queryParams).then(res => { | ||||
| if(res.data){ | if(res.data){ | ||||
| this.option2=[{ text: '乡镇', value: 0 }] | |||||
| this.option2=[{ text: '村级', value: 0 }] | |||||
| res.data.map(item => { | res.data.map(item => { | ||||
| this.option2.push({ "text":item.villageName,"value": item.villageName}) | this.option2.push({ "text":item.villageName,"value": item.villageName}) | ||||
| }) | }) | ||||
| this.value2=0 | this.value2=0 | ||||
| this.value22=0 | this.value22=0 | ||||
| this.getList() | |||||
| } | } | ||||
| }) | }) | ||||
| }else if(val==3){ | }else if(val==3){ | ||||
| @@ -670,7 +680,6 @@ export default { | |||||
| this.option22.push({ "text":item.cooperativeName,"value": item.cooperativeName}) | this.option22.push({ "text":item.cooperativeName,"value": item.cooperativeName}) | ||||
| }) | }) | ||||
| this.value22=0 | this.value22=0 | ||||
| this.getList() | |||||
| } | } | ||||
| }) | }) | ||||
| @@ -787,10 +796,26 @@ export default { | |||||
| } | } | ||||
| }) | }) | ||||
| }, | }, | ||||
| removeRow(id){ | |||||
| /*delSampling(id).then(res => { | |||||
| this.getList(); | |||||
| })*/ | |||||
| removeRow(id,index){ | |||||
| let _this = this | |||||
| Dialog.confirm({ | |||||
| title: '删除', | |||||
| message: '删除后数据无法恢复,确认要删除么?' | |||||
| }).then(() => { | |||||
| delSampling(id).then(res => { | |||||
| this.$toast({ | |||||
| icon: 'success', // 找到自己需要的图标 | |||||
| message: '删除成功', | |||||
| duration:"1000", | |||||
| onClose:function(){ | |||||
| _this.getList(); | |||||
| } | |||||
| }) | |||||
| }) | |||||
| }).catch(() => { | |||||
| // on cancel | |||||
| }); | |||||
| }, | }, | ||||
| onFinish({ selectedOptions }) { | onFinish({ selectedOptions }) { | ||||
| this.show1 = false; | this.show1 = false; | ||||
| @@ -855,7 +880,9 @@ export default { | |||||
| }) | }) | ||||
| }else if(val==3){ | }else if(val==3){ | ||||
| this.reset(); | this.reset(); | ||||
| this.showXCDC=true | |||||
| getInvestigate(data.id).then(res => { | getInvestigate(data.id).then(res => { | ||||
| console.log(data) | |||||
| if(res.data){ | if(res.data){ | ||||
| this.xcdcform = res.data | this.xcdcform = res.data | ||||
| this.xcdcform["countName"] = data.countName | this.xcdcform["countName"] = data.countName | ||||
| @@ -864,7 +891,6 @@ export default { | |||||
| this.xcdcform["cooperativeName"] = data.cooperativeName | this.xcdcform["cooperativeName"] = data.cooperativeName | ||||
| this.xcdcform["farmerName"] = data.farmerName | this.xcdcform["farmerName"] = data.farmerName | ||||
| }else{ | }else{ | ||||
| this.xcdcform = res.data | |||||
| this.xcdcform["countName"] = data.countName | this.xcdcform["countName"] = data.countName | ||||
| this.xcdcform["townName"] = data.townName | this.xcdcform["townName"] = data.townName | ||||
| this.xcdcform["villageName"] = data.villageName | this.xcdcform["villageName"] = data.villageName | ||||
| @@ -873,13 +899,13 @@ export default { | |||||
| this.xcdcform["samplingId"] = data.id | this.xcdcform["samplingId"] = data.id | ||||
| this.xcdcform["fileName"] = data.townName+data.villageName | this.xcdcform["fileName"] = data.townName+data.villageName | ||||
| } | } | ||||
| this.showXCDC=true | |||||
| }) | }) | ||||
| }else if(val==2){ | }else if(val==2){ | ||||
| console.log(data) | console.log(data) | ||||
| this.reset(); | this.reset(); | ||||
| console.log(this.dhdcform) | |||||
| this.showDHDC=true | |||||
| getInvestigate(data.id).then(res => { | getInvestigate(data.id).then(res => { | ||||
| if(res.data){ | if(res.data){ | ||||
| this.dhdcform = res.data | this.dhdcform = res.data | ||||
| @@ -889,7 +915,6 @@ export default { | |||||
| this.dhdcform["cooperativeName"] = data.cooperativeName | this.dhdcform["cooperativeName"] = data.cooperativeName | ||||
| this.dhdcform["farmerName"] = data.farmerName | this.dhdcform["farmerName"] = data.farmerName | ||||
| }else{ | }else{ | ||||
| this.dhdcform = res.data | |||||
| this.dhdcform["countName"] = data.countName | this.dhdcform["countName"] = data.countName | ||||
| this.dhdcform["townName"] = data.townName | this.dhdcform["townName"] = data.townName | ||||
| this.dhdcform["villageName"] = data.villageName | this.dhdcform["villageName"] = data.villageName | ||||
| @@ -897,16 +922,13 @@ export default { | |||||
| this.dhdcform["farmerName"] = data.farmerName | this.dhdcform["farmerName"] = data.farmerName | ||||
| this.dhdcform["samplingId"] = data.id | this.dhdcform["samplingId"] = data.id | ||||
| this.dhdcform["fileName"] = data.townName+data.villageName | this.dhdcform["fileName"] = data.townName+data.villageName | ||||
| } | } | ||||
| console.log(this.dhdcform) | |||||
| this.showDHDC=true | |||||
| }) | }) | ||||
| } | } | ||||
| }, | }, | ||||
| onSubmit(values) { | onSubmit(values) { | ||||
| this.queryParams = values | this.queryParams = values | ||||
| this.queryParams["createBy"] = "admin" | |||||
| this.queryParams["createBy"] = this.userId | |||||
| this.queryParams["createTime"] = "2020-01-01 00:00:00" | this.queryParams["createTime"] = "2020-01-01 00:00:00" | ||||
| addSampling(values).then(res => { | addSampling(values).then(res => { | ||||
| console.log(res) | console.log(res) | ||||
| @@ -915,9 +937,9 @@ export default { | |||||
| }) | }) | ||||
| }, | }, | ||||
| onSubmitXCDC(values) { | onSubmitXCDC(values) { | ||||
| this.xcdcform["createBy"] = "admin" | |||||
| this.xcdcform["createBy"] = this.userId | |||||
| this.xcdcform["createTime"] = "2020-01-01 00:00:00" | this.xcdcform["createTime"] = "2020-01-01 00:00:00" | ||||
| this.xcdcform["updateBy"] = "admin" | |||||
| this.xcdcform["updateBy"] = this.userId | |||||
| this.xcdcform["updateTime"] = "2020-01-01 00:00:00" | this.xcdcform["updateTime"] = "2020-01-01 00:00:00" | ||||
| let i = 0 | let i = 0 | ||||
| if(this.xcdcform.item1=='N'){ | if(this.xcdcform.item1=='N'){ | ||||
| @@ -994,9 +1016,9 @@ export default { | |||||
| }) | }) | ||||
| }}, | }}, | ||||
| onSubmitDHDC(values) { | onSubmitDHDC(values) { | ||||
| this.dhdcform["createBy"] = "admin" | |||||
| this.dhdcform["createBy"] = this.userId | |||||
| this.dhdcform["createTime"] = "2020-01-01 00:00:00" | this.dhdcform["createTime"] = "2020-01-01 00:00:00" | ||||
| this.dhdcform["updateBy"] = "admin" | |||||
| this.dhdcform["updateBy"] = this.userId | |||||
| this.dhdcform["updateTime"] = "2020-01-01 00:00:00" | this.dhdcform["updateTime"] = "2020-01-01 00:00:00" | ||||
| console.log(this.dhdcform) | console.log(this.dhdcform) | ||||
| if(this.dhdcform.id){ | if(this.dhdcform.id){ | ||||
| @@ -1061,7 +1083,6 @@ export default { | |||||
| onL() { | onL() { | ||||
| this.refreshing = true; | this.refreshing = true; | ||||
| this.loading = false; | this.loading = false; | ||||
| this.getList() | |||||
| this.refreshing = false; | this.refreshing = false; | ||||
| }, | }, | ||||
| onRefresh() { | onRefresh() { | ||||