Commit e2cbdf26 authored by renjintao's avatar renjintao

jugement

parent 702f110f
<template> <template>
<div class="wu_bg"> <div class="wu_bg">
<div class="mass_box"> <div class="mass_box">
<div class="mass_list"> <div class="mass_list">
<h2 class="btn_play">未完工({{cardlist.length}} <h2 class="btn_play">未完工({{cardlist.length}}
<Button class="button" type="primary" @click="allcheck">全选</Button> <Button class="button" type="primary" @click="allcheck">全选</Button>
<Button class="button" type="primary" @click="rechecked">反选</Button> <Button class="button" type="primary" @click="rechecked">反选</Button>
</h2> </h2>
<div class="list01"> <div class="list01">
<Tag <Tag type="dot" :checkable="true" class="tag_card" size="large" v-for="(item,index) in cardlist" :name="item.id" :key="index" :checked="item.checked" color="primary" @on-change="changeCards">{{item.prefix}}.{{item.code}}</Tag>
type="dot" :checkable="true" </div>
class="tag_card" size="large" </div>
v-for="(item,index) in cardlist" <div class="chuanse">
:name="item.id" :key="index" :checked="item.checked" <Button class="button04" @click="chansehege">合格</Button>
color="primary" @on-change="changeCards" <Button class="button01" @click="chanserang">让步</Button>
>{{item.prefix}}.{{item.code}}</Tag> <Button class="button02" @click="chansefan">返修</Button>
<Button class="button03" @click="chansefei">不合格品</Button>
</div>
<div class="mass_list hege_box" v-if="hegelist.length>0">
<h2 class="hege">
合格({{hegelist.length}}
<Button class="fr" @click="consoleFun(0)">
<Icon type="md-close" />
</Button>
</h2>
<div class="list02">
<Tag type="dot" class="tag_card02" v-for="(item,index) in hegelist" :key="index" :name="item.id" :checkable="false" closable @on-close="hegeClose">{{item.prefix}}.{{ item.code}}</Tag>
</div>
</div> </div>
</div> <div class="mass_list rangbu" v-if="ranglist.length>0">
<div class="chuanse"> <h2 class="rangb">
<Button class="button04" @click="chansehege">合格</Button> 让步({{ranglist.length}}
<Button class="button01" @click="chanserang">让步</Button> <!-- consoleFun cansolRang -->
<Button class="button02" @click="chansefan">返修</Button> <Button class="fr" @click="consoleFun(1)">
<Button class="button03" @click="chansefei">不合格品</Button> <Icon type="md-close" />
</div> </Button>
<div class="mass_list hege_box" v-if="hegelist.length>0"> </h2>
<h2 class="hege"> <div class="list02">
合格({{hegelist.length}} <Tag type="dot" class="tag_card02" v-for="(item,index) in ranglist" :key="index" :name="item.id" :checkable="false" closable @on-close="handleClose">{{item.prefix}}.{{ item.code}}</Tag>
<Button class="fr" @click="consoleFun(0)"> </div>
<Icon type="md-close" />
</Button>
</h2>
<div class="list02">
<Tag
type="dot"
class="tag_card02"
v-for="(item,index) in hegelist"
:key="index"
:name="item.id"
:checkable="false"
closable
@on-close="hegeClose"
>{{item.prefix}}.{{ item.code}}</Tag>
</div> </div>
</div> <div class="mass_list fanxiu_box" v-if="fanlist.length>0">
<div class="mass_list rangbu" v-if="ranglist.length>0"> <h2 class="fanxiu">
<h2 class="rangb"> 返修({{fanlist.length}}
让步({{ranglist.length}} <Button class="fr" @click="consoleFun(2)">
<!-- consoleFun cansolRang --> <Icon type="md-close" />
<Button class="fr" @click="consoleFun(1)"> </Button>
<Icon type="md-close" /> </h2>
</Button> <div class="list02">
</h2> <Tag type="dot" class="tag_card02" v-for="(item,index) in fanlist" :key="index" :name="item.id" :checkable="false" closable @on-close="fanClose">{{item.prefix}}.{{ item.code}}</Tag>
<div class="list02"> </div>
<Tag
type="dot" class="tag_card02"
v-for="(item,index) in ranglist" :key="index"
:name="item.id" :checkable="false"
closable @on-close="handleClose"
>{{item.prefix}}.{{ item.code}}</Tag>
</div> </div>
</div> <div class="mass_list fei_box" v-if="feilist.length>0">
<div class="mass_list fanxiu_box" v-if="fanlist.length>0"> <h2 class="feipin">
<h2 class="fanxiu"> 不合格品({{feilist.length}}
返修({{fanlist.length}} <Button class="fr" @click="consoleFun(3)">
<Button class="fr" @click="consoleFun(2)"> <Icon type="md-close" />
<Icon type="md-close" /> </Button>
</Button> </h2>
</h2> <div class="list02">
<div class="list02"> <Tag type="dot" class="tag_card02" v-for="(item,index) in feilist" :key="item.id" :name="item.id" :checkable="false" closable @on-close="feiClose">{{item.prefix}}.{{ item.code}}</Tag>
<Tag </div>
type="dot" class="tag_card02"
v-for="(item,index) in fanlist" :key="index"
:name="item.id" :checkable="false"
closable @on-close="fanClose"
>{{item.prefix}}.{{ item.code}}</Tag>
</div> </div>
</div> <div class="fei_right" v-if="feilist.length>0">
<div class="mass_list fei_box" v-if="feilist.length>0"> <Form :model="orderForm" :label-width="110" :rules="rules" ref="formValidate">
<h2 class="feipin"> <FormItem label="问题原因:" prop="question" style="width:100%">
不合格品({{feilist.length}} <Select v-model="orderForm.question" style="width:80%">
<Button class="fr" @click="consoleFun(3)"> <Option value class="option-text">请选择</Option>
<Icon type="md-close" /> <!-- :disabled="feilist.length == 0 ? true:false" placeholder="选择问题原因" -->
</Button> <Option v-for="item in problemList" :value="item.problem" :key="item.index">{{ item.problem }}</Option>
</h2> </Select>
<div class="list02"> </FormItem>
<Tag <FormItem label="责任归属:" prop="useroption" style="width:100%">
type="dot" class="tag_card02" <Select v-model="orderForm.useroption" style="width:80%">
v-for="(item,index) in feilist" :key="item.id" <Option value class="option-text">请选择</Option>
:name="item.id" :checkable="false" <Option v-for="item in blameList" :value="item.user" :key="item.index">{{ item.user }}</Option>
closable @on-close="feiClose" </Select>
>{{item.prefix}}.{{ item.code}}</Tag> </FormItem>
</Form>
</div> </div>
</div>
<div class="fei_right" v-if="feilist.length>0">
<Form :model="orderForm" :label-width="110" :rules="rules" ref="formValidate">
<FormItem label="问题原因:" prop="question" style="width:100%">
<Select v-model="orderForm.question" style="width:80%">
<Option value class="option-text">请选择</Option>
<!-- :disabled="feilist.length == 0 ? true:false" placeholder="选择问题原因" -->
<Option
v-for="item in problemList"
:value="item.problem"
:key="item.index"
>{{ item.problem }}</Option>
</Select>
</FormItem>
<FormItem label="责任归属:" prop="useroption" style="width:100%">
<Select v-model="orderForm.useroption" style="width:80%">
<Option value class="option-text">请选择</Option>
<Option v-for="item in blameList" :value="item.user" :key="item.index">{{ item.user }}</Option>
</Select>
</FormItem>
</Form>
</div>
</div> </div>
<div class="futer flex fc-ev" v-if="hegelist.length>0||ranglist.length>0||fanlist.length>0||feilist.length>0"> <div class="futer flex fc-ev" v-if="hegelist.length>0||ranglist.length>0||fanlist.length>0||feilist.length>0">
<Button class="button" size="large" type="primary" @click="sendOrder" v-if="feilist.length>0" v-noClick>送审</Button> <Button class="button" size="large" type="primary" @click="sendOrder" v-if="feilist.length>0" v-noClick>送审</Button>
<Button class="button" size="large" type="primary" @click="submit" v-else v-noClick>保存</Button> <Button class="button" size="large" type="primary" @click="submit" v-else v-noClick>保存</Button>
<!-- :disabled="hegelist.length!=0&&fanlist.length!=0&&ranglist.length!=0" --> <!-- :disabled="hegelist.length!=0&&fanlist.length!=0&&ranglist.length!=0" -->
<Button class="button" size="large" @click="toOrder">取消</Button> <Button class="button" size="large" @click="toOrder">取消</Button>
</div> </div>
<!-- 不合格品送审 --> <!-- 不合格品送审 -->
<Modal v-model="ModalOrder" title="不合格品送审" :mask-closable="false" :scrollable="true" fullscreen> <Modal v-model="ModalOrder" title="不合格品送审" :mask-closable="false" :scrollable="true" fullscreen>
<OrderSendReview ref="orderSendReview"></OrderSendReview> <OrderSendReview ref="orderSendReview"></OrderSendReview>
<div slot="footer"> <div slot="footer">
<Button @click="ModalOrder = false">取消</Button> <Button @click="ModalOrder = false">取消</Button>
<Button type="primary" @click="orderSendOk" v-noClick>确定送审</Button> <Button type="primary" @click="orderSendOk" v-noClick>确定送审</Button>
</div> </div>
</Modal> </Modal>
<!-- 确定弹框 @on-cancel="cancelModal"--> <!-- 确定弹框 @on-cancel="cancelModal"-->
<Modal v-model="suModal" :title="mTitle" @on-ok="okModal"> <Modal v-model="suModal" :title="mTitle" @on-ok="okModal">
<p>是否全部取消?</p> <p>是否全部取消?</p>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from "../api"; import Api from "../api";
import OrderSendReview from "./orderSendReview"; import OrderSendReview from "./orderSendReview";
export default { export default {
name: "starOrder", name: "starOrder",
components: { OrderSendReview }, components: {
data() { OrderSendReview
return {
checkedflag: false,
ModalOrder: false,
suModal: false,
mTitle: "确认弹框",
num: "",
surMasg: "",
entity: {},//获取展示数据
rules: {
question: [
{
required: true,
message: "请选择问题原因",
trigger: "change"
}
],
useroption: [
{
required: true,
message: "请选择责任人",
trigger: "change"
}
]
},
orderForm: {
question: "",
useroption: ""
},
cardlist: [],
hegelist: [],
ranglist: [],
fanlist: [],
feilist: [],
titleCode: '',//送审单号
problemList: [
{ problem: "问题描述01",id:1 },
{ problem: "问题描述02",id:2 },
{ problem: "问题描述03",id:3 }
],
blameList: [
{ user: "责任人01",id:1 },
{ user: "责任人02",id:2 },
{ user: "责任人03",id:3 }
]
};
},
created() {
this.loadFun();
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
mounted() {
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
this.treeHeight = window.innerHeight - 120;
})();
};
},
methods: {
loadFun() {
let pid = Number(this.$route.query.id); // JSON.stringify()
Api.getpaged({ id: pid }).then(res => {
if (res.success) {
let resoult = res.result;
resoult.filter(u => {
u.checked = false;
if(u.productStatus==1){
this.hegelist.push(u)
}
if(u.productStatus==2){
this.feilist.push(u)
}
if(u.productStatus==3){
this.ranglist.push(u)
}
if(u.productStatus==4){
this.fanlist.push(u)
}
if(u.productStatus==0){
this.cardlist.push(u)
}
});
}
})
.catch(e => {
this.$Message.error("连接错误");
});
Api.orderanddispatchinfos({ id: pid }).then(res=>{
if (res.success && res.result) {
this.entity = res.result;
}
})
},
// 全选
allcheck() {
let cardslist = this.cardlist;
cardslist.map(a => {
a.checked = true;
});
},
// 反选
rechecked() {
let cardslist = this.cardlist;
cardslist.map(b => {
b.checked = !b.checked;
});
},
// 单选
changeCards(checked, name) {
let lists = this.cardlist;
lists.map((u, i) => {
if (u.id == name) {
u.checked = true;
}
});
},
// 合格 1
chansehege() {
let oldList = this.cardlist;
let indese = [];
oldList.map((u, i) => {
if (u.checked) {
u.productStatus = 1;
this.hegelist.push(u);
}
});
indese = oldList.filter(item => !this.hegelist.includes(item));
this.cardlist = indese;
},
// 让步 3
chanserang() {
let oldList = this.cardlist;
let indese = [];
oldList.map((u, i) => {
if (u.checked) {
u.productStatus = 3;
this.ranglist.push(u);
}
});
indese = oldList.filter(item => !this.ranglist.includes(item));
this.cardlist = indese;
},
// 返修 4
chansefan() {
let oldList = this.cardlist;
let indese = [];
oldList.map((u, i) => {
if (u.checked) {
u.productStatus = 4;
this.fanlist.push(u);
}
});
indese = oldList.filter(item => !this.fanlist.includes(item));
this.cardlist = indese;
},
// 不合格品(报废)2
chansefei() {
let oldList = this.cardlist;
let indese = [];
oldList.map((u, i) => {
if (u.checked) {
u.productStatus = 2;
this.feilist.push(u);
}
});
indese = oldList.filter(item => !this.feilist.includes(item));
this.cardlist = indese;
},
// 让步关闭
handleClose(event, name) {
let rangold = this.ranglist;
let index = this.ranglist.findIndex(item => {
return item.id === name;
});
let itemlist = rangold.filter(item => {
if (item.id === name) {
item.productStatus = 0
return item;
}
});
this.ranglist.splice(index, 1);
this.cardlist.splice(0, 0, itemlist[0]);
},
consoleFun(u) {
this.suModal = true;
this.num = u;
}, },
okModal() { data() {
let unmb = this.num; return {
if (unmb == 1) { checkedflag: false,
this.cansolRang(); ModalOrder: false,
this.suModal = false; suModal: false,
} mTitle: "确认弹框",
if (unmb == 2) { num: "",
this.cansolfan(); surMasg: "",
this.suModal = false; entity: {}, //获取展示数据
} rules: {
if (unmb == 3) { question: [{
this.cansolfei(); required: true,
this.suModal = false; message: "请选择问题原因",
} trigger: "change"
if (unmb == 0) { }],
this.cansolhege(); useroption: [{
this.suModal = false; required: true,
} message: "请选择责任人",
}, trigger: "change"
cansolhege() { }]
let hegeplist = this.hegelist; },
hegeplist.map(v => { orderForm: {
v.productStatus = 0 question: "",
this.cardlist.unshift(v); useroption: ""
}); },
this.hegelist = []; cardlist: [],
}, hegelist: [],
hegeClose(event, name) { ranglist: [],
let hegeold = this.hegelist; fanlist: [],
let ind = this.hegelist.findIndex(hgitem => { feilist: [],
return hgitem.id === name; titleCode: '', //送审单号
}); problemList: [{
let hgtemlist = hegeold.filter(hgtem => { problem: "问题描述01",
if (hgtem.id == name) { id: 1
hgtem.productStatus = 0 },
return hgtem; {
} problem: "问题描述02",
}); id: 2
this.hegelist.splice(ind, 1); },
this.cardlist.splice(0, 0, hgtemlist[0]); {
}, problem: "问题描述03",
cansolRang() { id: 3
let rangblist = this.ranglist; }
rangblist.map(v => { ],
v.productStatus = 0 blameList: [{
this.cardlist.unshift(v); user: "责任人01",
}); id: 1
this.ranglist = []; },
}, {
fanClose(event, name) { user: "责任人02",
let fanold = this.fanlist; id: 2
let inde = this.fanlist.findIndex(item => { },
return item.id === name; {
}); user: "责任人03",
let utemlist = fanold.filter(utem => { id: 3
if (utem.id == name) { }
utem.productStatus = 0 ]
return utem; };
}
});
this.fanlist.splice(inde, 1);
this.cardlist.splice(0, 0, utemlist[0]);
}, },
cansolfan() { created() {
let fanglist = this.fanlist; this.loadFun();
fanglist.map(v => {
v.productStatus = 0
this.cardlist.unshift(v);
});
this.fanlist = [];
}, },
feiClose(event, name) { async fetch({
let feiold = this.feilist; store,
let indexed = this.feilist.findIndex(item => { params
return item.id === name; }) {
}); await store.dispatch("loadDictionary"); // 加载数据字典
let rtemlist = feiold.filter(rtem => {
if (rtem.id == name) {
rtem.productStatus = 0
return rtem;
}
});
this.feilist.splice(indexed, 1);
this.cardlist.splice(0, 0, rtemlist[0]);
}, },
cansolfei() { mounted() {
let feipinlist = this.feilist; window.onresize = () => {
feipinlist.map(v => { ///浏览器窗口大小变化
v.productStatus = 0 return (() => {
this.cardlist.unshift(v); this.treeHeight = window.innerHeight - 120;
}); })();
this.feilist = []; };
}, },
// 提交 methods: {
submit() { loadFun() {
let hegeops={}; let pid = Number(this.$route.query.id); // JSON.stringify()
let rangops={}; Api.getpaged({
let fanxops={}; id: pid
let feipops={}; }).then(res => {
let cardseops={}; if (res.success) {
let lists = []; let resoult = res.result;
let pass01 = this.hegelist.length>0; resoult.filter(u => {
let pass02 = this.ranglist.length>0; u.checked = false;
let pass03 = this.fanlist.length>0; if (u.productStatus == 1) {
let pass04 = this.feilist.length>0; this.hegelist.push(u)
let pass05 = this.cardlist.length>0; }
if(pass01){ if (u.productStatus == 2) {
hegeops = { this.feilist.push(u)
prodcutIds: [], }
productStatus: this.hegelist[0].productStatus if (u.productStatus == 3) {
}; this.ranglist.push(u)
this.hegelist.map(uh=>{hegeops.prodcutIds.push(uh.id)}) }
lists = [hegeops]; if (u.productStatus == 4) {
if(pass02){ this.fanlist.push(u)
rangops = { }
prodcutIds: [], if (u.productStatus == 0) {
productStatus: this.ranglist[0].productStatus this.cardlist.push(u)
}; }
this.ranglist.map(ur=>{rangops.prodcutIds.push(ur.id)}) });
lists = [hegeops,rangops]; }
if(pass03){ })
fanxops = { .catch(e => {
prodcutIds: [], this.$Message.error("连接错误");
productStatus: this.fanlist[0].productStatus });
}; Api.orderanddispatchinfos({
this.fanlist.map(uf=>{fanxops.prodcutIds.push(uf.id)}) id: pid
lists = [hegeops,rangops,fanxops]; }).then(res => {
if(pass05){ if (res.success && res.result) {
cardseops = { this.entity = res.result;
prodcutIds: [], }
productStatus: this.cardlist[0].productStatus })
},
// 全选
allcheck() {
let cardslist = this.cardlist;
cardslist.map(a => {
a.checked = true;
});
},
// 反选
rechecked() {
let cardslist = this.cardlist;
cardslist.map(b => {
b.checked = !b.checked;
});
},
// 单选
changeCards(checked, name) {
let lists = this.cardlist;
lists.map((u, i) => {
if (u.id == name) {
u.checked = true;
}
});
},
// 合格 1
chansehege() {
let oldList = this.cardlist;
let indese = [];
oldList.map((u, i) => {
if (u.checked) {
u.productStatus = 1;
this.hegelist.push(u);
} }
this.cardlist.map(ch=>{cardseops.prodcutIds.push(ch.id)}) });
lists = [cardseops,hegeops,rangops,fanxops]; indese = oldList.filter(item => !this.hegelist.includes(item));
} this.cardlist = indese;
},
// 让步 3
chanserang() {
let oldList = this.cardlist;
let indese = [];
oldList.map((u, i) => {
if (u.checked) {
u.productStatus = 3;
this.ranglist.push(u);
}
});
indese = oldList.filter(item => !this.ranglist.includes(item));
this.cardlist = indese;
},
// 返修 4
chansefan() {
let oldList = this.cardlist;
let indese = [];
oldList.map((u, i) => {
if (u.checked) {
u.productStatus = 4;
this.fanlist.push(u);
}
});
indese = oldList.filter(item => !this.fanlist.includes(item));
this.cardlist = indese;
},
// 不合格品(报废)2
chansefei() {
let oldList = this.cardlist;
let indese = [];
oldList.map((u, i) => {
if (u.checked) {
u.productStatus = 2;
this.feilist.push(u);
}
});
indese = oldList.filter(item => !this.feilist.includes(item));
this.cardlist = indese;
},
// 让步关闭
handleClose(event, name) {
let rangold = this.ranglist;
let index = this.ranglist.findIndex(item => {
return item.id === name;
});
let itemlist = rangold.filter(item => {
if (item.id === name) {
item.productStatus = 0
return item;
}
});
this.ranglist.splice(index, 1);
this.cardlist.splice(0, 0, itemlist[0]);
},
consoleFun(u) {
this.suModal = true;
this.num = u;
},
okModal() {
let unmb = this.num;
if (unmb == 1) {
this.cansolRang();
this.suModal = false;
} }
} if (unmb == 2) {
} this.cansolfan();
if(pass02){ this.suModal = false;
rangops = { }
prodcutIds: [], if (unmb == 3) {
productStatus: this.ranglist[0].productStatus this.cansolfei();
}; this.suModal = false;
this.ranglist.map(ur=>{rangops.prodcutIds.push(ur.id)}) }
lists = [rangops]; if (unmb == 0) {
if(pass01){ this.cansolhege();
hegeops = { this.suModal = false;
prodcutIds: [], }
productStatus: this.hegelist[0].productStatus },
}; cansolhege() {
this.hegelist.map(uh=>{hegeops.prodcutIds.push(uh.id)}) let hegeplist = this.hegelist;
lists = [hegeops,rangops]; hegeplist.map(v => {
if(pass03){ v.productStatus = 0
fanxops = { this.cardlist.unshift(v);
prodcutIds: [], });
productStatus: this.fanlist[0].productStatus this.hegelist = [];
}; },
this.fanlist.map(uf=>{fanxops.prodcutIds.push(uf.id)}) hegeClose(event, name) {
lists = [hegeops,rangops,fanxops]; let hegeold = this.hegelist;
if(pass05){ let ind = this.hegelist.findIndex(hgitem => {
cardseops = { return hgitem.id === name;
prodcutIds: [], });
productStatus: this.cardlist[0].productStatus let hgtemlist = hegeold.filter(hgtem => {
} if (hgtem.id == name) {
this.cardlist.map(ch=>{cardseops.prodcutIds.push(ch.id)}) hgtem.productStatus = 0
lists = [cardseops,hegeops,rangops,fanxops]; return hgtem;
} }
});
this.hegelist.splice(ind, 1);
this.cardlist.splice(0, 0, hgtemlist[0]);
},
cansolRang() {
let rangblist = this.ranglist;
rangblist.map(v => {
v.productStatus = 0
this.cardlist.unshift(v);
});
this.ranglist = [];
},
fanClose(event, name) {
let fanold = this.fanlist;
let inde = this.fanlist.findIndex(item => {
return item.id === name;
});
let utemlist = fanold.filter(utem => {
if (utem.id == name) {
utem.productStatus = 0
return utem;
}
});
this.fanlist.splice(inde, 1);
this.cardlist.splice(0, 0, utemlist[0]);
},
cansolfan() {
let fanglist = this.fanlist;
fanglist.map(v => {
v.productStatus = 0
this.cardlist.unshift(v);
});
this.fanlist = [];
},
feiClose(event, name) {
let feiold = this.feilist;
let indexed = this.feilist.findIndex(item => {
return item.id === name;
});
let rtemlist = feiold.filter(rtem => {
if (rtem.id == name) {
rtem.productStatus = 0
return rtem;
} }
});
this.feilist.splice(indexed, 1);
this.cardlist.splice(0, 0, rtemlist[0]);
},
cansolfei() {
let feipinlist = this.feilist;
feipinlist.map(v => {
v.productStatus = 0
this.cardlist.unshift(v);
});
this.feilist = [];
},
// 提交
submit() {
let hegeops = {};
let rangops = {};
let fanxops = {};
let feipops = {};
let cardseops = {};
let lists = [];
let pass01 = this.hegelist.length > 0;
let pass02 = this.ranglist.length > 0;
let pass03 = this.fanlist.length > 0;
let pass04 = this.feilist.length > 0;
let pass05 = this.cardlist.length > 0;
if (pass01) {
hegeops = {
prodcutIds: [],
productStatus: this.hegelist[0].productStatus
};
this.hegelist.map(uh => {
hegeops.prodcutIds.push(uh.id)
})
} }
} if (pass02) {
if(pass03){ rangops = {
fanxops = {
prodcutIds: [],
productStatus: this.fanlist[0].productStatus
};
this.fanlist.map(uf=>{fanxops.prodcutIds.push(uf.id)})
lists = [fanxops];
if(pass01){
hegeops = {
prodcutIds: [],
productStatus: this.hegelist[0].productStatus
};
this.hegelist.map(uh=>{hegeops.prodcutIds.push(uh.id)})
lists = [hegeops,fanxops];
if(pass02){
rangops = {
prodcutIds: [], prodcutIds: [],
productStatus: this.ranglist[0].productStatus productStatus: this.ranglist[0].productStatus
}; };
this.ranglist.map(ur=>{rangops.prodcutIds.push(ur.id)}) this.ranglist.map(ur => {
lists = [hegeops,rangops,fanxops]; rangops.prodcutIds.push(ur.id)
if(pass05){ })
cardseops = {
prodcutIds: [],
productStatus: this.cardlist[0].productStatus
}
this.cardlist.map(ch=>{cardseops.prodcutIds.push(ch.id)})
lists = [cardseops,hegeops,rangops,fanxops];
}
}
} }
} if (pass03) {
if(pass05){ fanxops = {
cardseops = {
prodcutIds: [],
productStatus: this.cardlist[0].productStatus
}
this.cardlist.map(ch=>{cardseops.prodcutIds.push(ch.id)})
lists = [cardseops];
if(pass02){
rangops = {
prodcutIds: [],
productStatus: this.ranglist[0].productStatus
};
this.ranglist.map(ur=>{rangops.prodcutIds.push(ur.id)})
lists = [cardseops,rangops];
if(pass01){
hegeops = {
prodcutIds: [],
productStatus: this.hegelist[0].productStatus
};
this.hegelist.map(uh=>{hegeops.prodcutIds.push(uh.id)})
lists = [cardseops,hegeops,rangops];
if(pass03){
fanxops = {
prodcutIds: [], prodcutIds: [],
productStatus: this.fanlist[0].productStatus productStatus: this.fanlist[0].productStatus
}; };
this.fanlist.map(uf=>{fanxops.prodcutIds.push(uf.id)}) this.fanlist.map(uf => {
lists = [cardseops,hegeops,rangops,fanxops]; fanxops.prodcutIds.push(uf.id)
} })
} }
} if (pass05) {
} cardseops = {
if(pass04){
feipops = {
prodcutIds: [],
productStatus: this.feilist[0].productStatus,
cause: this.orderForm.question,
reporter: this.orderForm.useroption
};
this.feilist.map(un=>{feipops.prodcutIds.push(un.id)})
lists = [cardseops,feipops];
if(pass01){
hegeops = {
prodcutIds: [],
productStatus: this.hegelist[0].productStatus
};
this.hegelist.map(uh=>{hegeops.prodcutIds.push(uh.id)})
lists = [hegeops,feipops];
if(pass02){
rangops = {
prodcutIds: [], prodcutIds: [],
productStatus: this.ranglist[0].productStatus productStatus: this.cardlist[0].productStatus
};
this.ranglist.map(ur=>{rangops.prodcutIds.push(ur.id)})
lists = [hegeops,rangops,feipops];
if(pass03){
fanxops = {
prodcutIds: [],
productStatus: this.fanlist[0].productStatus
};
this.fanlist.map(uf=>{fanxops.prodcutIds.push(uf.id)})
lists = [hegeops,rangops,fanxops,feipops];
if(pass05){
cardseops = {
prodcutIds: [],
productStatus: this.cardlist[0].productStatus
}
this.cardlist.map(ch=>{cardseops.prodcutIds.push(ch.id)})
lists = [cardseops,hegeops,rangops,fanxops];
}
}
} }
this.cardlist.map(ch => {
cardseops.prodcutIds.push(ch.id)
})
} }
} if (pass04) {
console.log(lists) feipops = {
let parmes={ prodcutIds: [],
dispatchId: this.$route.query.id, productStatus: this.feilist[0].productStatus,
orderId: this.$route.query.orderId, cause: this.orderForm.question,
list: lists reporter: this.orderForm.useroption
}; };
Api.submitData(parmes).then(res=>{ this.feilist.map(un => {
if(res.success){ feipops.prodcutIds.push(un.id)
this.$Message.success("保存成功!"); })
}else{ }
this.$Message.success("保存失败~"); if (cardseops.productStatus) {
} lists.push(cardseops)
}) }
}, if (hegeops.productStatus) {
// 打开送审 lists.push(hegeops)
sendOrder() { }
let orderse = [] if (rangops.productStatus) {
let orderIds = [] lists.push(rangops)
this.feilist.map(item=>{ }
orderse.push(item.prefix+'.'+item.code) if (fanxops.productStatus) {
// orderIds.push(item.id) lists.push(fanxops)
orderIds.push(item.code)//工作流获取数据,暂时传code数组 }
}) let parmes = {
let strOder = orderse.join(",")
this.entity.cause = this.orderForm.question;
this.entity.reporter = this.orderForm.useroption;
this.entity.strOder = strOder;
this.entity.orderIds = orderIds;
this.$refs["formValidate"].validate(valid => {
if (valid) {
this.submit()//提交状态改变
let parme = {
reason: this.entity.cause,
personLiableId: this.entity.reporter,
dispatchId: this.$route.query.id, dispatchId: this.$route.query.id,
orderId: this.$route.query.orderId, orderId: this.$route.query.orderId,
productIds: this.entity.orderIds, list: lists
} };
Api.getshenliNo(parme).then(res=>{ Api.submitData(parmes).then(res => {
if(res.success){ if (res.success) {
// this.$refs.orderSendReview.info.orderInfo.code = res.result.code this.$Message.success("保存成功!");
this.entity.code = res.result.code } else {
this.entity.idlist = res.result.id this.$Message.success("保存失败~");
}else{ }
console.log("获取编号失败") })
},
// 打开送审
sendOrder() {
let orderse = []
let orderIds = []
this.feilist.map(item => {
orderse.push(item.prefix + '.' + item.code)
// orderIds.push(item.id)
orderIds.push(item.code) //工作流获取数据,暂时传code数组
})
let strOder = orderse.join(",")
this.entity.cause = this.orderForm.question;
this.entity.reporter = this.orderForm.useroption;
this.entity.strOder = strOder;
this.entity.orderIds = orderIds;
this.$refs["formValidate"].validate(valid => {
if (valid) {
this.submit() //提交状态改变
let parme = {
reason: this.entity.cause,
personLiableId: this.entity.reporter,
dispatchId: this.$route.query.id,
orderId: this.$route.query.orderId,
productIds: this.entity.orderIds,
}
Api.getshenliNo(parme).then(res => {
if (res.success) {
// this.$refs.orderSendReview.info.orderInfo.code = res.result.code
this.entity.code = res.result.code
this.entity.idlist = res.result.id
} else {
console.log("获取编号失败")
}
})
let parmeseData = this.entity // this.$Message.success("送审")
console.info(parmeseData)
this.ModalOrder = true;
this.$refs.orderSendReview.alertFun(parmeseData);
}
});
},
// 确定送审
orderSendOk() {
// console.log("old->",this.entity)
let orderids = []
orderids.push(this.entity.idlist)
console.log("new->", this.entity)
let parmese = {
schemaId: "c2e09c9b-02a9-4188-97a6-cdb68d50a64a",
idList: orderids,
code: this.entity.code,
operatorIdList: this.$refs.orderSendReview.returnDataList(),
} }
})
let parmeseData = this.entity// this.$Message.success("送审") this.$http.order
console.info(parmeseData) .batchOrderStart(parmese)
this.ModalOrder = true; .then(response => {
this.$refs.orderSendReview.alertFun(parmeseData); if (response.success) {
// this.loadFun();
this.$Message.info("送审成功!");
// this.dataListRetrunNew.idList = [];
this.ModalOrder = false;
} else {
this.$Message.error("送审失败!");
this.ModalOrder = false;
}
});
},
// 取消 返回工单列表
toOrder() {
this.$router.push("/produce/orderlist");
} }
});
},
// 确定送审
orderSendOk() {
// console.log("old->",this.entity)
let orderids = []
orderids.push(this.entity.idlist)
console.log("new->",this.entity)
let parmese ={
schemaId: "c2e09c9b-02a9-4188-97a6-cdb68d50a64a",
idList: orderids,
code: this.entity.code,
operatorIdList: this.$refs.orderSendReview.returnDataList(),
}
this.$http.order
.batchOrderStart(parmese)
.then(response => {
if (response.success) {
// this.loadFun();
this.$Message.info("送审成功!");
// this.dataListRetrunNew.idList = [];
this.ModalOrder = false;
} else {
this.$Message.error("送审失败!");
this.ModalOrder = false;
}
});
},
// 取消 返回工单列表
toOrder() {
this.$router.push("/produce/orderlist");
} }
}
}; };
</script> </script>
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