Commit 7dc00c29 authored by 李星剑's avatar 李星剑

款式委托 新增

parent 0959a22f
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<image class="width_100 hs-height-160" src="@/static/images/home/1@2x.png" mode=""></image> <image class="width_100 hs-height-160" src="@/static/images/home/1@2x.png" mode=""></image>
<view class="order_tit"> <view class="order_tit">
<view class="u-flex justify-between u-font-32"> <view class="u-flex justify-between u-font-32">
<span class="color_DDA973 u-line-1">{{ item.name }}</span> <span class="color_DDA973 u-line-1">{{ item.materialName }}</span>
<span><u-icon size="24" color="#fff" name="arrow-right"></u-icon></span> <span><u-icon size="24" color="#fff" name="arrow-right"></u-icon></span>
</view> </view>
<view class="u-font-24 u-m-t-20 color_6F6F72"> <view class="u-font-24 u-m-t-20 color_6F6F72">
......
...@@ -15,12 +15,12 @@ export default { ...@@ -15,12 +15,12 @@ export default {
// 编辑委托单 // 编辑委托单
update:{ update:{
url: `${base}/update`, url: `${base}/update`,
method: 'post' method: 'put'
}, },
// 拆分委托单 // 拆分委托单
split:{ split:{
url: `${base}/split`, url: `${base}/split`,
method: 'post' method: 'put'
}, },
// 删除委托单 // 删除委托单
del:{ del:{
......
This diff is collapsed.
<template>
</template>
<script>
export default {
name: "editItem"
}
</script>
<style scoped>
</style>
This diff is collapsed.
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
:border-bottom="false" :border-bottom="false"
:background="{backgroundColor: 'whitesmoke'}"> :background="{backgroundColor: 'whitesmoke'}">
<template v-slot:right> <template v-slot:right>
新增面料 <!-- 新增面料-->
</template> </template>
</u-navbar> </u-navbar>
<view class="title u-p-30">选择面料</view> <view class="title u-p-30">选择面料</view>
...@@ -85,17 +85,33 @@ export default { ...@@ -85,17 +85,33 @@ export default {
] ]
} }
}, },
onLoad(){
this.getList();
},
methods:{ methods:{
getList(){
this.$http('orderTicket.materialList', {
size: 4,
materialCode: '',
materialName: ''
}).then(res => {
let { code, data } = res;
if (code == 200) {
this.list = data.data;
}
});
},
triggerSelectItem(index){ triggerSelectItem(index){
this.selectedIndex = index === this.selectedIndex ? -1 : index; this.selectedIndex = index === this.selectedIndex ? -1 : index;
}, },
// 跳转到新增详情页面 // 跳转到新增详情页面
toAddItem({id}){ toAddItem(){
uni.setStorageSync("_item", this.list[this.selectedIndex]);
this.$Router.push({ this.$Router.push({
path:"/pages/designCommissioned/addItem", path:"/pages/designCommissioned/addItem",
query:{ // query:{
id // id: this.list[this.selectedIndex].id
} // }
}) })
}, },
// 跳转到面料详情 // 跳转到面料详情
......
...@@ -12,14 +12,20 @@ export default { ...@@ -12,14 +12,20 @@ export default {
} }
return data return data
} }
return new Promise((resolve, reject) =>{
this.$http("orderTicket.styleTreeList").then(res =>{ this.$http("orderTicket.styleTreeList").then(res =>{
let { let {
code, data code, data
} = res; } = res;
if(code === 200){ if(code === 200){
this.brandSelectList = filterArray(data); this.brandSelectList = filterArray(data);
resolve();
} }
}).catch(err =>{
reject(err);
}) })
})
}, },
} }
} }
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</view> </view>
<view class="u-p-30 bg-fff"> <view class="u-p-30 bg-fff">
<hs-tip-title title="风格款数要求"></hs-tip-title> <hs-tip-title title="风格款数要求"></hs-tip-title>
<view v-for="(item,index) in detail.orderTicketStyleRequirementsVOList" :key="index" class="u-p-t-16 u-p-b-30 u-border-bottom"> <view v-for="(item,index) in detail.designRequirementsDTOList" :key="index" class="u-p-t-16 u-p-b-30 u-border-bottom">
<view class="u-flex u-p-b-16"> <view class="u-flex u-p-b-16">
<view class="u-line-1 u-flex-1"> <view class="u-line-1 u-flex-1">
{{item.name}} {{item.name}}
...@@ -28,16 +28,19 @@ ...@@ -28,16 +28,19 @@
</view> </view>
<u-select <u-select
label-name="name"
value-name="id"
@confirm="brandSelectCallback" @confirm="brandSelectCallback"
safe-area-inset-bottom v-model="brandSelectShow" :list="brandSelectList" mode="mutil-column-auto"></u-select> safe-area-inset-bottom v-model="brandSelectShow" :list="brandSelectList" mode="mutil-column-auto"></u-select>
<!-- 删除风格款数模态框 --> <!-- 删除风格款数模态框 -->
<u-modal v-model="modal.show" :content="modal.content" @confirm="modalConfirm" ></u-modal> <u-modal v-model="modal.show" :content="modal.content" @confirm="modalConfirm" ></u-modal>
<!--提示-->
<u-toast ref="uToast" />
<view class="footer" id="footer"> <view class="footer" id="footer">
<view class="footer-btn"> <view class="footer-btn">
<view class="custom-style-round-circle custom-style-btn custom-style"> <view class="custom-style-round-circle custom-style-btn custom-style">
<view class="custom-style-left save" @click="save">保存</view> <view class="custom-style-left save" @click="saveData">保存</view>
<view class="custom-style-right submit" @click="submit"> <view class="custom-style-right submit" @click="submitData">
<view class="title">立即发布</view> <view class="title">立即发布</view>
<view class="desc">将被拆分为<text class="color">2个委托</text></view> <view class="desc">将被拆分为<text class="color">2个委托</text></view>
</view> </view>
...@@ -48,6 +51,7 @@ ...@@ -48,6 +51,7 @@
</template> </template>
<script> <script>
import styleTree from "./mixins/styleTree" import styleTree from "./mixins/styleTree"
import HsTipTitle from "../../components/hs-tip-title/hs-tip-title"; import HsTipTitle from "../../components/hs-tip-title/hs-tip-title";
export default { export default {
...@@ -66,23 +70,23 @@ export default { ...@@ -66,23 +70,23 @@ export default {
activeIndex: -1, activeIndex: -1,
brandSelectList: [], brandSelectList: [],
detail: { detail: {
orderTicketStyleRequirementsVOList: [ // "id": 1, //委托单id
// "materialId": 1, //面料id
// "fileCode": "", //面料主图code
designRequirementsDTOList: [
], ],
}, },
} }
}, },
onLoad({id}) { async onLoad({id}) {
await this.getStyleTreeList();
this.getItemMsg(id); this.getItemMsg(id);
this.getStyleTreeList();
}, },
computed:{ computed:{
mdmMaterial(){ mdmMaterial(){
return { return this.detail
name: this.detail.mdmMaterialName,
...this.detail,
// name: item.mdmMaterialName,
}
} }
}, },
methods:{ methods:{
...@@ -98,12 +102,55 @@ export default { ...@@ -98,12 +102,55 @@ export default {
delItem(index){ delItem(index){
this.detail.orderTicketStyleRequirementsVOList.splice(index,1); this.detail.orderTicketStyleRequirementsVOList.splice(index,1);
}, },
filterStyleNameById(id){
/**
* 回填品类 显示 string => []
* @param data
* @param value
* @return [Array]
* */
function filterCategory(data,value){
let res = [];
function filters(data,value,parent = []){
for (let i = 0; i < data.length; i++) {
if(data[i].id == value){
res = [].concat(parent,data[i])
}else{
if(data[i].children && data[i].children.length > 0){
filters(
data[i].children,
value,
parent.concat(data[i])
)
}
}
}
}
filters(data,value)
return res;
}
return filterCategory(this.brandSelectList,id).map((item) =>{
return item.name
}).join("|")
},
getItemMsg(id){ getItemMsg(id){
this.$http("orderTicket.detail",1).then(res =>{ this.detail.id = id;
this.$http("orderTicket.detail", id).then(res =>{
let { let {
code, data code, data
} = res; } = res;
if(code === 200){
this.detail = {
designRequirementsDTOList: data.orderTicketStyleRequirementsVOList.map((item) =>{
return {
...item,
name: this.filterStyleNameById(item.styleId)
}
}),
id: data.id,
materialId: data.mdmMaterialId,
}
}
}) })
}, },
addBrandList(){ addBrandList(){
...@@ -111,18 +158,49 @@ export default { ...@@ -111,18 +158,49 @@ export default {
}, },
brandSelectCallback(e){ brandSelectCallback(e){
this.brandList.push({ this.detail.designRequirementsDTOList.push({
num: 0, quantity: 0,
styleId: e[e.length - 1].value,
isDeleted: false,
name: e.map((item) => { name: e.map((item) => {
return item.label return item.label
}).join("|") }).join("|")
}) })
}, },
submit(){ toBack(){
this.$Router.back();
}, },
save(){ toast(msg,callback){
this.$refs.uToast.show({
title: msg,
callback: ()=>{
callback && callback();
}
});
},
submit(operationType){
this.$http("orderTicket.split",{
...this.detail,
operationType
}).then(res => {
// this.$Router.back();
let {
code, msg
} = res;
if(code === 200){
this.toast(msg,()=>{
this.back();
})
}else{
this.toast(msg)
}
})
},
submitData(){
this.submit(2)
},
saveData(){
this.submit(1)
}, },
} }
} }
......
...@@ -371,7 +371,7 @@ export default { ...@@ -371,7 +371,7 @@ export default {
// 注册成功 跳转到首页 // 注册成功 跳转到首页
goIndex(){ goIndex(){
this.$Router.replace({ this.$Router.replace({
path: '/pages/index/index' path: '/pages/home/index'
}) })
}, },
// 获取详情 过滤状态 如果完善就跳转首页 // 获取详情 过滤状态 如果完善就跳转首页
...@@ -540,7 +540,7 @@ export default { ...@@ -540,7 +540,7 @@ export default {
if (this.time === 0) { if (this.time === 0) {
clearInterval(timer); clearInterval(timer);
this.$Router.replace({ this.$Router.replace({
path: '/pages/index/index' path: '/pages/home/index'
}) })
} }
}, 1000); }, 1000);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</view> </view>
<!-- <button @click="getTenanList">getTenanList</button>--> <!-- <button @click="getTenanList">getTenanList</button>-->
<button @click="next" :disabled="active === -1">下一步</button> <button @click="next" :disabled="active === -1">下一步</button>
<button @click="login">下一步</button> <!-- <button @click="login">下一步</button>-->
<!-- <view>encryptToken结果:{{token}}</view>--> <!-- <view>encryptToken结果:{{token}}</view>-->
</view> </view>
</template> </template>
...@@ -30,6 +30,7 @@ export default { ...@@ -30,6 +30,7 @@ export default {
// "tenantPlat": "string", // "tenantPlat": "string",
// "globalUserId": "string" // "globalUserId": "string"
// } // }
// {globalId: "1375592964957573120", tenantId: "1442659610786926593", subId: "1442659610786926600"}
], ],
active: -1, active: -1,
token: "", token: "",
...@@ -84,7 +85,7 @@ export default { ...@@ -84,7 +85,7 @@ export default {
uni.setStorageSync('encryptToken',"") uni.setStorageSync('encryptToken',"")
}, },
login(){ login(){
uni.setStorageSync('encryptToken',"MBN9Om00MUE9CEcnizCOwinwRe5NJNdZb4JyDT3/ze+vyyv5QNXVoo0Sb65Gptgdy9BZZFX36tEge08iDEzLHIYsLS95bnrcwUOh1tp9pMiJ0XYNBFnFcHFXP9AgeAmYe9EXW+akUkx4Zr7PGiG7eqhuabLlPisHhoQOBfFFTwQ=") // uni.setStorageSync('encryptToken',"MBN9Om00MUE9CEcnizCOwinwRe5NJNdZb4JyDT3/ze+vyyv5QNXVoo0Sb65Gptgdy9BZZFX36tEge08iDEzLHIYsLS95bnrcwUOh1tp9pMiJ0XYNBFnFcHFXP9AgeAmYe9EXW+akUkx4Zr7PGiG7eqhuabLlPisHhoQOBfFFTwQ=")
// 核对 // 核对
this.$http( this.$http(
"auth.checkSecretKey", "auth.checkSecretKey",
...@@ -124,7 +125,7 @@ export default { ...@@ -124,7 +125,7 @@ export default {
// 跳转到首页 // 跳转到首页
toIndexPage(){ toIndexPage(){
this.$Router.push({ this.$Router.push({
path: "/pages/index/index" path: "/pages/home/index"
}) })
}, },
checkStatus(data){ checkStatus(data){
......
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