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

流水排产

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