diff --git a/pages.json b/pages.json index 64eb2dc..8d15fe3 100644 --- a/pages.json +++ b/pages.json @@ -315,6 +315,18 @@ "bounce": "none" } } + }, + { + "path" : "pages/documentary/documentary", + "style" : + { + "navigationStyle": "custom", + "enablePullDownRefresh": false, + "disableScroll": true, + "app-plus": { + "bounce": "none" + } + } } ], "globalStyle": { diff --git a/pages/customOrder/customOrder.vue b/pages/customOrder/customOrder.vue index 65dca6c..bc59a03 100644 --- a/pages/customOrder/customOrder.vue +++ b/pages/customOrder/customOrder.vue @@ -30,9 +30,9 @@ } }) //工艺信息 - getAction('/fabric/craft/info').then((res : any) => { + getAction('/flowBind').then((res : any) => { if (res.code === 200) { - craftList.value = res.data.map((l : any) => ({ value: l.name, text: l.name })) + craftList.value = res.data } }) //面料信息 @@ -83,14 +83,14 @@ } const onClickLeft = () => { - uni.navigateBack() + window.history.back(); } const onSubmit = () => { - postAction('/customOrder',form.value).then((res:any)=>{ - if(res.code===200){ + postAction('/customOrder', form.value).then((res : any) => { + if (res.code === 200) { showToast('提交成功!') - uni.navigateBack() + window.history.back(); } }) } @@ -124,7 +124,18 @@ form.value.customOrder[typeData.value] = val.selectedOptions[0].value } else if (typeData.value === 'extraOptions') { form.value.orderItems[indexData.value][typeData.value][indexData1.value].value = val.selectedValues[0] - } else { + } else if(typeData.value === 'craftFlow'){ + let url='/craftFlows/byName?name='+val.selectedValues[0] + getAction(url).then((res:any)=>{ + if(res.code===200){ + form.value.orderItems[indexData.value].process=JSON.stringify(res.data) + form.value.orderItems[indexData.value][typeData.value] = val.selectedValues[0] + }else{ + showToast('请重新选择工艺流程!') + form.value.orderItems[indexData.value][typeData.value] = '' + } + }) + } else{ form.value.customOrder[typeData.value] = val.selectedValues[0] } showPickerCancel() @@ -136,13 +147,28 @@ //弹窗开启事件 const handleOpen = () => { if (typeData.value === 'craft') { - popuList.value = craftList.value + popuList.value = craftList.value.map((l : any) => ({ value: l.craftName, text: l.craftName })) } else if (typeData.value === 'hasTex') { popuList.value = [{ value: 'true', text: '含税' }, { value: 'false', text: '不含税' }] } else if (typeData.value === 'belongTo') { popuList.value = nameList.value } else if (typeData.value === 'extraOptions') { popuList.value = otherList.value[indexData.value].options.map((l : any) => ({ text: l.name, value: l.name })) + }else if (typeData.value === 'craftFlow') { + let item={} as any + craftList.value.forEach((l:any)=>{ + if(l.craftName===form.value.orderItems[indexData.value].craft){ + item=l; + } + }) + popuList.value = [] + if(item.flows){ + item.flows.forEach((l : any) => { + if(l.bind==='通用') { + popuList.value.push({ value: l.name, text: l.name} ) + } + }) + } } } @@ -279,17 +305,17 @@ form.value.customOrder.currency = ddje.toFixed(1) } const validator = (val : any) => /^\d+(\.\d)?$|^(\.\d)$/.test(val); - + //客户选择 const showPopup = ref(false) const customerList = ref([] as any[]) - const choose = (item:any) =>{ - showPopup.value = !showPopup.value - form.value.customOrder.customerName=item.name - form.value.customOrder.customerId=item.id + const choose = (item : any) => { + showPopup.value = !showPopup.value + form.value.customOrder.customerName = item.name + form.value.customOrder.customerId = item.id } - - const search = () =>{ + + const search = () => { if (timer.value) { clearTimeout(timer.value) } @@ -297,12 +323,12 @@ getCustom() }, 800) } - const getCustom = () =>{ + const getCustom = () => { showPopup.value = !showPopup.value - let url='/getNames?keyword='+form.value.customOrder.customerName - getAction(url).then((res:any)=>{ - if(res.code===200){ - customerList.value=res.data + let url = '/getNames?keyword=' + form.value.customOrder.customerName + getAction(url).then((res : any) => { + if (res.code === 200) { + customerList.value = res.data } }) } @@ -315,7 +341,7 @@ + label-width="5em" :rules="[{ required: true, message: '请填写' }]" @input="search()" />