From 85e23229beb4c6dbb0cd13a6e7e1ca059fe8be73 Mon Sep 17 00:00:00 2001 From: ljx120 <10717296+ljx120@user.noreply.gitee.com> Date: Thu, 2 Jan 2025 17:25:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E5=81=9A=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .hbuilderx/launch.json | 9 +- pages/customOrder/customOrder.vue | 158 ++++++++++------ pages/spot/audit.vue | 41 +++- pages/spot/list.vue | 109 +++++------ pages/spot/pass.vue | 302 ++++-------------------------- pages/spot/spot.vue | 38 ++-- 6 files changed, 241 insertions(+), 416 deletions(-) diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json index 15db785..af5e32d 100644 --- a/.hbuilderx/launch.json +++ b/.hbuilderx/launch.json @@ -4,6 +4,13 @@ { "playground" : "standard", "type" : "uni-app:app-ios" - } + }, + { + "mp-weixin" : + { + "launchtype" : "local" + }, + "type" : "uniCloud" + } ] } diff --git a/pages/customOrder/customOrder.vue b/pages/customOrder/customOrder.vue index 16d6dae..adb764c 100644 --- a/pages/customOrder/customOrder.vue +++ b/pages/customOrder/customOrder.vue @@ -4,14 +4,17 @@ import { getAction } from '../../common/http'; import { showToast } from 'vant'; - const formList = ref([] as any[]) + const craftList = ref([] as any[]) const otherList = ref([] as any[]) + const hasTex = ref('' as any) + const nameList = ref([] as any[]) onMounted(() => { uni.getStorage({ key: 'info', success(res) { let data = JSON.parse(res.data) - form.value.supplier = data.userName + form.value.customOrder.makeUser = data.userName + form.value.customOrder.belongTo = data.userName }, fail: (err : any) => { console.log(err); @@ -19,7 +22,7 @@ }) getAction('/fabric/craft/info').then((res : any) => { if (res.code === 200) { - formList.value = res.data + craftList.value = res.data.map((l : any) => ({ value: l.name, text: l.name })) } }) getAction('/fabric/info/all').then((res : any) => { @@ -47,15 +50,14 @@ }) } }) - getAction('/color/list').then((res : any) => { + getAction('/v1/user/getNames').then((res : any) => { if (res.code === 200) { - + nameList.value = res.data.map((l : any) => ({ value: l, text: l })) } }) getAction('/extraOption').then((res : any) => { if (res.code === 200) { otherList.value = JSON.parse(res.data.payload) - console.log(otherList.value); } }) }) @@ -68,7 +70,7 @@ } - const form = ref({ fabrics: [{processes:[{}]}] } as any) + const form = ref({ customOrder: { makeTime: formatDate(new Date()) }, orderItems: [{ fabric: [{}] }] } as any) const showPicker = ref(false) const typeData = ref() const popuList = ref([] as any[]) @@ -79,16 +81,22 @@ const searchValue = ref('')//查询的值 const searchIndex = ref(0)//查询到的数组 const mlList = ref([]) + const indexData = ref() //选择框事件 - const choosePic = (type : any) => { + const choosePic = (type : any, index : any) => { showPicker.value = true typeData.value = type + indexData.value = index } //选择框确认 const pickerConfirm = (val : any) => { - if (typeData.value === 'level') { + if (typeData.value === 'craft') { + form.value.orderItems[indexData.value][typeData.value] = val.selectedValues[0] + } else if (typeData.value === 'hasTex') { + hasTex.value = val.selectedOptions[0].text + form.value.customOrder[typeData.value] = val.selectedOptions[0].value } else { - form.value[typeData.value] = val.selectedValues[0] + form.value.customOrder[typeData.value] = val.selectedValues[0] } showPickerCancel() } @@ -98,23 +106,29 @@ } //弹窗开启事件 const handleOpen = () => { - if (typeData.value === 'supplier') { - popuList.value = [] - } else if (typeData.value === 'level') { - popuList.value = [] + if (typeData.value === 'craft') { + popuList.value = craftList.value + } else if (typeData.value === 'hasTex') { + popuList.value = [{ value: 'true', text: '含税' }, { value: 'false', text: '不含税' }] + } else if (typeData.value === 'belongTo') { + popuList.value = nameList.value } } - const chooseDate = () => { + + const chooseDate = (type : any) => { + typeData.value = type show.value = true } //日期选择 const onConfirmDate = (val : any) => { - form.value.createTime = formatDate(val) + form.value.customOrder[typeData.value] = formatDate(val) show.value = false } //选择面料 - const selectChoose = () => { + const selectChoose = (index : any, indexSecond : any) => { + indexData.value = index + typeData.value = indexSecond showPickerList.value = true } //面料开启 @@ -178,9 +192,30 @@ }, 800) } const onConfirm = (val : any) => { - form.value.fabricName = val.selectedValues[2] + '/' + val.selectedValues[0] + val.selectedValues[1] + form.value.orderItems[indexData.value].fabric[typeData.value].name = val.selectedValues[2] + '/' + val.selectedValues[0] + val.selectedValues[1] pickerCancel() } + const activeIds = ref([1, 2]); + const activeIndex = ref(0); + const items = [ + { + text: '浙江', + children: [ + { text: '杭州', id: 1 }, + { text: '温州', id: 2 }, + { text: '宁波', id: 3, }, + ], + }, + { + text: '江苏', + children: [ + { text: '南京', id: 4 }, + { text: '无锡', id: 5 }, + { text: '徐州', id: 6 }, + ], + }, + { text: '福建', }, + ];