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

流水排产

parent 2c9c78de
......@@ -9,17 +9,7 @@ export default {
cmtwostepschedule(params) {
return Api.post(`${PlanUrl}/messchedule/cmtwostepschedule`, params); //整机排产--二级排产
},
// getlist(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,加载人员信息
// },
shiftoutofcmorflpool(params) {
return Api.post(`${PlanUrl}/messchedule/shiftoutofcmorflpool`, params); //删除订单
},
}
\ No newline at end of file
......@@ -23,7 +23,7 @@
<Checkbox v-model="li.checked" @on-change="checkData(li)">订单号:{{li.mesCode}}</Checkbox>
</Col>
<Col :span="4" class="order-ringht">
<Icon type="md-close" @click="close" />
<Icon type="md-close" @click="close(li.id)" />
</Col>
</Row>
<div class="fa">产品名称:{{li.productName}}</div>
......@@ -118,7 +118,7 @@
</template>
<script>
import CheckboxList from "./checkboxList";
// import Set from './set'
import Api from "./api";
export default {
name: "list",
......@@ -134,7 +134,7 @@ export default {
list: [],
status: "-1", //全部排产-1,0为未排产;2为已排查;
formItem: {
resourcesType: 0,
// resourcesType: 0,
radio: "0",
time: "",
beginTime: "",
......@@ -187,15 +187,16 @@ export default {
methods: {
// 过滤条件
changeStatus(name) {
this.orderlist(name);
this.status = name;
this.orderlist(this.status);
},
//排产池列表
orderlist(a) {
this.status = a;
Api.getpooltypeorderlist({ PoolType: 2, status: this.status }).then(r => {
if (r.success) {
r.result.forEach(e => {
return (e.checked = false);
r.result.map(e => {
e.checked = false;
});
this.list = r.result;
}
......@@ -306,26 +307,28 @@ export default {
this.formItem = {};
this.formItem.radio = 0;
},
close() {
close(id) {
let ids = [];
ids.push(id);
this.$Modal.confirm({
title: "删除",
content: "<p>您确定要移除此订单吗</p>",
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: () => {
this.$Message.info("您已取消删除");
}
});
},
getList(v) {},
handleClose(nodeKey) {
// this.$refs.users.handleCheck({ checked: false, nodeKey: nodeKey });
},
// setData(val) {
// this.tagGroup = val;
// },
closeTag() {}
}
// closeTag() {}
},
watch: {
"formItem.radio"(v) {
......
......@@ -12,19 +12,8 @@ export default {
fltwostepschedule(params) {
return Api.post(`${PlanUrl}/messchedule/fltwostepschedule`, params); //流水二级
},
// gettaskseqinfo(params) {
// return Api.get(`${apsManualUrl}/aps/gettaskseqinfo`, 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,加载人员信息
// },
shiftoutofcmorflpool(params) {
return Api.post(`${PlanUrl}/messchedule/shiftoutofcmorflpool`, params); //删除订单
},
}
\ 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 @@
<Row class="title-i">
<Col :span="20" class="order-code">订单号:{{li.mesCode}}</Col>
<Col :span="4" class="order-ringht">
<Icon type="md-close" @click="close" />
<Icon type="md-close" @click="close(li.id)" />
</Col>
</Row>
<div class="fa">产品名称:{{li.productName}}</div>
......@@ -37,46 +37,84 @@
<div class="aps-r">
<!-- <div class="g-list">工序列表</div> -->
<Row class="g-list">
<Col :span="2" class="chan-chi">工序列表</Col>
<!-- <Col :span="22" class="l-ringht">
<RadioGroup v-model="status" type="button" @on-change="changeRodio" size="small">
<Radio label="0">全部</Radio>
<Radio label="1">未排产</Radio>
<Radio label="2">已排查</Radio>
<Col :span="2">
<span class="cha-chi">工序列表</span>
</Col>
<Col :span="16">
<span></span>
</Col>
<Col :span="6">
<RadioGroup v-model="mode" type="button" size="small" @on-change="changeMode">
<Radio :label="1">一级排产</Radio>
<Radio :label="2">二级排产</Radio>
</RadioGroup>
</Col>-->
<Button type="primary" @click="lowerHair" :disabled="!allow">下发</Button>
</Col>
</Row>
<div class="right-body">
<div class="list">
<Row class="right-body">
<Col class="list" span="24">
<Timeline>
<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">
<span @click="sets(item.routingHeaderId)">工序名称:{{item.name}}</span> &nbsp
<Tooltip content="拆分工序" placement="top">
<Icon type="md-bluetooth" @click="split" />
</Tooltip>
<Icon type="ios-trash" @click="remove" />
<span
@click="sets(item,index)"
class="mr20"
:class="active == index ? 'gongTitle' : '' "
>工序名称:{{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>任务顺序:{{item.task_seq}}</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>
</Timeline>
<div>
<Drawer
title="排产设置盘"
:closable="false"
v-model="set"
width="55%"
:mask-closable="false"
>
<Set :group="group" @closeOk="closeOk"></Set>
<Drawer title="排产设置盘" :closable="false" v-model="set" width="55%">
<Set
:mode="mode"
:detailId="detailId"
:indexId="indexId"
@closeOk="closeOk"
ref="setObj"
@on-DetermineOk="DetermineOk"
></Set>
</Drawer>
</div>
<!-- <List :result="result"></List> -->
</div>
</div>
</Col>
</Row>
</div>
<!-- 拆分 fenModel -->
<Modal
......@@ -88,74 +126,64 @@
@on-ok="okChai()"
>
拆分数量:
<InputNumber v-model="chaiNum"></InputNumber>
<Slider v-model="chaiNum" :min="1"></Slider>
<InputNumber v-model="chaiNum" :min="1" :max="maxnum"></InputNumber>
<Slider v-if="maxnum>1" v-model="chaiNum" :min="1" :max="maxnum"></Slider>
</Modal>
</div>
</template>
<script>
// import List from "./list.vue";
import Set from "./set";
import Api from "./api";
export default {
name: "list",
components: {
Set
// List
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
data() {
return {
group: {
orderId: 0,
routingHeaderId: 0
},
disabled: false,
chaiLIst: [],
mode: 1,
curIndex: -1,
indexId: 0,
active: null,
activeindex: 1,
list: [],
status: "-1", //全部排产-1,0为未排产;2为已排查;
result: [
{
taskname: "工序名称",
equip_id: "制造资源",
equip_type: "排产资源",
resources_Type_Name: "备注信息"
},
{
taskname: "工序名称",
equip_id: "制造资源",
equip_type: "排产资源",
resources_Type_Name: "备注信息"
}
],
isactive: 0,
result: [],
isactive: null,
resourcesType: null,
set: false,
chaiNum: 1, //拆分数量
chaiModal: false
maxnum: 1,
chaiModal: false,
orderId: 0,
routingHeaderId: 0
};
},
created() {
this.orderlist();
this.orderlist(-1);
},
methods: {
// 排产池过滤条件
changeStatus(a) {
this.orderlist(a);
this.status = a;
this.orderlist(this.status);
},
//排产池列表
orderlist() {
Api.getpooltypeorderlist({ PoolType: 3, status: this.status }).then(r => {
// console.log(r)
if (r.result) {
r.result.forEach(e => {
return (e.checked = false);
r.result.map(u => {
u.aps = 0;
});
this.list = r.result;
if (r.result[0]) {
this.tagTata(r.result[0].id);
// this.tagTata(r.result[0].id);
} else {
this.result = [];
}
......@@ -168,13 +196,22 @@ export default {
listData(li, index) {
console.log(li);
this.isactive = index;
this.group.orderId = li.id;
this.orderId = li.id;
this.routingHeaderId = li.routingHeaderId;
this.tagTata(li.id);
},
changeMode(a) {
this.mode = a;
},
//工序列表
tagTata(id) {
Api.getroutingdetails({ id: id }).then(r => {
if (r.success) {
r.result.map(u => {
u.seq = u.task_seq;
u.chaiCount = 0;
u.chai = false;
});
this.result = r.result;
}
});
......@@ -184,12 +221,21 @@ export default {
// console.log(a);
// },
//删除排产订单
close() {
close(id) {
let ids = [];
ids.push(id);
this.$Modal.confirm({
title: "删除",
content: "<p>您确定要移除此订单吗</p>",
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: () => {
this.$Message.info("您已取消删除");
......@@ -198,51 +244,134 @@ export default {
},
//工序列表序列设置
type(i) {
if (i == 0) {
return "normal";
} else if (i == 1) {
return "normal";
} else if (i == 2) {
if (i < this.result.length) {
return "normal";
} else if (i === this.result.length) {
return "success";
}
},
//设置工序
sets(name) {
sets(item, index) {
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.curIndex = i;
this.maxnum = this.result[i].quantity - 1;
},
//拆分保存
okChai() {
// Api.saveTeamentry(this.chaiNum).then(res => {
// if (res.success) {
// this.getUserInfoFn();
// this.$Message.success("拆分成功。");
// } else {
// this.$Message.error("拆分失败...");
// }
// });
let items = this.$u.clone(this.result);
let curItem = items[this.curIndex];
console.log(curItem);
let addItem = this.$u.clone(curItem);
curItem.quantity -= this.chaiNum;
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() {
this.$Modal.confirm({
title: "删除",
content: "<p>您确定要移除此工序吗</p>",
onOk: () => {
this.$Message.success("删除成功");
},
onCancel: () => {
this.$Message.info("您已取消删除");
remove(item, index) {
console.log(item);
var root = -1;
for (let i = 0; i < this.result.length; i++) {
const element = this.result[i];
if (element.indexId == item.indexId) {
root = i;
break;
}
});
}
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() {
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 {
background: rgba(38, 128, 235, 0.5) !important;
}
}
.scheduling {
display: flex;
display: -webkit-flex;
......@@ -345,10 +475,16 @@ export default {
padding-left: 10px;
.set-name {
font-weight: bold;
color: rgba(38, 128, 235, 0.8);
span {
cursor: pointer;
}
span:hover {
color: rgba(38, 128, 235, 0.8);
}
.gongTitle {
color: rgba(38, 128, 235, 0.8);
}
.ivu-icon {
cursor: pointer;
}
......@@ -359,8 +495,23 @@ export default {
div {
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>
\ 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>
<div class="set">
<Form :model="formItem" :label-width="100">
<FormItem label="工时">
<Form :model="formItem" :label-width="100" :rules="ruleValidate" ref="formItem">
<FormItem label="工时" prop="time">
<DatePicker
type="datetimerange"
format="yyyy-MM-dd HH:mm"
format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择工时"
@on-change="changeFormat"
v-model="formItem.time"
style="width:300px"
></DatePicker>
</FormItem>
<FormItem label="类型">
<!-- <FormItem label="类型">
<RadioGroup v-model="formItem.radio">
<Radio label="0">人员</Radio>
<Radio label="1">班组</Radio>
</RadioGroup>
</FormItem>-->
<FormItem label="人员" v-if="mode==1" prop="userIds">
<UserSelect
ref="userSelected"
v-model="formItem.userIds"
style="width:300px"
:multiple="true"
/>
</FormItem>
<FormItem label="人员分组形式" v-if="formItem.radio==0">
<Dictionary
disabled
code="aps.scheduling.groupingForm"
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"
<FormItem label="班组" v-if="mode==2" prop="shopId">
<Select v-model="formItem.shopId" placeholder="请选择" style="width:300px">
<Option
v-for="(item,index) in listClass"
:key="index"
></Checkbox-List>
</div>
</FormItem>
<!-- v-if="tagGroup.lenght>0" -->
<FormItem label="已选择" v-if="formItem.radio==0">
<div class="tag-list">
<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>
:value="item.value"
:label="item.label"
style="display:none"
></Option>
<Tree key="mytree" :data="workShop" ref="mytree" :render="renderContent"></Tree>
</Select>
</FormItem>
<FormItem label="备注">
<Input
v-model="formItem.textarea"
v-model="formItem.remark"
type="textarea"
:autosize="{minRows: 2,maxRows: 5}"
placeholder="请输入备注信息"
......@@ -69,157 +47,90 @@
</FormItem>
<FormItem>
<Button style="margin-left: 8px" @click="closeOk">取消</Button>
<Button type="primary" @click="lowerHair">排产</Button>
<Button type="primary" @click="Determine('formItem')">确定</Button>
</FormItem>
</Form>
</div>
</template>
<script>
import CheckboxList from "./checkboxList";
import Api from "./api";
export default {
name: "set",
components: {
CheckboxList
},
props: {
group: {
default: Object,
orderId: Number,
routingHeaderId: Number
}
detailId: Number,
indexId: Number,
mode: Number
},
data() {
return {
orderId: 0, //订单id
routingHeaderId: 0, //工艺规程id
formItem: {
resourcesType: 0,
radio: "0",
time: "",
beginTime: "",
endTime: "",
textarea: ""
remark: "",
departmentTitle: "",
shopId: "",
shopName: ""
},
listGroup: [
{
equip_name: "调试组",
isClick: true
},
{
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 = [
workShop: [],
listClass: [],
ruleValidate: {
time: [
{
detailId: 0,
userIds: urseId,
quantity: 0,
beginTime: this.formItem.beginTime,
endTime: this.formItem.endTime
}
];
let params1 = {
orderIds: this.group.orderId,
routingHeaderId: this.group.routingHeaderId,
items: items
};
Api.flonestepschedule(params1).then(r => {
if (r.success) {
required: true,
type: "date",
message: "请选择时间",
trigger: "change"
}
});
} else if (this.formItem.radio == 1) {
//二级排产选择班组
let items = [
],
userIds: [
{
detailId: 0,
userIds: urseId,
quantity: 0,
beginTime: this.formItem.beginTime,
endTime: this.formItem.endTime
required: true,
message: "请选择人员",
trigger: "change"
}
];
let params2 = {
orderIds: this.group.orderId,
routingHeaderId: this.group.routingHeaderId,
items: items
};
Api.fltwostepschedule(params2).then(r => {
if (r.success) {
],
shopId: [
{
required: true,
message: "请选择班组",
trigger: "change"
}
});
]
}
};
},
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() {
this.$emit("closeOk");
},
handleClose(nodeKey) {
// this.$refs.users.handleCheck({ checked: false, nodeKey: nodeKey });
},
setData(val) {
this.tagGroup = val;
},
......@@ -228,15 +139,50 @@ export default {
this.formItem.beginTime = val[0];
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: {
// resourcesType(v) {
// if (v != null) {
// this.formItem.resourcesType = v;
// this.getList(v);
// }
// }
"formItem.radio"(v) {
if (v == 1) {
this.getWorkshop();
}
}
}
};
</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