Commit bc148006 authored by 仇晓婷's avatar 仇晓婷

流水排产

parent 14fe771b
...@@ -14,28 +14,31 @@ ...@@ -14,28 +14,31 @@
<div class="left-down"> <div class="left-down">
<div <div
class="left-body" class="left-body"
v-for="(li,index) in list" v-for="(li, index) in list"
:key="index" :key="index"
:class="li.checked == true ? 'addclass' : '' " :class="li.checked == true ? 'addclass' : ''"
> >
<Row class="title-i"> <Row class="title-i">
<Col :span="20" class="order-code"> <Col :span="20" class="order-code">
<Checkbox <Checkbox
v-model="li.checked" v-model="li.checked"
@on-change="checkData(li)" @on-change="checkData(li)"
:disabled="li.status==0?false:true" :disabled="li.status == 0 ? false : true"
>订单号:{{li.mesCode}}</Checkbox> >订单号:{{ li.mesCode }}</Checkbox
>
</Col> </Col>
<Col :span="4" class="order-ringht"> <Col :span="4" class="order-ringht">
<Icon type="md-close" @click="close(li.id)" /> <Icon type="md-close" @click="close(li.id)" />
</Col> </Col>
</Row> </Row>
<div class="fa">产品名称:{{li.productName}}</div> <div class="fa">产品名称:{{ li.productName }}</div>
<div class="time-s">产品数量:{{li.quantity}}</div> <div class="time-s">产品数量:{{ li.quantity }}</div>
<div class="time-s"> <!-- <div class="time-s">
<span>工序:{{li.drawnNumber}}</span> <span>工序:{{li.drawnNumber}}</span>
</div> -->
<div class="time-s">
{{ li.demandFinishDate }} ~ {{ li.demandStartDate }}
</div> </div>
<div class="time-s">{{li.demandFinishDate}} ~ {{li.demandStartDate}}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -49,7 +52,7 @@ ...@@ -49,7 +52,7 @@
placeholder="请选择工时" placeholder="请选择工时"
@on-change="changeFormat" @on-change="changeFormat"
v-model="formItem.time" v-model="formItem.time"
style="width:300px" style="width: 300px"
></DatePicker> ></DatePicker>
</FormItem> </FormItem>
<FormItem label="类型"> <FormItem label="类型">
...@@ -58,26 +61,36 @@ ...@@ -58,26 +61,36 @@
<Radio label="1">班组</Radio> <Radio label="1">班组</Radio>
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
<FormItem v-if="formItem.radio==0"> <FormItem v-if="formItem.radio == 0">
<UserSelect v-model="user" :multiple="true" /> <UserSelect v-model="user" :multiple="true" />
</FormItem> </FormItem>
<FormItem label="班组" v-if="formItem.radio==1"> <FormItem label="班组" v-if="formItem.radio == 1">
<Select v-model="formItem.shopId" placeholder="请选择" style="width:300px"> <!-- <DepartmentSelect :type="3" v-model="formItem.shopId"/> -->
<Select
v-model="formItem.shopId"
placeholder="请选择"
style="width: 300px"
>
<Option <Option
v-for="(item,index) in listClass" v-for="(item, index) in listClass"
:key="index" :key="index"
:value="item.value" :value="item.value"
:label="item.label" :label="item.label"
style="display:none" style="display: none"
></Option> ></Option>
<Tree key="mytree" :data="workShop" ref="mytree" :render="renderContent"></Tree> <Tree
key="mytree"
:data="workShop"
ref="mytree"
:render="renderContent"
></Tree>
</Select> </Select>
</FormItem> </FormItem>
<FormItem label="备注"> <FormItem label="备注">
<Input <Input
v-model="formItem.remark " v-model="formItem.remark"
type="textarea" type="textarea"
:autosize="{minRows: 2,maxRows: 5}" :autosize="{ minRows: 2, maxRows: 5 }"
placeholder="请输入备注信息" placeholder="请输入备注信息"
></Input> ></Input>
</FormItem> </FormItem>
...@@ -110,9 +123,11 @@ export default { ...@@ -110,9 +123,11 @@ export default {
remark: "", remark: "",
departmentTitle: "", departmentTitle: "",
shopId: "", shopId: "",
showSet: false showSet: false,
// userName: "" // userName: ""
}, },
user:'',
showSet: false,
// listGroup: [ // listGroup: [
// { // {
// equip_name: "调试组", // equip_name: "调试组",
...@@ -147,7 +162,7 @@ export default { ...@@ -147,7 +162,7 @@ export default {
// ], // ],
workShop: [], workShop: [],
listClass: [], listClass: [],
orderIds: [] orderIds: [],
}; };
}, },
created() { created() {
...@@ -162,16 +177,18 @@ export default { ...@@ -162,16 +177,18 @@ export default {
//排产池列表 //排产池列表
orderlist(a) { orderlist(a) {
this.status = a; this.status = a;
Api.getpooltypeorderlist({ PoolType: 2, status: this.status }).then(r => { Api.getpooltypeorderlist({ PoolType: 2, status: this.status }).then(
if (r.success) { (r) => {
r.result.map(e => { if (r.success) {
e.checked = false; r.result.map((e) => {
e.demandFinishDate = e.demandFinishDate.substr(0, 10); e.checked = false;
e.demandStartDate = e.demandStartDate.substr(0, 10); e.demandFinishDate = e.demandFinishDate.substr(0, 10);
}); e.demandStartDate = e.demandStartDate.substr(0, 10);
this.list = r.result; });
this.list = r.result;
}
} }
}); );
}, },
//获取订单集 //获取订单集
checkData(li) { checkData(li) {
...@@ -210,10 +227,10 @@ export default { ...@@ -210,10 +227,10 @@ export default {
userIds: this.user, userIds: this.user,
beginTime: this.formItem.beginTime, beginTime: this.formItem.beginTime,
endTime: this.formItem.endTime, endTime: this.formItem.endTime,
remark: this.formItem.remark remark: this.formItem.remark,
// userName: this.formItem.userName // userName: this.formItem.userName
}; };
Api.cmonestepschedule(params1).then(r => { Api.cmonestepschedule(params1).then((r) => {
if (r.success) { if (r.success) {
this.$Message.success("下发成功"); this.$Message.success("下发成功");
this.orderlist(this.status); this.orderlist(this.status);
...@@ -232,9 +249,9 @@ export default { ...@@ -232,9 +249,9 @@ export default {
shopId: this.formItem.shopId, shopId: this.formItem.shopId,
beginTime: this.formItem.beginTime, beginTime: this.formItem.beginTime,
endTime: this.formItem.endTime, endTime: this.formItem.endTime,
remark: this.formItem.remark remark: this.formItem.remark,
}; };
Api.cmtwostepschedule(params2).then(r => { Api.cmtwostepschedule(params2).then((r) => {
if (r.success) { if (r.success) {
this.$Message.success("下发成功"); this.$Message.success("下发成功");
this.orderlist(this.status); this.orderlist(this.status);
...@@ -250,7 +267,7 @@ export default { ...@@ -250,7 +267,7 @@ export default {
//部门(班组) //部门(班组)
getWorkshop() { getWorkshop() {
let url = `${systemUrl}/user/userdepartmentsofworkshop`; let url = `${systemUrl}/user/userdepartmentsofworkshop`;
this.$api.get(url).then(r => { this.$api.get(url).then((r) => {
if (r.result) { if (r.result) {
this.workShop = r.result; this.workShop = r.result;
} }
...@@ -262,13 +279,13 @@ export default { ...@@ -262,13 +279,13 @@ export default {
"span", "span",
{ {
style: { style: {
cursor: "pointer" cursor: "pointer",
}, },
on: { on: {
click: () => { click: () => {
this.handleSelect(data); //手动选择树节点 this.handleSelect(data); //手动选择树节点
} },
} },
}, },
data.title data.title
); );
...@@ -276,7 +293,7 @@ export default { ...@@ -276,7 +293,7 @@ export default {
handleSelect(data) { handleSelect(data) {
let obj = { let obj = {
label: data.title, label: data.title,
value: data.value value: data.value,
}; };
this.listClass = []; this.listClass = [];
this.listClass.push(obj); this.listClass.push(obj);
...@@ -294,7 +311,7 @@ export default { ...@@ -294,7 +311,7 @@ export default {
title: "删除", title: "删除",
content: "<p>您确定要移除此订单吗</p>", content: "<p>您确定要移除此订单吗</p>",
onOk: () => { onOk: () => {
Api.shiftoutofcmorflpool({ ids: ids }).then(r => { Api.shiftoutofcmorflpool({ ids: ids }).then((r) => {
if (r.success) { if (r.success) {
this.$Message.success("删除成功"); this.$Message.success("删除成功");
this.orderlist(this.status); this.orderlist(this.status);
...@@ -305,9 +322,9 @@ export default { ...@@ -305,9 +322,9 @@ export default {
}, },
onCancel: () => { onCancel: () => {
this.$Message.info("您已取消删除"); this.$Message.info("您已取消删除");
} },
}); });
} },
// closeTag() {} // closeTag() {}
}, },
watch: { watch: {
...@@ -315,8 +332,8 @@ export default { ...@@ -315,8 +332,8 @@ export default {
if (v == 1) { if (v == 1) {
this.getWorkshop(); this.getWorkshop();
} }
} },
} },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
...@@ -370,8 +387,8 @@ export default { ...@@ -370,8 +387,8 @@ export default {
} }
.fa { .fa {
height: 32px; height: 35px;
line-height: 32px; line-height: 35px;
color: rgba(38, 128, 235, 1); color: rgba(38, 128, 235, 1);
padding: 5px 8px 0 8px; padding: 5px 8px 0 8px;
} }
...@@ -379,7 +396,7 @@ export default { ...@@ -379,7 +396,7 @@ export default {
padding: 0 8px; padding: 0 8px;
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
color:@table-color; color: @table-color;
} }
} }
} }
......
...@@ -14,23 +14,25 @@ ...@@ -14,23 +14,25 @@
<div class="left-down"> <div class="left-down">
<div <div
class="left-body" class="left-body"
v-for="(li,index) in list" v-for="(li, index) in list"
:key="index" :key="index"
@click="listData(li,index)" @click="listData(li, index)"
:class="isactive == index ? 'addclass' : '' " :class="isactive == index ? 'addclass' : ''"
> >
<Row class="title-i"> <Row class="title-i">
<Col :span="20" class="order-code">订单号:{{li.mesCode}}</Col> <Col :span="20" class="order-code">订单号:{{ li.mesCode }}</Col>
<Col :span="4" class="order-ringht"> <Col :span="4" class="order-ringht">
<Icon type="md-close" @click="close(li.id)" /> <Icon type="md-close" @click="close(li.id)" />
</Col> </Col>
</Row> </Row>
<div class="fa">产品名称:{{li.productName}}</div> <div class="fa">产品名称:{{ li.productName }}</div>
<div class="time-s"> <div class="time-s">
<!-- <Icon type="ios-copy" /> --> <!-- <Icon type="ios-copy" /> -->
<span>工序:{{li.drawnNumber}}</span> <span>工序:{{ li.drawnNumber }}</span>
</div>
<div class="time-s">
{{ li.demandFinishDate }}{{ li.demandStartDate }}
</div> </div>
<div class="time-s">{{li.demandFinishDate}}{{li.demandStartDate}}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -44,64 +46,86 @@ ...@@ -44,64 +46,86 @@
<span></span> <span></span>
</Col> </Col>
<Col :span="6"> <Col :span="6">
<RadioGroup v-model="mode" type="button" size="small" @on-change="changeMode"> <RadioGroup
v-model="mode"
type="button"
size="small"
@on-change="changeMode"
>
<Radio :label="1">一级排产</Radio> <Radio :label="1">一级排产</Radio>
<Radio :label="2">二级排产</Radio> <Radio :label="2">二级排产</Radio>
</RadioGroup> </RadioGroup>
<Button type="primary" @click="lowerHair" :disabled="!allow" v-if="showXia">下发</Button> <Button
type="primary"
@click="lowerHair"
:disabled="!allow"
v-if="showXia"
>下发</Button
>
</Col> </Col>
</Row> </Row>
<Row class="right-body"> <Row class="right-body">
<Col class="list" span="24"> <Col class="list" span="24">
<Timeline> <Timeline>
<TimelineItem v-for="(item, index) in result" :key="index"> <TimelineItem
v-for="(item, index) in result"
:key="index"
:style="{ height: activeHeight }"
>
<!-- :class="addActive == index ? 'activeHeight' : ''" -->
<Badge :count="item.seq" slot="dot" :type="type(index)"></Badge> <Badge :count="item.seq" slot="dot" :type="type(index)"></Badge>
<div class="set-name"> <div class="set-name">
<span <span
@click="sets(item,index)" @click="sets(item, index)"
class="mr20" class="mr20"
:class="active == index ? 'gongTitle' : '' " :class="active == index ? 'gongTitle' : ''"
>工序名称:{{item.name}}</span> >工序名称:{{ item.name }}</span
>
<op <op
title="拆分工序" title="拆分工序"
@click="split(item,index)" @click="split(item, index)"
type="icon" type="icon"
icon="ios-cut" icon="ios-cut"
v-if="item.quantity>1&&!item.chai" v-if="item.quantity > 1 && !item.chai"
></op> ></op>
<op <op
title="移除" title="移除"
@click="remove(item,index)" @click="remove(item, index)"
type="icon" type="icon"
icon="ios-trash" icon="ios-trash"
oprate="delete" oprate="delete"
v-if="item.chai" v-if="item.chai"
></op> ></op>
</div> </div>
<div>数量:{{item.quantity}}</div> <div class="content">数量:{{ item.quantity }}</div>
<div v-if="item.userIds"> <div v-show="item.userIds" class="content">
人员: 人员:
<span v-for="(u,j) in item.userIds" :key="j"> <span v-for="(u, j) in item.userIds" :key="j">
<User :value="u"></User>&nbsp;&nbsp;&nbsp; <User :value="u"></User>&nbsp;&nbsp;&nbsp;
</span> </span>
</div> </div>
<div v-if="item.shopName"> <div v-show="item.shopName" class="content">
班组: 班组:
{{item.shopName}} {{ item.shopName }}
</div> </div>
<div v-if="item.beginTime"> <div v-show="item.beginTime" class="content">
时间: 时间:
{{item.beginTime}} —— {{item.endTime}} {{ item.beginTime }} —— {{ item.endTime }}
</div> </div>
<div v-if="item.remark"> <div v-show="item.remark" class="content">
备注: 备注:
{{item.remark}} {{ item.remark }}
</div> </div>
<!-- <div>工序号:{{item.task_seq}}</div> --> <!-- <div>工序号:{{item.task_seq}}</div> -->
</TimelineItem> </TimelineItem>
</Timeline> </Timeline>
<div> <div>
<Drawer title="排产设置盘" :closable="false" v-model="set" width="55%"> <Drawer
title="排产设置盘"
:closable="false"
v-model="set"
width="55%"
>
<Set <Set
:mode="mode" :mode="mode"
:detailId="detailId" :detailId="detailId"
...@@ -127,7 +151,12 @@ ...@@ -127,7 +151,12 @@
> >
拆分数量: 拆分数量:
<InputNumber v-model="chaiNum" :min="1" :max="maxnum"></InputNumber> <InputNumber v-model="chaiNum" :min="1" :max="maxnum"></InputNumber>
<Slider v-if="maxnum>1" v-model="chaiNum" :min="1" :max="maxnum"></Slider> <Slider
v-if="maxnum > 1"
v-model="chaiNum"
:min="1"
:max="maxnum"
></Slider>
</Modal> </Modal>
</div> </div>
</template> </template>
...@@ -137,7 +166,7 @@ import Api from "./api"; ...@@ -137,7 +166,7 @@ import Api from "./api";
export default { export default {
name: "set", name: "set",
components: { components: {
Set Set,
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
...@@ -148,6 +177,7 @@ export default { ...@@ -148,6 +177,7 @@ export default {
disabled: false, disabled: false,
chaiLIst: [], chaiLIst: [],
mode: 1, mode: 1,
activeHeight: "100%",
curIndex: -1, curIndex: -1,
indexId: 0, indexId: 0,
active: null, active: null,
...@@ -162,9 +192,8 @@ export default { ...@@ -162,9 +192,8 @@ export default {
maxnum: 1, maxnum: 1,
chaiModal: false, chaiModal: false,
orderId: 0, orderId: 0,
routingHeaderId: 0, routingHeaderId: 0,
detailId: 0 detailId: 0,
}; };
}, },
created() { created() {
...@@ -186,23 +215,25 @@ export default { ...@@ -186,23 +215,25 @@ export default {
//排产池列表 //排产池列表
orderlist() { orderlist() {
Api.getpooltypeorderlist({ PoolType: 3, status: this.status }).then(r => { Api.getpooltypeorderlist({ PoolType: 3, status: this.status }).then(
if (r.result) { (r) => {
r.result.map(u => { if (r.result) {
u.aps = 0; r.result.map((u) => {
u.demandFinishDate = u.demandFinishDate.substr(0, 10); u.aps = 0;
u.demandStartDate = u.demandStartDate.substr(0, 10); u.demandFinishDate = u.demandFinishDate.substr(0, 10);
}); u.demandStartDate = u.demandStartDate.substr(0, 10);
this.list = r.result; });
// if (r.result[0]) { this.list = r.result;
// this.tagTata(r.result[0].id); // if (r.result[0]) {
// } else { // this.tagTata(r.result[0].id);
// this.result = []; // } else {
// } // this.result = [];
} else { // }
this.$Message.info("排产池数据请求失败"); } else {
this.$Message.info("排产池数据请求失败");
}
} }
}); );
}, },
//点击选中排产订单 //点击选中排产订单
listData(li, index) { listData(li, index) {
...@@ -211,6 +242,7 @@ export default { ...@@ -211,6 +242,7 @@ export default {
this.orderId = li.id; this.orderId = li.id;
this.routingHeaderId = li.routingHeaderId; this.routingHeaderId = li.routingHeaderId;
this.tagTata(li.id); this.tagTata(li.id);
this.activeHeight = "100%";
}, },
changeMode(a) { changeMode(a) {
this.mode = a; this.mode = a;
...@@ -218,9 +250,9 @@ export default { ...@@ -218,9 +250,9 @@ export default {
}, },
//工序列表 //工序列表
tagTata(id) { tagTata(id) {
Api.getroutingdetails({ id: id }).then(r => { Api.getroutingdetails({ id: id }).then((r) => {
if (r.success) { if (r.success) {
r.result.map(u => { r.result.map((u) => {
u.seq = u.task_seq; u.seq = u.task_seq;
u.chaiCount = 0; u.chaiCount = 0;
u.chai = false; u.chai = false;
...@@ -242,7 +274,7 @@ export default { ...@@ -242,7 +274,7 @@ export default {
title: "删除", title: "删除",
content: "<p>您确定要移除此订单吗</p>", content: "<p>您确定要移除此订单吗</p>",
onOk: () => { onOk: () => {
Api.shiftoutofcmorflpool({ ids: ids }).then(r => { Api.shiftoutofcmorflpool({ ids: ids }).then((r) => {
if (r.success) { if (r.success) {
this.$Message.success("删除成功"); this.$Message.success("删除成功");
this.orderlist(this.status); this.orderlist(this.status);
...@@ -253,11 +285,12 @@ export default { ...@@ -253,11 +285,12 @@ export default {
}, },
onCancel: () => { onCancel: () => {
this.$Message.info("您已取消删除"); this.$Message.info("您已取消删除");
} },
}); });
}, },
//工序列表序列设置 //工序列表序列设置
type(i) { type(i) {
console.log(i);
if (i < this.result.length) { if (i < this.result.length) {
return "normal"; return "normal";
} else if (i === this.result.length) { } else if (i === this.result.length) {
...@@ -331,16 +364,16 @@ export default { ...@@ -331,16 +364,16 @@ export default {
quantity: this.result[i].quantity, quantity: this.result[i].quantity,
beginTime: this.result[i].beginTime, beginTime: this.result[i].beginTime,
endTime: this.result[i].endTime, endTime: this.result[i].endTime,
remark: this.result[i].remark remark: this.result[i].remark,
}; };
items.push(obj); items.push(obj);
} }
let data = { let data = {
orderId: this.orderId, orderId: this.orderId,
routingHeaderId: this.routingHeaderId, routingHeaderId: this.routingHeaderId,
items: items items: items,
}; };
Api.flonestepschedule(data).then(r => { Api.flonestepschedule(data).then((r) => {
if (r.result) { if (r.result) {
this.$Message.success("下发成功"); this.$Message.success("下发成功");
this.orderlist(this.status); this.orderlist(this.status);
...@@ -357,16 +390,16 @@ export default { ...@@ -357,16 +390,16 @@ export default {
quantity: this.result[i].quantity, quantity: this.result[i].quantity,
beginTime: this.result[i].beginTime, beginTime: this.result[i].beginTime,
endTime: this.result[i].endTime, endTime: this.result[i].endTime,
remark: this.result[i].remark remark: this.result[i].remark,
}; };
items.push(obj); items.push(obj);
} }
let data = { let data = {
orderId: this.orderId, orderId: this.orderId,
routingHeaderId: this.routingHeaderId, routingHeaderId: this.routingHeaderId,
items: items items: items,
}; };
Api.fltwostepschedule(data).then(r => { Api.fltwostepschedule(data).then((r) => {
if (r.result) { if (r.result) {
this.$Message.success("下发成功"); this.$Message.success("下发成功");
this.orderlist(this.status); this.orderlist(this.status);
...@@ -388,18 +421,19 @@ export default { ...@@ -388,18 +421,19 @@ export default {
item.aps = this.mode; item.aps = this.mode;
this.$set(this.result, index, item); this.$set(this.result, index, item);
this.set = false; this.set = false;
// this.active = null; this.activeHeight = "140px";
} this.tagTata(0);
},
}, },
computed: { computed: {
allow() { allow() {
let mode = this.mode; let mode = this.mode;
let oks = this.result.filter(u => { let oks = this.result.filter((u) => {
return u.aps == mode; return u.aps == mode;
}); });
return oks.length == this.result.length; return oks.length == this.result.length;
} },
} },
}; };
</script> </script>
<style lang="less"> <style lang="less">
...@@ -500,10 +534,10 @@ export default { ...@@ -500,10 +534,10 @@ export default {
overflow: auto; overflow: auto;
.list { .list {
padding-left: 10px; padding-left: 10px;
padding-top: 20px; padding-top: 30px;
.set-name { .set-name {
font-weight: bold; font-weight: bold;
// margin-bottom: -15px;
span { span {
cursor: pointer; cursor: pointer;
} }
...@@ -522,6 +556,11 @@ export default { ...@@ -522,6 +556,11 @@ export default {
} }
div { div {
height: 30px; height: 30px;
// margin-bottom: 10px;
}
.content {
padding-left: 5px;
height: 30px;
} }
.gong-list { .gong-list {
color: rgba(38, 128, 235, 0.7); color: rgba(38, 128, 235, 0.7);
...@@ -536,8 +575,15 @@ export default { ...@@ -536,8 +575,15 @@ export default {
.right-body { .right-body {
.list { .list {
.s0 { .s0 {
color:@table-color !important; color: @table-color !important;
} }
} }
} }
.ivu-timeline {
height: 100%;
}
.ivu-timeline-item {
padding-bottom: 25px !important;
height: 100%;
}
</style> </style>
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