Commit 3af63b53 authored by 仇晓婷's avatar 仇晓婷

流水排产

parent 2c9c78de
...@@ -9,17 +9,7 @@ export default { ...@@ -9,17 +9,7 @@ export default {
cmtwostepschedule(params) { cmtwostepschedule(params) {
return Api.post(`${PlanUrl}/messchedule/cmtwostepschedule`, params); //整机排产--二级排产 return Api.post(`${PlanUrl}/messchedule/cmtwostepschedule`, params); //整机排产--二级排产
}, },
shiftoutofcmorflpool(params) {
// getlist(params) { return Api.post(`${PlanUrl}/messchedule/shiftoutofcmorflpool`, params); //删除订单
// return Api.get(`${PlanUrl}/mes_sys_shop_info/getlist`, params); //手工排产:查询所在车间下的所有班组信息 },
// },
// getbyshopid(params) {
// return Api.get(`${PlanUrl}/mes_sys_user_info/getuserbyshopid`, params); //手工排产:根据班组ID,加载人员信息
// },
// getlistEquip(params) {
// return Api.get(`${PlanUrl}/mes_equip_info/getlist`, params); //手工排产:获取所在车间的设备
// },
// getbyequippk(params) {
// return Api.get(`${PlanUrl}/mes_sys_user_info/getuserbyequippk`, params); //手工排产:根据设备ID,加载人员信息
// },
} }
\ No newline at end of file
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<Checkbox v-model="li.checked" @on-change="checkData(li)">订单号:{{li.mesCode}}</Checkbox> <Checkbox v-model="li.checked" @on-change="checkData(li)">订单号:{{li.mesCode}}</Checkbox>
</Col> </Col>
<Col :span="4" class="order-ringht"> <Col :span="4" class="order-ringht">
<Icon type="md-close" @click="close" /> <Icon type="md-close" @click="close(li.id)" />
</Col> </Col>
</Row> </Row>
<div class="fa">产品名称:{{li.productName}}</div> <div class="fa">产品名称:{{li.productName}}</div>
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
</template> </template>
<script> <script>
import CheckboxList from "./checkboxList"; import CheckboxList from "./checkboxList";
// import Set from './set'
import Api from "./api"; import Api from "./api";
export default { export default {
name: "list", name: "list",
...@@ -134,7 +134,7 @@ export default { ...@@ -134,7 +134,7 @@ export default {
list: [], list: [],
status: "-1", //全部排产-1,0为未排产;2为已排查; status: "-1", //全部排产-1,0为未排产;2为已排查;
formItem: { formItem: {
resourcesType: 0, // resourcesType: 0,
radio: "0", radio: "0",
time: "", time: "",
beginTime: "", beginTime: "",
...@@ -187,15 +187,16 @@ export default { ...@@ -187,15 +187,16 @@ export default {
methods: { methods: {
// 过滤条件 // 过滤条件
changeStatus(name) { changeStatus(name) {
this.orderlist(name); this.status = name;
this.orderlist(this.status);
}, },
//排产池列表 //排产池列表
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(r => {
if (r.success) { if (r.success) {
r.result.forEach(e => { r.result.map(e => {
return (e.checked = false); e.checked = false;
}); });
this.list = r.result; this.list = r.result;
} }
...@@ -306,26 +307,28 @@ export default { ...@@ -306,26 +307,28 @@ export default {
this.formItem = {}; this.formItem = {};
this.formItem.radio = 0; this.formItem.radio = 0;
}, },
close() { close(id) {
let ids = [];
ids.push(id);
this.$Modal.confirm({ this.$Modal.confirm({
title: "删除", title: "删除",
content: "<p>您确定要移除此订单吗</p>", content: "<p>您确定要移除此订单吗</p>",
onOk: () => { onOk: () => {
this.$Message.success("删除成功"); Api.shiftoutofcmorflpool({ ids: ids }).then(r => {
if (r.success) {
this.$Message.success("删除成功");
this.orderlist(this.status);
} else {
this.$Message.info("删除失败");
}
});
}, },
onCancel: () => { onCancel: () => {
this.$Message.info("您已取消删除"); this.$Message.info("您已取消删除");
} }
}); });
}, }
getList(v) {}, // closeTag() {}
handleClose(nodeKey) {
// this.$refs.users.handleCheck({ checked: false, nodeKey: nodeKey });
},
// setData(val) {
// this.tagGroup = val;
// },
closeTag() {}
}, },
watch: { watch: {
"formItem.radio"(v) { "formItem.radio"(v) {
......
...@@ -12,19 +12,8 @@ export default { ...@@ -12,19 +12,8 @@ export default {
fltwostepschedule(params) { fltwostepschedule(params) {
return Api.post(`${PlanUrl}/messchedule/fltwostepschedule`, params); //流水二级 return Api.post(`${PlanUrl}/messchedule/fltwostepschedule`, params); //流水二级
}, },
// gettaskseqinfo(params) { shiftoutofcmorflpool(params) {
// return Api.get(`${apsManualUrl}/aps/gettaskseqinfo`, params); //根据订单获取全部工序数据 return Api.post(`${PlanUrl}/messchedule/shiftoutofcmorflpool`, params); //删除订单
// }, },
// getlist(params) {
// return Api.get(`${apsManualUrl}/mes_sys_shop_info/getlist`, params); //手工排产:查询所在车间下的所有班组信息
// },
// getbyshopid(params) {
// return Api.get(`${apsManualUrl}/mes_sys_user_info/getuserbyshopid`, params); //手工排产:根据班组ID,加载人员信息
// },
// getlistEquip(params) {
// return Api.get(`${apsManualUrl}/mes_equip_info/getlist`, params); //手工排产:获取所在车间的设备
// },
// getbyequippk(params) {
// return Api.get(`${apsManualUrl}/mes_sys_user_info/getuserbyequippk`, params); //手工排产:根据设备ID,加载人员信息
// },
} }
\ No newline at end of file
<template>
<div class="checkbox-list">
<Row class="check-title">
<Col span="20">
<div>
<!-- :indeterminate="indeterminate" -->
<!-- :label="resourcesType==0?singleList.shop_name:resourcesType==2?singleList.equip_name:''" -->
<Checkbox
:label="singleList.equip_name"
v-model="checkAll"
@click.prevent.native="handleCheckAll(singleList.shop_id)"
>{{singleList.equip_name}}</Checkbox>
<!-- {{resourcesType==0?singleList.shop_name:resourcesType==2?singleList.equip_name:''}} -->
</div>
</Col>
<Col span="4">
<div class="icon-down">
<Icon type="ios-arrow-down" v-if="!singleList.isClick" @click="upDown(singleList)"></Icon>
<Icon type="ios-arrow-up" v-if="singleList.isClick" @click="upDown(singleList)"></Icon>
</div>
</Col>
</Row>
<ul v-if="singleList.isClick">
<li
ref="liId"
v-for="(item,index) in list"
:key="index"
@click="onclick(index)"
>{{item.name}}&nbsp&nbsp{{item.class}}</li>
</ul>
<!-- <CheckboxGroup
v-model="checkAllGroup"
@on-change="checkAllGroupChange"
v-if="singleList.isClick"
>-->
<!-- :label="resourcesType==0?item.user_name:resourcesType==2?item.equip_name:''" -->
<!-- <Checkbox v-for="(item,index) in list" :key="index" :label="item.name">{{item.name}}</Checkbox>
</CheckboxGroup>-->
</div>
</template>
<script>
import Api from "./api";
export default {
name: "CheckboxList",
props: ["singleList"],
data() {
return {
chooseNum: null,
indeterminate: true,
checkAll: false,
checkAllGroup: [],
typeIcon: "ios-arrow-down",
show: -1,
list: [
{
name: "张芳",
class: "1级"
},
{
name: "张芳",
class: "1级"
},
{
name: "张芳",
class: "1级"
},
{
name: "张芳",
class: "1级"
}
],
taglistData: []
};
},
mounted() {
// this.checkList()
},
methods: {
onclick(index) {
if (this.$refs.liId[index].className.length <= 0) {
this.$refs.liId[index].className = "li-focus"; // 添加类
let list = [];
this.$refs.liId.forEach((element, index) => {
if (this.$refs.liId[index].className) {
list.push(this.$refs.liId[index].className);
}
});
if (list.length == this.list.length) {
this.checkAll = true;
}
} else {
this.$refs.liId[index].className = ""; // 选中再取消的情况
this.checkAll = false;
}
},
handleCheckAll(id) {
this.checkAll = !this.checkAll;
if (this.checkAll) {
this.$refs.liId.forEach((element, index) => {
this.$refs.liId[index].className = "li-focus"; // 添加类
});
} else {
this.$refs.liId.forEach((element, index) => {
this.$refs.liId[index].className = ""; // 选中再取消的情况
});
}
// // console.log(this.list)
// // this.list.map((u) => {
// // console.log(u)
// // })
// // this.checkList(id)
// this.checkAll = !this.checkAll;
// if (this.checkAll) {
// let listNew = [];
// this.list.map(u => {
// if (this.resourcesType == 0) {
// listNew.push(u.user_name);
// } else if (this.resourcesType == 2) {
// listNew.push(u.equip_name);
// }
// });
// this.checkAllGroup = listNew;
// this.$emit("changeData", this.checkAllGroup);
// } else {
// this.checkAllGroup = [];
// }
},
// checkAllGroupChange(data) {
// console.log(data);
// console.log(this.list);
// this.checkAllGroup = data;
// this.$emit("changeData", this.checkAllGroup);
// if (data.length === this.list.length) {
// this.indeterminate = false;
// this.checkAll = true;
// } else if (data.length > 0) {
// this.indeterminate = true;
// this.checkAll = false;
// } else {
// this.indeterminate = false;
// this.checkAll = false;
// }
// },
checkList(id) {
if (this.resourcesType == 0) {
//班组
Api.getbyshopid({ shop_id: id }).then(r => {
// console.log(r)
if (r.success) {
r.result.forEach(e => {
e.ischeckBox = false;
});
this.list = r.result;
}
});
} else if (this.resourcesType == 2) {
//设备
Api.getbyequippk({ equip_pk: 91 }).then(r => {
// console.log(r)
if (r.success) {
r.result.forEach(e => {
e.ischeckBox = false;
});
this.list = r.result;
}
});
}
},
upDown(post) {
if (!post.isClick) {
this.$set(post, "isClick", true);
this.checkList(post.shop_id);
} else {
this.$set(post, "isClick", false);
}
}
}
// watch: {
// list: {
// handler(newVal, oldVal) {
// console.log('深度监听', newVal, oldVal)
// },
// deep: true
// }
// }
};
</script>
<style lang="less" scoped>
.checkbox-list {
.icon-down {
text-align: right;
cursor: pointer;
}
.check-title {
height: 40px;
line-height: 40px;
padding: 0 10px;
background: rgba(38, 128, 235, 0.5);
}
ul {
min-height: 60px;
padding: 10px 5px;
display: flex;
li {
list-style-type: none;
text-align: center;
width: 100px;
height: 30px;
line-height: 30px;
border-radius: 20px;
margin: 0 5px;
cursor: pointer;
background: rgba(38, 128, 235, 0.1);
}
li:hover {
border: 1px solid rgba(38, 128, 235, 0.5);
}
.li-focus {
border: 1px solid rgba(38, 128, 235, 0.5);
}
}
}
</style>
\ No newline at end of file
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<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" /> <Icon type="md-close" @click="close(li.id)" />
</Col> </Col>
</Row> </Row>
<div class="fa">产品名称:{{li.productName}}</div> <div class="fa">产品名称:{{li.productName}}</div>
...@@ -37,46 +37,84 @@ ...@@ -37,46 +37,84 @@
<div class="aps-r"> <div class="aps-r">
<!-- <div class="g-list">工序列表</div> --> <!-- <div class="g-list">工序列表</div> -->
<Row class="g-list"> <Row class="g-list">
<Col :span="2" class="chan-chi">工序列表</Col> <Col :span="2">
<!-- <Col :span="22" class="l-ringht"> <span class="cha-chi">工序列表</span>
<RadioGroup v-model="status" type="button" @on-change="changeRodio" size="small"> </Col>
<Radio label="0">全部</Radio> <Col :span="16">
<Radio label="1">未排产</Radio> <span></span>
<Radio label="2">已排查</Radio> </Col>
<Col :span="6">
<RadioGroup v-model="mode" type="button" size="small" @on-change="changeMode">
<Radio :label="1">一级排产</Radio>
<Radio :label="2">二级排产</Radio>
</RadioGroup> </RadioGroup>
</Col>--> <Button type="primary" @click="lowerHair" :disabled="!allow">下发</Button>
</Col>
</Row> </Row>
<div class="right-body"> <Row class="right-body">
<div class="list"> <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">
<Badge :count="index+ 1" 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 @click="sets(item.routingHeaderId)">工序名称:{{item.name}}</span> &nbsp <span
<Tooltip content="拆分工序" placement="top"> @click="sets(item,index)"
<Icon type="md-bluetooth" @click="split" /> class="mr20"
</Tooltip> :class="active == index ? 'gongTitle' : '' "
<Icon type="ios-trash" @click="remove" /> >工序名称:{{item.name}}</span>
<op
title="拆分工序"
@click="split(item,index)"
type="icon"
icon="ios-cut"
v-if="item.quantity>1&&!item.chai"
></op>
<op
title="移除"
@click="remove(item,index)"
type="icon"
icon="ios-trash"
oprate="delete"
v-if="item.chai"
></op>
</div> </div>
<div>任务顺序:{{item.task_seq}}</div>
<div>数量:{{item.quantity}}</div> <div>数量:{{item.quantity}}</div>
<div>{{item.resources_Type_Name}}</div> <div v-if="item.userIds">
人员:
<span v-for="(u,j) in item.userIds" :key="j">
<User :value="u"></User>&nbsp;&nbsp;&nbsp;
</span>
</div>
<div v-if="item.shopName">
班组:
{{item.shopName}}
</div>
<div v-if="item.beginTime">
时间:
{{item.beginTime}} —— {{item.endTime}}
</div>
<div v-if="item.remark">
备注:
{{item.remark}}
</div>
<!-- <div>工序号:{{item.task_seq}}</div> -->
</TimelineItem> </TimelineItem>
</Timeline> </Timeline>
<div> <div>
<Drawer <Drawer title="排产设置盘" :closable="false" v-model="set" width="55%">
title="排产设置盘" <Set
:closable="false" :mode="mode"
v-model="set" :detailId="detailId"
width="55%" :indexId="indexId"
:mask-closable="false" @closeOk="closeOk"
> ref="setObj"
<Set :group="group" @closeOk="closeOk"></Set> @on-DetermineOk="DetermineOk"
></Set>
</Drawer> </Drawer>
</div> </div>
<!-- <List :result="result"></List> --> <!-- <List :result="result"></List> -->
</div> </Col>
</div> </Row>
</div> </div>
<!-- 拆分 fenModel --> <!-- 拆分 fenModel -->
<Modal <Modal
...@@ -88,74 +126,64 @@ ...@@ -88,74 +126,64 @@
@on-ok="okChai()" @on-ok="okChai()"
> >
拆分数量: 拆分数量:
<InputNumber v-model="chaiNum"></InputNumber> <InputNumber v-model="chaiNum" :min="1" :max="maxnum"></InputNumber>
<Slider v-model="chaiNum" :min="1"></Slider> <Slider v-if="maxnum>1" v-model="chaiNum" :min="1" :max="maxnum"></Slider>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
// import List from "./list.vue";
import Set from "./set"; import Set from "./set";
import Api from "./api"; import Api from "./api";
export default { export default {
name: "list", name: "list",
components: { components: {
Set Set
// List
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
data() { data() {
return { return {
group: { disabled: false,
orderId: 0, chaiLIst: [],
routingHeaderId: 0 mode: 1,
}, curIndex: -1,
indexId: 0,
active: null,
activeindex: 1, activeindex: 1,
list: [], list: [],
status: "-1", //全部排产-1,0为未排产;2为已排查; status: "-1", //全部排产-1,0为未排产;2为已排查;
result: [ result: [],
{ isactive: null,
taskname: "工序名称",
equip_id: "制造资源",
equip_type: "排产资源",
resources_Type_Name: "备注信息"
},
{
taskname: "工序名称",
equip_id: "制造资源",
equip_type: "排产资源",
resources_Type_Name: "备注信息"
}
],
isactive: 0,
resourcesType: null, resourcesType: null,
set: false, set: false,
chaiNum: 1, //拆分数量 chaiNum: 1, //拆分数量
chaiModal: false maxnum: 1,
chaiModal: false,
orderId: 0,
routingHeaderId: 0
}; };
}, },
created() { created() {
this.orderlist(); this.orderlist(-1);
}, },
methods: { methods: {
// 排产池过滤条件 // 排产池过滤条件
changeStatus(a) { changeStatus(a) {
this.orderlist(a); this.status = a;
this.orderlist(this.status);
}, },
//排产池列表 //排产池列表
orderlist() { orderlist() {
Api.getpooltypeorderlist({ PoolType: 3, status: this.status }).then(r => { Api.getpooltypeorderlist({ PoolType: 3, status: this.status }).then(r => {
// console.log(r)
if (r.result) { if (r.result) {
r.result.forEach(e => { r.result.map(u => {
return (e.checked = false); u.aps = 0;
}); });
this.list = r.result; this.list = r.result;
if (r.result[0]) { if (r.result[0]) {
this.tagTata(r.result[0].id); // this.tagTata(r.result[0].id);
} else { } else {
this.result = []; this.result = [];
} }
...@@ -168,13 +196,22 @@ export default { ...@@ -168,13 +196,22 @@ export default {
listData(li, index) { listData(li, index) {
console.log(li); console.log(li);
this.isactive = index; this.isactive = index;
this.group.orderId = li.id; this.orderId = li.id;
this.routingHeaderId = li.routingHeaderId;
this.tagTata(li.id); this.tagTata(li.id);
}, },
changeMode(a) {
this.mode = a;
},
//工序列表 //工序列表
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 => {
u.seq = u.task_seq;
u.chaiCount = 0;
u.chai = false;
});
this.result = r.result; this.result = r.result;
} }
}); });
...@@ -184,12 +221,21 @@ export default { ...@@ -184,12 +221,21 @@ export default {
// console.log(a); // console.log(a);
// }, // },
//删除排产订单 //删除排产订单
close() { close(id) {
let ids = [];
ids.push(id);
this.$Modal.confirm({ this.$Modal.confirm({
title: "删除", title: "删除",
content: "<p>您确定要移除此订单吗</p>", content: "<p>您确定要移除此订单吗</p>",
onOk: () => { onOk: () => {
this.$Message.success("删除成功"); Api.shiftoutofcmorflpool({ ids: ids }).then(r => {
if (r.success) {
this.$Message.success("删除成功");
this.orderlist(this.status);
} else {
this.$Message.info("删除失败");
}
});
}, },
onCancel: () => { onCancel: () => {
this.$Message.info("您已取消删除"); this.$Message.info("您已取消删除");
...@@ -198,51 +244,134 @@ export default { ...@@ -198,51 +244,134 @@ export default {
}, },
//工序列表序列设置 //工序列表序列设置
type(i) { type(i) {
if (i == 0) { if (i < this.result.length) {
return "normal";
} else if (i == 1) {
return "normal";
} else if (i == 2) {
return "normal"; return "normal";
} else if (i === this.result.length) { } else if (i === this.result.length) {
return "success"; return "success";
} }
}, },
//设置工序 //设置工序
sets(name) { sets(item, index) {
this.set = true; this.set = true;
this.group.routingHeaderId = name; this.indexId = index;
this.detailId = item.detailId;
this.active = index;
// this.group.orderId = item.orderId;
// this.group.routingHeaderId = item.routingHeaderId;
// this.$refs.setObj.formItem = {};
// this.$refs.setObj.formItem.radio = "0";
}, },
//拆分工序 //拆分工序
split() { split(item, i) {
this.chaiModal = true; this.chaiModal = true;
this.curIndex = i;
this.maxnum = this.result[i].quantity - 1;
}, },
//拆分保存 //拆分保存
okChai() { okChai() {
// Api.saveTeamentry(this.chaiNum).then(res => { let items = this.$u.clone(this.result);
// if (res.success) { let curItem = items[this.curIndex];
// this.getUserInfoFn(); console.log(curItem);
// this.$Message.success("拆分成功。"); let addItem = this.$u.clone(curItem);
// } else { curItem.quantity -= this.chaiNum;
// this.$Message.error("拆分失败..."); curItem.chaiCount += 1;
// } addItem.seq = addItem.task_seq + curItem.chaiCount * 0.1;
// }); addItem.quantity = this.chaiNum;
addItem.chai = true;
items.splice(this.curIndex + curItem.chaiCount, 0, addItem);
this.result = items;
}, },
//删除工序 //删除工序
remove() { remove(item, index) {
this.$Modal.confirm({ console.log(item);
title: "删除", var root = -1;
content: "<p>您确定要移除此工序吗</p>", for (let i = 0; i < this.result.length; i++) {
onOk: () => { const element = this.result[i];
this.$Message.success("删除成功"); if (element.indexId == item.indexId) {
}, root = i;
onCancel: () => { break;
this.$Message.info("您已取消删除");
} }
}); }
var rootItem = this.result[root];
this.result[root].quantity = rootItem.quantity + item.quantity;
this.result.splice(index, 1);
},
//下发
lowerHair() {
var items = [];
var obj = {};
if (this.mode == 1) {
for (let i = 0; i < this.result.length; i++) {
obj = {
detailId: this.result[i].detailId,
userIds: this.result[i].userIds,
quantity: this.result[i].quantity,
beginTime: this.result[i].beginTime,
endTime: this.result[i].endTime,
remark: this.result[i].remark
};
items.push(obj);
}
let data = {
orderId: this.orderId,
routingHeaderId: this.routingHeaderId,
items: items
};
Api.flonestepschedule(data).then(r => {
if (r.success) {
this.$Message.success("下发成功");
this.orderlist(this.status);
} else {
this.$Message.info("下发失败");
}
});
} else if (this.mode == 2) {
for (let i = 0; i < this.result.length; i++) {
obj = {
detailId: this.result[i].detailId,
shopId: this.result[i].shopId,
quantity: this.result[i].quantity,
beginTime: this.result[i].beginTime,
endTime: this.result[i].endTime,
remark: this.result[i].remark
};
items.push(obj);
}
let data = {
orderId: this.orderId,
routingHeaderId: this.routingHeaderId,
items: items
};
Api.fltwostepschedule(data).then(r => {
if (r.success) {
this.$Message.success("下发成功");
this.orderlist(this.status);
} else {
this.$Message.info("下发失败");
}
});
}
}, },
closeOk() { closeOk() {
this.set = false; this.set = false;
// this.active = null;
},
DetermineOk(val, index) {
let item = Object.assign(this.result[index], val);
item.aps = this.mode;
this.$set(this.result, index, item);
this.set = false;
// this.active = null;
}
},
computed: {
allow() {
let mode = this.mode;
let oks = this.result.filter(u => {
return u.aps == mode;
});
return oks.length == this.result.length;
} }
} }
}; };
...@@ -254,6 +383,7 @@ export default { ...@@ -254,6 +383,7 @@ export default {
background: rgba(38, 128, 235, 0.5) !important; background: rgba(38, 128, 235, 0.5) !important;
} }
} }
.scheduling { .scheduling {
display: flex; display: flex;
display: -webkit-flex; display: -webkit-flex;
...@@ -345,10 +475,16 @@ export default { ...@@ -345,10 +475,16 @@ export default {
padding-left: 10px; padding-left: 10px;
.set-name { .set-name {
font-weight: bold; font-weight: bold;
color: rgba(38, 128, 235, 0.8);
span { span {
cursor: pointer; cursor: pointer;
} }
span:hover {
color: rgba(38, 128, 235, 0.8);
}
.gongTitle {
color: rgba(38, 128, 235, 0.8);
}
.ivu-icon { .ivu-icon {
cursor: pointer; cursor: pointer;
} }
...@@ -359,8 +495,23 @@ export default { ...@@ -359,8 +495,23 @@ export default {
div { div {
height: 30px; height: 30px;
} }
.gong-list {
color: rgba(38, 128, 235, 0.7);
}
}
.xia-fa {
text-align: right;
} }
} }
} }
} }
</style>
<style lang="less">
.right-body {
.list {
.s0 {
color: #515a6e !important;
}
}
}
</style> </style>
\ No newline at end of file
<template>
<div class="list">
<Timeline>
<TimelineItem v-for="(item, index) in result" :key="index">
<Badge :count="index+ 1" slot="dot" :type="type(index)"></Badge>
<div @click="sets(item.resources_Type)" class="set-name">{{item.taskname}}</div>
<div>{{item.equip_id}}</div>
<div>{{item.equip_type}}</div>
<div>{{item.resources_Type_Name}}</div>
</TimelineItem>
</Timeline>
<div>
<Drawer title="排产设置盘" :closable="false" v-model="set" width="45%">
<Set :resourcesType="resourcesType"></Set>
</Drawer>
</div>
</div>
</template>
<script>
import Set from './set'
import Api from './api'
export default {
name: 'set',
components: {
Set
},
props: {
result: Array
},
data() {
return {
set: false,
dataList: [],
resourcesType: null
}
},
methods: {
type(i) {
if (i == 0) {
return 'normal'
} else if (i == 1) {
return 'normal'
} else if (i == 2) {
return 'normal'
} else if (i === this.result.length) {
return 'success'
}
},
sets(name) {
this.resourcesType = name
if (this.resourcesType == 0 || this.resourcesType == 2) {
this.set = true
} else {
this.set = false
// this.$Message.info('没有设置盘')
}
}
}
}
</script>
<style lang="less" scoped>
.list {
padding-left: 10px;
.set-name {
font-weight: bold;
}
.set-name:hover {
cursor: pointer;
}
}
</style>
\ No newline at end of file
<template> <template>
<div class="set"> <div class="set">
<Form :model="formItem" :label-width="100"> <Form :model="formItem" :label-width="100" :rules="ruleValidate" ref="formItem">
<FormItem label="工时"> <FormItem label="工时" prop="time">
<DatePicker <DatePicker
type="datetimerange" type="datetimerange"
format="yyyy-MM-dd HH:mm" format="yyyy-MM-dd HH:mm:ss"
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="类型">
<RadioGroup v-model="formItem.radio"> <RadioGroup v-model="formItem.radio">
<Radio label="0">人员</Radio> <Radio label="0">人员</Radio>
<Radio label="1">班组</Radio> <Radio label="1">班组</Radio>
</RadioGroup> </RadioGroup>
</FormItem>-->
<FormItem label="人员" v-if="mode==1" prop="userIds">
<UserSelect
ref="userSelected"
v-model="formItem.userIds"
style="width:300px"
:multiple="true"
/>
</FormItem> </FormItem>
<FormItem label="人员分组形式" v-if="formItem.radio==0"> <FormItem label="班组" v-if="mode==2" prop="shopId">
<Dictionary <Select v-model="formItem.shopId" placeholder="请选择" style="width:300px">
disabled <Option
code="aps.scheduling.groupingForm" v-for="(item,index) in listClass"
v-model="formItem.resourcesType"
type="radio"
></Dictionary>
</FormItem>
<FormItem label="班组" v-if="formItem.radio==1">
<Select v-model="formItem.shopId" style="width:300px" multiple>
<Option v-for="item in classList" :value="item.shopId" :key="item.shopId">{{ item.label }}</Option>
</Select>
</FormItem>
<FormItem v-if="formItem.radio==0">
<!-- <UserSelect ref="userSelected" v-model="formItem.DistributeMainRouting" /> -->
<div class="list-check">
<Checkbox-List
:single-list="li"
ref="groups"
@changeData="setData"
v-for="(li,index) in listGroup"
:key="index" :key="index"
></Checkbox-List> :value="item.value"
</div> :label="item.label"
</FormItem> style="display:none"
<!-- v-if="tagGroup.lenght>0" --> ></Option>
<FormItem label="已选择" v-if="formItem.radio==0"> <Tree key="mytree" :data="workShop" ref="mytree" :render="renderContent"></Tree>
<div class="tag-list"> </Select>
<div v-for="(item,index) in tagGroup" :key="index" class="tag-group">
<span>{{item.name}}&nbsp&nbsp{{item.class}}</span>
<Icon type="md-close" @click="closeTag" />
</div>
<!-- <Tag
color="rgba(38,128,235,0.3)"
closable
@on-close="handleClose"
:key="index"
v-for="(val, index) in tagGroup"
>{{val.name}}</Tag>-->
</div>
</FormItem> </FormItem>
<FormItem label="备注"> <FormItem label="备注">
<Input <Input
v-model="formItem.textarea" v-model="formItem.remark"
type="textarea" type="textarea"
:autosize="{minRows: 2,maxRows: 5}" :autosize="{minRows: 2,maxRows: 5}"
placeholder="请输入备注信息" placeholder="请输入备注信息"
...@@ -69,157 +47,90 @@ ...@@ -69,157 +47,90 @@
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button style="margin-left: 8px" @click="closeOk">取消</Button> <Button style="margin-left: 8px" @click="closeOk">取消</Button>
<Button type="primary" @click="lowerHair">排产</Button> <Button type="primary" @click="Determine('formItem')">确定</Button>
</FormItem> </FormItem>
</Form> </Form>
</div> </div>
</template> </template>
<script> <script>
import CheckboxList from "./checkboxList";
import Api from "./api"; import Api from "./api";
export default { export default {
name: "set", name: "set",
components: {
CheckboxList
},
props: { props: {
group: { detailId: Number,
default: Object, indexId: Number,
orderId: Number, mode: Number
routingHeaderId: Number
}
}, },
data() { data() {
return { return {
orderId: 0, //订单id orderId: 0, //订单id
routingHeaderId: 0, //工艺规程id routingHeaderId: 0, //工艺规程id
formItem: { formItem: {
resourcesType: 0,
radio: "0", radio: "0",
time: "", time: "",
beginTime: "", beginTime: "",
endTime: "", endTime: "",
textarea: "" remark: "",
departmentTitle: "",
shopId: "",
shopName: ""
}, },
listGroup: [ workShop: [],
{ listClass: [],
equip_name: "调试组", ruleValidate: {
isClick: true time: [
},
{
equip_name: "装配组"
}
],
tagGroup: [
{
id: 1,
name: "张芳",
class: "1级"
},
{
id: 2,
name: "张芳",
class: "1级"
},
{
id: 4,
name: "张芳",
class: "1级"
},
{
id: 5,
name: "张芳",
class: "1级"
}
],
classList: [
{
shopId: "0",
label: "调试组"
},
{
shopId: "1",
label: "装配组"
},
{
shopId: "2",
label: "计划组"
},
{
shopId: "3",
label: "管理组"
}
]
};
},
mounted() {},
// computed: {
// tagList() {
// if (this.tagdata.length > 0) {
// let items = this.tagdata.filter((u) => {
// return
// })
// return items
// } else {
// return []
// }
// }
// },
methods: {
lowerHair(v) {
if (this.formItem.radio == 0) {
//一级排产选择人员
let urseId = [];
for (var i = 0; i < this.tagGroup.length; i++) {
urseId.push(this.tagGroup[i].id);
}
let items = [
{ {
detailId: 0, required: true,
userIds: urseId, type: "date",
quantity: 0, message: "请选择时间",
beginTime: this.formItem.beginTime, trigger: "change"
endTime: this.formItem.endTime
}
];
let params1 = {
orderIds: this.group.orderId,
routingHeaderId: this.group.routingHeaderId,
items: items
};
Api.flonestepschedule(params1).then(r => {
if (r.success) {
} }
}); ],
} else if (this.formItem.radio == 1) { userIds: [
//二级排产选择班组
let items = [
{ {
detailId: 0, required: true,
userIds: urseId, message: "请选择人员",
quantity: 0, trigger: "change"
beginTime: this.formItem.beginTime,
endTime: this.formItem.endTime
} }
]; ],
let params2 = { shopId: [
orderIds: this.group.orderId, {
routingHeaderId: this.group.routingHeaderId, required: true,
items: items message: "请选择班组",
}; trigger: "change"
Api.fltwostepschedule(params2).then(r => {
if (r.success) {
} }
}); ]
} }
};
},
mounted() {
this.getWorkshop();
},
methods: {
//确定
Determine(name) {
if (this.formItem.time == "") {
this.$Message.error("工时不能为空");
return false;
} else if (this.mode == 1) {
if (!this.formItem.userIds) {
this.$Message.error("人员不能为空");
return false;
}
} else if (this.mode == 2) {
if (!this.formItem.shopId) {
this.$Message.error("班组不能为空");
return false;
}
}
this.formItem.detailId = this.detailId;
this.$emit("on-DetermineOk", this.formItem, this.indexId);
}, },
closeOk() { closeOk() {
this.$emit("closeOk"); this.$emit("closeOk");
}, },
handleClose(nodeKey) {
// this.$refs.users.handleCheck({ checked: false, nodeKey: nodeKey });
},
setData(val) { setData(val) {
this.tagGroup = val; this.tagGroup = val;
}, },
...@@ -228,15 +139,50 @@ export default { ...@@ -228,15 +139,50 @@ export default {
this.formItem.beginTime = val[0]; this.formItem.beginTime = val[0];
this.formItem.endTime = val[1]; this.formItem.endTime = val[1];
}, },
closeTag() {} closeTag() {},
//部门(班组)
getWorkshop() {
let url = `${systemUrl}/user/userdepartmentsofworkshop`;
this.$api.get(url).then(r => {
if (r.result) {
this.workShop = r.result;
}
});
},
renderContent(h, { root, node, data }) {
//渲染树的样式
return h(
"span",
{
style: {
cursor: "pointer"
},
on: {
click: () => {
this.handleSelect(data); //手动选择树节点
}
}
},
data.title
);
},
handleSelect(data) {
let obj = {
label: data.title,
value: data.value
};
this.listClass = [];
this.listClass.push(obj);
this.formItem.shopId = this.listClass[0].value;
this.formItem.shopName = this.listClass[0].label;
}
}, },
watch: { watch: {
// resourcesType(v) { "formItem.radio"(v) {
// if (v != null) { if (v == 1) {
// this.formItem.resourcesType = v; this.getWorkshop();
// this.getList(v); }
// } }
// }
} }
}; };
</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