Commit 9ee8c772 authored by renjintao's avatar renjintao

Merge branch 'master' of git.mes123.com:zhouyx/mes-ui into product-rjt

parents 2a0cb85a 621b6ac4
......@@ -21,6 +21,9 @@ export default {
getEntryList(params){
return Api.get(`${PlanUrl}/teamsdispatchs/getentrylist`, params);
},
// getEntryList(params){
// return Api.get(`${PlanUrl}/teamsdispatchs/getentrylist_mutiroutinggroup`, params);
// },
// 派工接口(保存)
saveTeamentry(params){
return Api.post(`${PlanUrl}/teamsdispatchs/saveteamentry`, params);
......
......@@ -8,108 +8,152 @@
<div class="dispatch_part">
<p class="dispatch_part_top">
<b class="mr10">工单列表</b>
<RadioGroup v-model="status" type="button" size="small" @on-change="changeStatus">
<RadioGroup
v-model="status"
type="button"
size="small"
@on-change="changeStatus"
>
<!-- <Radio label="0">全部</Radio> -->
<Radio label="1">未排产</Radio>
<Radio label="2">已排产</Radio>
</RadioGroup>
{{listTask.length}}
{{ listTask.length }}
<!-- <Button :disabled="disablFlag" @click="allCheack" class="ml10">全选</Button>
<Button :disabled="disablFlager" @click="uncheack" class="ml10">全不选</Button> -->
<span class="check">
<RadioGroup v-model="listShow" type="button" size="small">
<Radio label="订单" title="订单分类">
<Icon type="ios-albums" />
<!-- <Icon type="ios-albums" /> -->
<Icon type="md-list-box" />
</Radio>
<Radio label="工单" title="时间顺序">
<!-- <Icon type="ios-calendar" /> -->
<Icon type="ios-calendar" />
</Radio>
</RadioGroup>
</span>
</p>
<div class="dispatch_part_body" v-if="listShow == '订单'" :style="{height:byheight}">
<h4 class="tc" v-if="this.listTask.length==0">暂无数据</h4>
<div
class="dispatch_part_body"
v-if="listShow == '订单'"
:style="{ height: byheight }"
>
<h4 class="tc" v-if="this.listTask.length == 0">暂无数据</h4>
<!-- {{ids}} -->
<!-- <Collapse simple> -->
<div v-for="(item,index) in listOrder" :key="index" :name="item.mesCode">
<h3 class="h3_bg">
订单号:{{item[0].mesCode}}
<Tag class="h3_tag">{{item.length}}</Tag>
</h3>
<!-- 订单号:{{item[0].mesCode}} {{item.length}} -->
<p slot="content">
<Row :gutter="15" class="card_body01">
<Col span="8" class="dispatch_card" v-for="(li,index) in item" :key="li.id">
<Card>
<p slot="title" class="card_top">
<Checkbox v-model="li.checked" :disabled="li.status!=-1">
<Icon type="ios-pricetags" />
工序{{li.process_seq}}{{li.process_name}}
</Checkbox>
<div
v-for="(item, index) in listOrder"
:key="index"
:name="item.mesCode"
>
<h3 class="h3_bg">
订单号22:{{ item[0].mesCode }}
<Tag class="h3_tag">{{ item.length }}</Tag
>&nbsp;&nbsp;&nbsp; 工艺规程:{{ item[0].routingHeaderCode }} / {{ item[0].routingHeaderName }}
</h3>
<!-- 订单号:{{item[0].mesCode}} {{item.length}} -->
<p slot="content">
<Row :gutter="15" class="card_body01">
<Col
span="8"
class="dispatch_card"
v-for="li in item"
:key="li.id"
>
<Card>
<p slot="title" class="card_top">
<Checkbox
v-model="li.checked"
:disabled="li.status != -1"
>
<Icon type="ios-pricetags" />
工序{{ li.process_seq }}{{ li.process_name }}
</Checkbox>
</p>
<div class="h60">
<p class="g_title">
{{ li.productName }}--{{ li.equipCode }}
</p>
<div class="h60">
<p class="g_title">{{li.productName}}--{{li.equipCode}}</p>
<p>
产品数量:{{li.quantity}}
<op
title="拆分"
type="icon"
icon="md-cut"
v-if="li.quantity > 1 && li.pid == 0 && li.status==-1"
@click="setChai(li,index)"
></op>
<op
title="删除"
type="icon"
icon="md-close-circle"
v-else-if="li.dispatchStatus!=2 && li.pid != 0"
@click="removeDetail(li,index)"
></op>
</p>
<p>{{li.beginTime}}--{{li.endTime}}</p>
<p>人员 :{{li.userNames}}</p>
</div>
</Card>
</Col>
</Row>
</p>
</div>
<!--</Collapse> -->
<p>
产品数量:{{ li.quantity }}
<op
title="拆分"
type="icon"
icon="md-cut"
v-if="
li.quantity > 1 && li.pid == 0 && li.status == -1
"
@click="setChai(li, index)"
></op>
<op
title="删除"
type="icon"
icon="md-close-circle"
v-else-if="li.dispatchStatus != 2 && li.pid != 0"
@click="removeDetail(li, index)"
></op>
</p>
<p>{{ li.beginTime }}--{{ li.endTime }}</p>
<p>人员 :{{ li.userNames }}</p>
</div>
</Card>
</Col>
</Row>
</p>
</div>
<!--</Collapse> -->
</div>
<div class="dispatch_part_body" v-else-if="listShow == '工单'" :style="{height:byheight}">
<h4 class="tc" v-if="this.listTask.length==0">暂无数据</h4>
<div
class="dispatch_part_body"
v-else-if="listShow == '工单'"
:style="{ height: byheight }"
>
<h4 class="tc" v-if="this.listTask.length == 0">暂无数据</h4>
<Row :gutter="15" class="card_body01">
<Col span="8" class="dispatch_card" v-for="(item,index) in listTask" :key="index">
<Col
span="8"
class="dispatch_card"
v-for="(item, index) in listTask"
:key="index"
>
<Card>
<p slot="title" class="card_top">
<Checkbox
v-model="item.checked"
:disabled="item.status!=-1"
>订单号:{{item.mesCode}}</Checkbox>
:disabled="item.status != -1"
>订单号11:{{ item.mesCode }}</Checkbox
>
</p>
<div class="h60">
<p class="g_title">{{item.productName}}--{{item.equipCode}}</p>
<p class="g_title">
{{ item.productName }}--{{ item.equipCode }}
</p>
<p>
<Icon type="ios-pricetags" />
工序{{item.process_seq}}{{item.process_name}}
产品数量:{{item.quantity}}
工序{{ item.process_seq }}{{ item.process_name }}
产品数量:{{ item.quantity }}
<op
title="拆分"
type="icon"
icon="md-cut"
v-if="item.quantity > 1 && item.pid == 0 && item.status==-1"
@click="setChai(item,index)"
v-if="
item.quantity > 1 &&
item.pid == 0 &&
item.status == -1
"
@click="setChai(item, index)"
></op>
<op
title="删除"
type="icon"
icon="md-close-circle"
v-else-if="item.dispatchStatus!=2 && item.pid != 0"
@click="removeDetail(item,index)"
v-else-if="item.dispatchStatus != 2 && item.pid != 0"
@click="removeDetail(item, index)"
></op>
</p>
<p>{{item.beginTime}}--{{item.endTime}}</p>
<p>人员 :{{item.userNames}}</p>
<p>{{ item.beginTime }}--{{ item.endTime }}</p>
<p>人员 :{{ item.userNames }}</p>
<!-- <p>设备 :{{item.equipCode}}</p> -->
</div>
</Card>
......@@ -121,9 +165,11 @@
<Col span="9">
<div class="dispatch_part">
<p class="dispatch_part_top">
<b class="mr10">{{button2}}列表</b>
<span v-if="button2 == '设备'">{{listSheBei.length}}</span>
<span v-else-if="button2 == '人员'">{{listMan.length}}</span>
<b class="mr10">{{ button2 }}列表</b>
<span v-if="button2 == '设备'">{{ listSheBei.length }}</span>
<span v-else-if="button2 == '人员'"
>{{ listMan.length }}</span
>
<span class="check">
<RadioGroup v-model="button2" type="button" size="small">
<Radio label="设备" title="设置设备">
......@@ -135,17 +181,21 @@
</RadioGroup>
</span>
</p>
<div class="dispatch_part_body" :style="{height:byheight}">
<h4 class="tc" v-if="listSheBei.length==0 && button2 == '设备'">暂无数据</h4>
<h4 class="tc" v-else-if="listMan.length==0 && button2 == '人员'">暂无数据</h4>
<div class="dispatch_part_body" :style="{ height: byheight }">
<h4 class="tc" v-if="listSheBei.length == 0 && button2 == '设备'">
暂无数据
</h4>
<h4 class="tc" v-else-if="listMan.length == 0 && button2 == '人员'">
暂无数据
</h4>
<div class="shebei" v-if="button2 == '设备'">
<Row :gutter="15">
<!-- {{shebeiId}} -->
<span style="display:none">{{shebeiId}}</span>
<span style="display: none">{{ shebeiId }}</span>
<Col
span="12"
class="dispatch_card"
v-for="(item,index) in listSheBei"
v-for="(item, index) in listSheBei"
:key="index"
>
<Card class="card">
......@@ -154,22 +204,22 @@
<Icon
type="ios-disc"
size="18"
:color="item.id==shebeiId?'#2d8cf0':'#fff'"
:color="item.id == shebeiId ? '#2d8cf0' : '#fff'"
/>
<input
name="shebei"
:value="item.equip_id"
type="radio"
style="display:none"
style="display: none"
/>
设备编号:{{item.equip_id}}
设备编号:{{ item.equip_id }}
</label>
</p>
<div class="h60">
<p class="g_title">{{item.equip_name}}</p>
<p>资源主操:{{item.operatorUsers}}</p>
<p>位置:{{item.locationx}}</p>
<p>状态:{{item.equip_status}}</p>
<p class="g_title">{{ item.equip_name }}</p>
<p>资源主操:{{ item.operatorUsers }}</p>
<p>位置:{{ item.locationx }}</p>
<p>状态:{{ item.equip_status }}</p>
</div>
</Card>
</Col>
......@@ -178,10 +228,17 @@
<div class="man" v-if="button2 == '人员'">
<!-- {{peploeId}} @on-change="setpepoleid" @on-change="setpepoleids"-->
<Row :gutter="15">
<Col span="8" class="dispatch_card02" v-for="(item,index) in listMan" :key="index">
<Col
span="8"
class="dispatch_card02"
v-for="(item, index) in listMan"
:key="index"
>
<CheckboxGroup class="man_body">
<Checkbox v-model="item.checked" border class="checkUser">
<span class="svg_name" :title="item.userName">{{item.userName}}</span>
<span class="svg_name" :title="item.userName">{{
item.userName
}}</span>
<!-- <span class="svg">{{item.id}}</span> -->
</Checkbox>
</CheckboxGroup>
......@@ -200,16 +257,27 @@
:mask-closable="false"
ok-text="拆分"
@on-ok="okChai()"
> 拆分数量:
<Tag>{{chaiNum}}</Tag>
>
拆分数量:
<Tag>{{ chaiNum }}</Tag>
<Slider v-model="chaiNum" :max="maxnum" show-stops :min="1"></Slider>
</Modal>
<FooterToolbar style="height:65px" v-show="showOperate&&footerToolbar">
<FooterToolbar style="height: 65px" v-show="showOperate && footerToolbar">
<Button class="span ml20" type="primary" @click="openDrawer">设置</Button>
<Button @click="footerToolbar=false">取消</Button>
<Button @click="footerToolbar = false">取消</Button>
</FooterToolbar>
<Drawer title="排产设置盘" v-model="facilityModal" width="820" class="drawer_box">
<Form ref="formValidate" :model="entity" :rules="ruleValidate" :label-width="100">
<Drawer
title="排产设置盘"
v-model="facilityModal"
width="820"
class="drawer_box"
>
<Form
ref="formValidate"
:model="entity"
:rules="ruleValidate"
:label-width="100"
>
<Row>
<Col span="24">
<FormItem label="工时" prop="taskTime">
......@@ -225,7 +293,7 @@
</FormItem>
</Col>
<Col span="24">
<FormItem label="选择人员" prop="userIds" style="width:100%">
<FormItem label="选择人员" prop="userIds" style="width: 100%">
<UserSelect
ref="userSelected"
v-model="entity.userIds"
......@@ -240,12 +308,12 @@
</p>
</Col>
<Col span="24">
<FormItem label="备注" style="width:100%">
<FormItem label="备注" style="width: 100%">
<Input
maxlength="200"
v-model="entity.remark"
type="textarea"
:autosize="{minRows: 3,maxRows: 5}"
:autosize="{ minRows: 3, maxRows: 5 }"
show-word-limit
class="drawer_row_textarea"
/>
......@@ -259,16 +327,29 @@
</Form>
</Drawer>
<!-- 人员抽屉 -->
<Drawer title="排产设置盘" v-model="manModal" width="820" class="drawer_box">
<Form ref="formpepole" :model="pentity" :rules="rulepepole" :label-width="100">
<Drawer
title="排产设置盘"
v-model="manModal"
width="820"
class="drawer_box"
>
<Form
ref="formpepole"
:model="pentity"
:rules="rulepepole"
:label-width="100"
>
<Row>
<Col span="24">
<FormItem label="工时" prop="taskTime">
<DatePicker
v-model="pentity.taskTime"
type="datetimerange" placement="bottom-start"
:options="dateRange" @on-change="handleChange"
placeholder="请选择时间段" style="width: 330px"
type="datetimerange"
placement="bottom-start"
:options="dateRange"
@on-change="handleChange"
placeholder="请选择时间段"
style="width: 330px"
></DatePicker>
</FormItem>
</Col>
......@@ -278,11 +359,15 @@
</p>
</Col>
<Col span="24">
<FormItem label="备注" style="width:100%">
<FormItem label="备注" style="width: 100%">
<Input
maxlength="200" v-model="pentity.remark"
type="textarea" :autosize="{minRows: 3,maxRows: 5}"
show-word-limit class="drawer_row_textarea"/>
maxlength="200"
v-model="pentity.remark"
type="textarea"
:autosize="{ minRows: 3, maxRows: 5 }"
show-word-limit
class="drawer_row_textarea"
/>
</FormItem>
</Col>
</Row>
......@@ -307,13 +392,14 @@ export default {
button2: "设备",
listShow: "订单",
shebei: "",
disablFlag: false,//全选
disablFlager: true,//不选
curTask:null,
dateRange: {//禁选工时时间区间
disablFlag: false, //全选
disablFlager: true, //不选
curTask: null,
dateRange: {
//禁选工时时间区间
disabledDate(date) {
return date && date.valueOf() < Date.now() - 86400000;
}
},
},
shebeiId: -1,
footerToolbar: false,
......@@ -335,7 +421,7 @@ export default {
entity: {
taskTime: "", //工时
userIds: null, //选中人员
remark: "" //备注
remark: "", //备注
},
ruleValidate: {
taskTime: [
......@@ -346,22 +432,22 @@ export default {
trigger: "blur",
fields: {
0: { type: "date", required: true, message: "请选择工时时间段" },
1: { type: "date", required: true, message: "请选择工时时间段" }
}
}
1: { type: "date", required: true, message: "请选择工时时间段" },
},
},
],
userIds: [
{
required: true,
message: "请选择人员!",
trigger: "blur",
type: "array"
}
]
type: "array",
},
],
},
pentity: {
taskTime: "", //工时
remark: "" //备注
remark: "", //备注
},
rulepepole: {
taskTime: [
......@@ -372,11 +458,11 @@ export default {
trigger: "blur",
fields: {
0: { type: "date", required: true, message: "请选择工时时间段" },
1: { type: "date", required: true, message: "请选择工时时间段" }
}
}
]
}
1: { type: "date", required: true, message: "请选择工时时间段" },
},
},
],
},
};
},
created() {
......@@ -393,7 +479,7 @@ export default {
getUserInfoFn() {
let userId = this.$store.state.userInfo.userId;
let infoid, departId;
Api.getUserDepartment({ userId: userId }).then(res => {
Api.getUserDepartment({ userId: userId }).then((res) => {
if (res.success) {
infoid = res.result.id;
} else {
......@@ -401,7 +487,7 @@ export default {
this.$Message.error("查询失败!");
}
});
Api.getUserInfo({ id: userId }).then(res => {
Api.getUserInfo({ id: userId }).then((res) => {
if (res.success) {
departId = res.result.departmentId;
this.getEntryList(departId);
......@@ -423,8 +509,8 @@ export default {
// 获取查询人员
getselectuser(id) {
let parme = { departmentId: id, type: "2" };
Api.getUser(parme).then(res => {
res.result.map(u => {
Api.getUser(parme).then((res) => {
res.result.map((u) => {
u.checked = false;
});
this.listMan = res.result;
......@@ -433,8 +519,8 @@ export default {
// 获取查询设备
getlistall(id) {
let parme = { shopid: id };
Api.getlistall(parme).then(res => {
res.result.map(u => {
Api.getlistall(parme).then((res) => {
res.result.map((u) => {
u.checked = false;
});
this.listSheBei = res.result;
......@@ -443,13 +529,15 @@ export default {
// 获取用户工单 JSON.stringify(parme)
getEntryList(id) {
let parme = { departmentId: id, DispatchStatus: this.status };
Api.getEntryList(parme).then(res => {
Api.getEntryList(parme).then((res) => {
var savedUl = [];
var pid;
res.result.map(u => {
res.result.map((u) => {
if (u.pid) {
pid = u.pid;
} else { pid = 0;}
} else {
pid = 0;
}
let detailnew = {
beginTime: u.beginTime, //开始时间
dispatchStatus: u.dispatchStatus, //
......@@ -467,10 +555,12 @@ export default {
quantity: u.quantity, //
routingDetailId: u.routingDetailId, //
routingHeaderId: u.routingHeaderId, //
routingHeaderCode:u.routingHeaderCode,
routingHeaderName:u.routingHeaderName,
status: u.status, //
userIds: u.userIds, //
userNames: u.userNames,
pid: pid //拆分项id
pid: pid, //拆分项id
};
savedUl.push(detailnew);
});
......@@ -484,13 +574,13 @@ export default {
},
// 时间改变方法
handleChange(daterange) {
this.newList.map(u => {
this.newList.map((u) => {
u.beginTime = daterange[0];
u.endTime = daterange[1];
});
},
handleChangeTime(time) {
this.newList.map(u => {
this.newList.map((u) => {
u.beginTime = time[0];
u.endTime = time[1];
});
......@@ -500,41 +590,41 @@ export default {
this.getUserInfoFn();
},
// 全选、全不选切换
allCheack(){
let fameData = this.listTask
console.log(fameData)
this.listTask.map(u => {
u.checked = true
allCheack() {
let fameData = this.listTask;
console.log(fameData);
this.listTask.map((u) => {
u.checked = true;
this.ids.push(u.id);
})
this.ids.length = this.listTask.length
this.showOperate = true
console.log(this.listTask)
});
this.ids.length = this.listTask.length;
this.showOperate = true;
console.log(this.listTask);
// console.log(this.ids.length)
// console.log(this.shebeiId)
// console.log(this.footerToolbar)
// console.log(this.showOperate)
this.footerToolbar = true
this.disablFlag = true
this.disablFlager = false
this.footerToolbar = true;
this.disablFlag = true;
this.disablFlager = false;
},
uncheack(){
console.log(this.listTask)
this.listTask.map(u => {
u.checked = false
})
if(this.ids.length>0){
uncheack() {
console.log(this.listTask);
this.listTask.map((u) => {
u.checked = false;
});
if (this.ids.length > 0) {
// this.ids = this.ids.splice(0, this.ids.length)
this.ids.length = 0
this.ids.length = 0;
}
console.log(this.listTask)
console.log(this.listTask);
// console.log(this.footerToolbar)
// console.log(this.showOperate)
// console.log(this.shebeiId)
// console.log(this.ids)
this.footerToolbar = false
this.disablFlag = false
this.disablFlager = true
this.footerToolbar = false;
this.disablFlag = false;
this.disablFlager = true;
},
// 打开抽屉
openDrawer() {
......@@ -543,8 +633,8 @@ export default {
let timebegin = formData[0].beginTime;
let timend = formData[0].endTime;
this.newList = [];
chekids.forEach(v => {
var item = formData.filter(u => {
chekids.forEach((v) => {
var item = formData.filter((u) => {
return u.id == v;
});
if (item && item[0]) {
......@@ -563,18 +653,18 @@ export default {
// 设备派工
sendSheBei() {
let item = this.newList;
item.map(u => {
item.map((u) => {
u.userIds = this.entity.userIds;
u.remark = this.entity.remark;
u.equipId = this.shebeiId;
});
this.$refs["formValidate"].validate(valid => {
this.$refs["formValidate"].validate((valid) => {
if (valid) {
let params = {
isDispatch: 1, //派工是1,保存是0
entryList: item
entryList: item,
};
Api.saveTeamentry(params).then(res => {
Api.saveTeamentry(params).then((res) => {
if (res.success) {
this.$Message.success("设备派工成功。");
this.getUserInfoFn();
......@@ -591,17 +681,17 @@ export default {
// 人员派工
sendUser() {
let item = this.newList;
item.map(u => {
item.map((u) => {
u.userIds = this.peploeId;
u.remark = this.pentity.remark;
});
this.$refs["formpepole"].validate(valid => {
this.$refs["formpepole"].validate((valid) => {
if (valid) {
let params = {
isDispatch: 1, //派工是1,保存是0
entryList: item
entryList: item,
};
Api.saveTeamentry(params).then(res => {
Api.saveTeamentry(params).then((res) => {
if (res.success) {
this.$Message.success("人员派工成功。");
this.getUserInfoFn();
......@@ -617,7 +707,7 @@ export default {
},
// 拆分方法
setChai(item, index) {
this.curTask=item;
this.curTask = item;
this.chaiModal = true;
this.chaiNum = 1;
this.maxnum = item.quantity - 1;
......@@ -627,15 +717,15 @@ export default {
okChai() {
var old = this.$u.clone(this.curTask);
var add = this.$u.clone(this.curTask);
old.quantity -= this.chaiNum;
add.quantity = this.chaiNum;
add.id = 0;
add.pid = old.id;
old.quantity -= this.chaiNum;
add.quantity = this.chaiNum;
add.id = 0;
add.pid = old.id;
let params = {
isDispatch: 0, //派工是1,保存是0
entryList: [old, add]
entryList: [old, add],
};
Api.saveTeamentry(params).then(res => {
Api.saveTeamentry(params).then((res) => {
if (res.success) {
this.getUserInfoFn();
this.$Message.success("拆分成功。");
......@@ -647,7 +737,7 @@ export default {
// 删除行
removeDetail(item, index) {
let delid = { id: item.id };
Api.deleteItem(delid).then(res => {
Api.deleteItem(delid).then((res) => {
if (res.success) {
this.$Message.success("拆分项已删除。");
this.getUserInfoFn();
......@@ -661,39 +751,47 @@ export default {
this.facilityModal = false;
this.manModal = false;
this.footerToolbar = false;
}
},
},
computed: {
ids(){
ids() {
// get(){
// console.warn("oldids");
let ids = [];
this.listTask.map(u => {
if (u.checked) { ids.push(u.id);}
});
if (ids.length > 0) {this.footerToolbar = true;}
return ids;
let ids = [];
this.listTask.map((u) => {
if (u.checked) {
ids.push(u.id);
}
});
if (ids.length > 0) {
this.footerToolbar = true;
}
return ids;
// },
// set(newVal){
// console.warn("newids");
// let ids = [];
// this.listTask.map(u => {
// if (u.checked) { ids.push(u.id);}
// });
// if (ids.length > 0) {this.footerToolbar = true;}
// return ids;
// this.ids = newVal
// }
// console.warn("newids");
// let ids = [];
// this.listTask.map(u => {
// if (u.checked) { ids.push(u.id);}
// });
// if (ids.length > 0) {this.footerToolbar = true;}
// return ids;
// this.ids = newVal
// }
},
listOrder() {
let orders = this.$u.group(this.listTask, u => {
return u.mesCode;
});// console.warn("listOrder", orders);
// console.log(this.listTask)
let orders = this.$u.group(this.listTask, (u) => {
// return u.mesCode;
return u.mesCode + "-" + u.routingHeaderId;
}); // console.warn("listOrder", orders);
// console.log(orders)
return orders;
},
peploeId() {
let peploeId = [];
this.listMan.map(u => {
this.listMan.map((u) => {
if (u.checked) {
peploeId.push(u.id);
}
......@@ -701,31 +799,31 @@ export default {
this.footerToolbar = true;
return peploeId;
},
showOperate(){
showOperate() {
// get(){
// console.info(this.ids.length)
// console.info(this.shebeiId)
// console.info(this.ids.length)
// console.info(this.shebeiId)
// debugger
return (
this.ids.length > 0 && (this.shebeiId > 0 || this.peploeId.length > 0)
)
);
// },
// set(newVal){
// console.log("newVal")
// this.showOperate = newVal;
// this.showOperate = newVal;
// return (
// this.ids.length > 0 && (this.shebeiId > 0 || this.peploeId.length > 0)
// )
// }
}
},
},
watch: {
// ids(n,o){
// console.info(n)
// console.info(o)
// console.warn(this.listTask);
// console.info(this.shebeiId)
// console.info(n)
// console.info(o)
// console.warn(this.listTask);
// console.info(this.shebeiId)
// }
}
},
};
</script>
\ No newline at end of file
......@@ -402,12 +402,12 @@ export default {
this.result.forEach((element) => {
for (let i = 0; i < element.list.length; i++) {
obj = {
detailId: element.list.length[i].detailId,
shopId: element.list.length[i].shopId,
quantity: element.list.length[i].quantity,
beginTime: element.list.length[i].beginTime,
endTime: element.list.length[i].endTime,
remark: element.list.length[i].remark,
detailId: element.list[i].detailId,
shopId: element.list[i].shopId,
quantity: element.list[i].quantity,
beginTime: element.list[i].beginTime,
endTime: element.list[i].endTime,
remark: element.list[i].remark,
};
items.push(obj);
}
......
......@@ -22,14 +22,14 @@
<Radio label="1">班组</Radio>
</RadioGroup>
</FormItem>-->
<FormItem label="人员" v-if="mode == 1" prop="userIds">
<FormItem label="人员" v-if="mode == 1" prop="userIds" :rules="{required: true, message: '必填', trigger: 'blur'}">
<!-- <UserSelect
ref="userSelected"
v-model="formItem.userIds"
style="width:300px"
:multiple="true"
/>-->
<UserSelect v-model="formItem.userIds" :multiple="true" :type="2" />
<UserSelect v-model="formItem.userIds" :multiple="true" :type="2" :rules="{required: true, message: '必填', trigger: 'blur'}"/>
</FormItem>
<FormItem label="班组" v-if="mode == 2" prop="shopId">
<Select
......@@ -106,21 +106,21 @@ export default {
},
},
],
userIds: [
{
required: true,
message: "请选择人员",
type: "array",
trigger: "change",
},
],
shopId: [
{
required: true,
message: "请选择班组",
trigger: "change",
},
],
// userIds: [
// {
// required: true,
// message: "请选择人员",
// type: "array",
// trigger: "change",
// },
// ],
// shopId: [
// {
// required: true,
// message: "请选择班组",
// trigger: "change",
// },
// ],
},
};
},
......@@ -131,18 +131,25 @@ export default {
methods: {
//确定
Determine() {
if (this.formItem.userIds && this.formItem.userIds.length == 0) {
this.$Message.error("人员不能为空");
if (this.mode == 1) {
if (!this.formItem.userIds) {
this.$Message.error("人员不能为空");
return false;
}
} else {
this.$refs["formItem"].validate((valid) => {
if (valid) {
this.formItem.detailId = this.detailId;
this.$emit("on-DetermineOk", this.formItem, this.indexId);
} else {
this.$Message.error("请填写完整");
}
});
if (!this.formItem.shopId) {
this.$Message.error("班组不能为空");
return false;
}
}
this.$refs["formItem"].validate((valid) => {
if (valid) {
this.formItem.detailId = this.detailId;
this.$emit("on-DetermineOk", this.formItem, this.indexId);
} else {
this.$Message.error("请填写完整");
}
});
},
closeOk() {
this.$emit("closeOk");
......
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