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

款式委托 新增

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