diff --git a/pages/index/instruct.vue b/pages/index/instruct.vue index 12da01d..76e4d9e 100644 --- a/pages/index/instruct.vue +++ b/pages/index/instruct.vue @@ -5,35 +5,44 @@ - + - + - + + + + + + + + + - - + + - - - - - - - - - + + + + - 未发送 - 已发送 + 未发送 + 已发送 @@ -168,8 +177,8 @@ - 发送 - {{item.status}} + 发送 + {{item.status}} @@ -195,7 +204,7 @@ 型号:特斯拉plus - + 详情 @@ -267,11 +276,69 @@ } from 'vuex' import HeadView from '@/components/head-view/head-view.vue'; import HeadInfo from '@/components/head-info/head-info'; + let timers = null; export default { data() { return { - id: "",// 进入页面的初始id - value1: "", + id: "", // 进入页面的初始id + menuList: [], // 筛选框 + defaultValue: {}, + mnfBl: '', // 提单号 + mnfBlItem: {}, + mnfBlList: [], + brdId: '', // 品牌 + brdName: '', // 品牌 + brandItem: {}, + brandList: [], + harbour: '', // 港区 + harbourRange: [{ + value: 1, + text: '全部' + }, { + value: 2, + text: '内贸' + }, { + value: 3, + text: '外贸' + }], + type: '', // 贸易类型 + typeRange: [{ + value: 1, + text: '全部' + }, { + value: 2, + text: '内贸' + }, { + value: 3, + text: '外贸' + }], + bvmName: '', // 车型 + bvmItem: {}, + bvmList: [], + potName: '', // 港口 + potItem: {}, + potList: [], + status: '', // 贸易类型 + statusRange: [{ + value: 1, + text: '待发送' + }, { + value: 2, + text: '已发送' + }, { + value: 3, + text: '待作业' + }, { + value: 4, + text: '作业中' + }, { + value: 5, + text: '暂停' + }, { + value: 6, + text: '已完成' + }], + value: '', itemList: [], range: [1], @@ -309,6 +376,56 @@ onLoad() { this.id = this.$route.query.id; this.loadSumOrder() // 总指令:分页查询 + setTimeout(() => { + this.menuList = [{ + 'title': '计划状态', + 'type': 'custom', + 'key': 'custom1', + 'isMutiple': false, //多选 + 'detailList': [{ + title: '待发送', + value: "1", + isSelected: true + }, { + title: '已发送', + value: "2", + }, { + title: '待作业', + value: "3", + }, { + title: '作业中', + value: "4", + }, { + title: '暂停', + value: "5", + }, { + title: '已完成', + value: "6", + }], + }, { + 'title': '按车型', + 'type': 'custom', + 'key': 'custom2', + 'isMutiple': true, //多选 + 'detailList': [{ + title: '车型1', + value: "1", + }, { + title: '车型2', + value: "2", + }, { + title: '车型3', + value: "3", + }, { + title: '车型4', + value: "4", + }], + }] + this.defaultValue = { + custom1: ['1'], + custom5: 1, + }; + }, 2000) }, components: { HeadView, @@ -319,6 +436,19 @@ 'majax', 'najax' ]), + onSearch() { + console.log('搜索'); + console.log(this.potName); + }, + // 点击筛选 + screen() { + this.$refs.condition.visibleDrawer = true; + }, + resultConditon(obj) { + this.$refs.condition.visibleDrawer = false; + this.hasChoose = obj.hasChoose; + console.log(obj); + }, loadSumOrder() { let data = {} data.bvmId = this.id @@ -327,7 +457,7 @@ params: data, method: 'GET' }).then(res => { - this.itemList = res.data.records + // this.itemList = res.data.records }) // 模拟 this.itemList = [{ //已发送 @@ -355,12 +485,13 @@ loadOtherOrder() { let data = {} data.bvmId = this.id + data.sendStatus = this.active // 未发生0已发送1 this.majax({ url: this.$local + "/api/shipInstructions/pageCommandForBranch", params: data, method: 'GET' }).then(res => { - this.itemList = res.data.records + // this.itemList = res.data.records }) // 模拟分指令 this.itemList = [{ //已发送 @@ -389,34 +520,40 @@ status: '暂停' } ] + console.log(2); + console.log(this.itemList); }, tabChange(tag) { this.active = tag - if (this.active == 1) { - console.log(1); + if (this.active == 0) { + this.loadOtherOrder() + console.log(0); } else { - console.log(2); - + this.loadOtherOrder() + console.log(1); } }, - change() {}, + change(e) { + console.log(e); + console.log(this.harbour); + }, radioChange: function(evt) { for (let i = 0; i < this.items.length; i++) { if (this.items[i].value === evt.detail.value) { this.current = i; - switch(this.current) { - case 1: - this.loadSumOrder() - break; - case 2: - this.loadOtherOrder() - break; - default: - } + switch (this.current) { + case 0: + this.loadSumOrder() + break; + case 1: + this.loadOtherOrder() + break; + default: + } break; } } - + }, isActive(e) { this.itemActive = e @@ -442,22 +579,142 @@ }).then(res => { console.log(res); }) + console.log('重新发送'); }, // 暂停指令 - onPause() { + onPause(tag) { + if (tag == '暂停') { + let data = {} + data.lwpId = '111' + this.majax({ + url: this.$local + "/api/shipInstructions/commandPause", + params: data, + method: 'GET' + }).then(res => { + console.log(res); + }) + console.log('暂停'); + } else if (tag == '重新发送') { + this.onReissued() + } + + }, + + // 提单号 + mnfBlInput(e) { + clearTimeout(timers) + timers = setTimeout(() => { + this.getMnfBl(e) + }, 500) + }, + mnfBlSelect(e) { + this.shipItem = e + }, + // 获取提单号 + getMnfBl(keyWords) { let data = {} - data.lwpId = '111' + data.ieType = 'I' // I进口 E出口 暂无法区分 + data.key = keyWords + data.pamId = this.id this.majax({ - url: this.$local + "/api/shipInstructions/commandPause", + url: this.$local + "/api/shipInstructions/queryByKey", params: data, method: 'GET' }).then(res => { - console.log(res); + this.mnfBlList = res.data }) + // 模拟 + this.mnfBlList = [{ + id: 1123, + mnfBl: '测试提单号' + }] }, - toDetails() { + // 品牌 + brandInput(e) { + clearTimeout(timers) + timers = setTimeout(() => { + this.getBrand(e) + }, 500) + }, + brandSelect(e) { + this.brandItem = e + this.brdId = e.brdId + }, + // 获取品牌 + getBrand(keyWords) { + let data = {} + data.brdName = keyWords + this.majax({ + url: this.$local + "/api/miniapp/queryBrand", + params: data, + method: 'GET' + }).then(res => { + this.brandList = res.data + }) + // 模拟 + this.brandList = [{ + brdId: 1123, + brdName: '测试品牌' + }] + }, + // 港口 + potInput(e) { + clearTimeout(timers) + timers = setTimeout(() => { + this.getPot(e) + }, 500) + }, + potSelect(e) { + this.potItem = e + this.potId = e.potId + }, + // 获取港口 + getPot(keyWords) { + let data = {} + data.potCnname = keyWords + this.majax({ + url: this.$local + "/api/miniapp/port", + params: data, + method: 'GET' + }).then(res => { + this.potList = res.data + }) + // 模拟 + this.potList = [{ + potId: 1123, + potName: '测试港口' + }] + }, + // 车型 + bvmInput(e) { + clearTimeout(timers) + timers = setTimeout(() => { + this.getBvm(e) + }, 500) + }, + bvmSelect(e) { + this.bvmItem = e + }, + // 获取车型 + getBvm(keyWords) { + let data = {} + data.key = keyWords + this.majax({ + url: this.$local + "/api/miniapp/port", + params: data, + method: 'GET' + }).then(res => { + this.bvmList = res.data + }) + // 模拟 + this.bvmList = [{ + bvmId: 1123, + bvmName: '测试车型' + }] + }, + toDetails(id) { uni.navigateTo({ - url: '/pages/index/instructDetails' + url: '/pages/index/instructDetails?id=' + id }) } } @@ -477,14 +734,23 @@ display: flex; .select { - width: 100px; - margin-left: 15px; + width: 150px; + margin-right: 20px; } .input { - width: 200px; + width: 150px; height: 35px; line-height: 35px; + margin-right: 20px; + } + + .btn { + width: 60px; + height: 35px; + line-height: 35px; + margin: 0 20px 0 0; + } } diff --git a/pages/index/instructDetails.vue b/pages/index/instructDetails.vue index 6314da3..125fc19 100644 --- a/pages/index/instructDetails.vue +++ b/pages/index/instructDetails.vue @@ -360,15 +360,39 @@