Commit 11456cb3 by zhuxiaomei

bug修改

parent 651e7a25
...@@ -9,4 +9,5 @@ export default { ...@@ -9,4 +9,5 @@ export default {
edit: data => http.put('/drs/v1/sampling_shelf/' + data.id, data.obj).then(res => res), edit: data => http.put('/drs/v1/sampling_shelf/' + data.id, data.obj).then(res => res),
deleteByIds: ids => http.delete('/drs/v1/sampling_shelf/?ids=' + ids).then(res => res), deleteByIds: ids => http.delete('/drs/v1/sampling_shelf/?ids=' + ids).then(res => res),
getById: id => http.get('/drs/v1/sampling_shelf/' + id).then(res => res), getById: id => http.get('/drs/v1/sampling_shelf/' + id).then(res => res),
checkPlaceDelete: data => http.post('/drs/v1/sampling_shelf/check_place_delete' ,data).then(res => res),
} }
...@@ -13,4 +13,5 @@ export default { ...@@ -13,4 +13,5 @@ export default {
lastTester: () => http.post('/drs/v1/sampling_summary/last_tester').then(res => res), lastTester: () => http.post('/drs/v1/sampling_summary/last_tester').then(res => res),
getTester: data => http.post('/drs/v1/sampling_summary/get_tester_by_name',data).then(res => res), getTester: data => http.post('/drs/v1/sampling_summary/get_tester_by_name',data).then(res => res),
getProducter: data => http.post('/drs/v1/sampling_summary/get_producter_by_name',data).then(res => res), getProducter: data => http.post('/drs/v1/sampling_summary/get_producter_by_name',data).then(res => res),
checkShelfDelete: data => http.post('/drs/v1/sampling_summary/check_shelf_delete',data).then(res => res),
} }
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</div> </div>
<template #right> <template #right>
<van-button square type="danger" text="删除" class="swipe-cell-btn" <van-button square type="danger" text="删除" class="swipe-cell-btn"
@click="_del(item.id)"></van-button> @click="_delCheck(item.id)"></van-button>
</template> </template>
</van-swipe-cell> </van-swipe-cell>
</van-list> </van-list>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</template> </template>
<script> <script>
import {samplingShelf} from '../../api' import {samplingShelf,samplingSummary} from '../../api'
export default { export default {
name: "GoodsShelves", name: "GoodsShelves",
...@@ -79,6 +79,21 @@ ...@@ -79,6 +79,21 @@
this.page = this.page + 1; this.page = this.page + 1;
this._getData() this._getData()
}, },
_delCheck:async function(id){
let result = await samplingSummary.checkShelfDelete({shelfId:id})
if(result){
let that = this;
this.$dialog.confirm({
title: '提示',
message: result,
}).then(() => {
that._del(id)
}).catch(() => {
});
}else{
this._del(id)
}
},
_del: async function (id) { _del: async function (id) {
let result = await samplingShelf.deleteByIds([id]) let result = await samplingShelf.deleteByIds([id])
if (result) { if (result) {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<van-button square type="info" text="打卡" class="swipe-cell-btn" <van-button square type="info" text="打卡" class="swipe-cell-btn"
@click="_getWebLoc(item.id)"></van-button> @click="_getWebLoc(item.id)"></van-button>
<van-button square type="danger" text="删除" class="swipe-cell-btn" <van-button square type="danger" text="删除" class="swipe-cell-btn"
@click="_delLoc(item.id)"></van-button> @click="_delCheck(item.id)"></van-button>
</template> </template>
</van-swipe-cell> </van-swipe-cell>
</van-list> </van-list>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<script> <script>
import BaiduMap from '../../lib/map' import BaiduMap from '../../lib/map'
import {samplingPlace, attendanceRecord} from '../../api' import {samplingPlace, attendanceRecord, samplingShelf} from '../../api'
import SelectLocation from './components/SelectLocation' import SelectLocation from './components/SelectLocation'
export default { export default {
...@@ -129,6 +129,22 @@ ...@@ -129,6 +129,22 @@
_goto(data) { _goto(data) {
this.$router.push({path: '/sampling_task/goods_shelves', query: {placeId: data.id}}) this.$router.push({path: '/sampling_task/goods_shelves', query: {placeId: data.id}})
}, },
_delCheck: async function (id) {
let result = await samplingShelf.checkPlaceDelete({placeId: id})
if (result) {
let that = this;
this.$dialog.confirm({
title: '提示',
message: result,
}).then(() => {
that._delLoc(id)
}).catch(() => {
// on cancel
});
}else{
this._delLoc(id)
}
},
_delLoc: async function (id) { _delLoc: async function (id) {
let result = await samplingPlace.edit({id: id, obj: {planId: this.planId, selected: 0}}) let result = await samplingPlace.edit({id: id, obj: {planId: this.planId, selected: 0}})
if (result) { if (result) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment