Commit a2c243e4 authored by renjintao's avatar renjintao

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

parents bfb1ee38 39328ab1
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
<slot name="batch"></slot> <slot name="batch"></slot>
</div> </div>
<Button @click="cancelFooterToolbar">取消</Button> <Button @click="cancelFooterToolbar" class="btn">取消</Button>
</FooterToolbar> </FooterToolbar>
</div> </div>
</template> </template>
...@@ -477,10 +477,9 @@ export default { ...@@ -477,10 +477,9 @@ export default {
selectAll(status) { selectAll(status) {
this.$refs.table.selectAll(status); this.$refs.table.selectAll(status);
}, },
cancelFooterToolbar() cancelFooterToolbar() {
{
this.$refs.table.selectAll(false); this.$refs.table.selectAll(false);
this.footerToolbar=false this.footerToolbar = false;
} }
}, },
computed: { computed: {
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
<div class="bg bg3">1</div> <div class="bg bg3">1</div>
</CarouselItem> </CarouselItem>
</Carousel> </Carousel>
<div v-if="showI18n" class="page-account-header"> <!-- <div v-if="showI18n" class="page-account-header">
<i-header-i18n /> <i-header-i18n />
</div> </div> -->
<div class="main"> <div class="main">
<div class="ad"> <div class="ad">
<img src="@/assets/images/login/ad.png" /> <img src="@/assets/images/login/ad.png" />
......
...@@ -31,6 +31,13 @@ ...@@ -31,6 +31,13 @@
.dispatch_part_body{ .dispatch_part_body{
padding: 10px; padding: 10px;
overflow-y: auto; overflow-y: auto;
.h3_bg{
background: #a5adbf;
padding: 0 0 0 10px;
.h3_tag{
margin-left: 15px!important;
}
}
.dispatch_card{ .dispatch_card{
margin: 10px 0; margin: 10px 0;
.card{ .card{
......
<style lang="less" scoped> <style lang="less" scoped>
@import './dispatch.less'; @import "./dispatch.less";
</style> </style>
<template> <template>
<div class="dispatch myBug"> <div class="dispatch myBug">
...@@ -25,19 +25,24 @@ ...@@ -25,19 +25,24 @@
</RadioGroup> </RadioGroup>
</span> </span>
</p> </p>
<h4 class="tc" v-if="this.listTask.length==0">暂无数据</h4>
<div class="dispatch_part_body" v-if="listShow == '订单'" :style="{height:byheight}"> <div class="dispatch_part_body" v-if="listShow == '订单'" :style="{height:byheight}">
<!-- {{ids}} --> <!-- {{ids}} -->
<Collapse simple> <!-- <Collapse simple> -->
<Panel v-for="(item,index) in listOrder" :key="index" :name="item.mesCode"> <div v-for="(item,index) in listOrder" :key="index" :name="item.mesCode">
<b>订单号:{{item[0].mesCode}} <Tag>{{item.length}}</Tag></b> <h3 class="h3_bg">
订单号:{{item[0].mesCode}}
<Tag class="h3_tag">{{item.length}}</Tag>
</h3>
<!-- 订单号:{{item[0].mesCode}} {{item.length}} --> <!-- 订单号:{{item[0].mesCode}} {{item.length}} -->
<p slot="content"> <p slot="content">
<Row :gutter="15" class="card_body01"> <Row :gutter="15" class="card_body01">
<Col span="8" class="dispatch_card" v-for="(li,index) in item" :key="li.id"> <Col span="8" class="dispatch_card" v-for="(li,index) in item" :key="li.id">
<Card> <Card>
<p slot="title" class="card_top"> <p slot="title" class="card_top">
<Checkbox v-model="li.checked" :disabled="li.status!=-1" > <Checkbox v-model="li.checked" :disabled="li.status!=-1">
<Icon type="ios-pricetags" />工序{{li.process_seq}}{{li.process_name}} <Icon type="ios-pricetags" />
工序{{li.process_seq}}{{li.process_name}}
</Checkbox> </Checkbox>
</p> </p>
<div class="h60"> <div class="h60">
...@@ -55,7 +60,7 @@ ...@@ -55,7 +60,7 @@
title="删除" title="删除"
type="icon" type="icon"
icon="md-close-circle" icon="md-close-circle"
v-else-if="li.pid != 0" v-else-if="li.dispatchStatus!=2 && li.pid != 0"
@click="removeDetail(li,index)" @click="removeDetail(li,index)"
></op> ></op>
</p> </p>
...@@ -67,8 +72,8 @@ ...@@ -67,8 +72,8 @@
</Col> </Col>
</Row> </Row>
</p> </p>
</Panel> </div>
</Collapse> <!--</Collapse> -->
</div> </div>
<div class="dispatch_part_body" v-else-if="listShow == '工单'" :style="{height:byheight}"> <div class="dispatch_part_body" v-else-if="listShow == '工单'" :style="{height:byheight}">
<Row :gutter="15" class="card_body01"> <Row :gutter="15" class="card_body01">
...@@ -97,7 +102,7 @@ ...@@ -97,7 +102,7 @@
title="删除" title="删除"
type="icon" type="icon"
icon="md-close-circle" icon="md-close-circle"
v-else-if="item.pid != 0" v-else-if="item.dispatchStatus!=2 && item.pid != 0"
@click="removeDetail(item,index)" @click="removeDetail(item,index)"
></op> ></op>
<!-- --> <!-- -->
...@@ -130,6 +135,7 @@ ...@@ -130,6 +135,7 @@
</span> </span>
</p> </p>
<div class="dispatch_part_body" :style="{height:byheight}"> <div class="dispatch_part_body" :style="{height:byheight}">
<h4 class="tc" v-if="listMan.length==0 || listSheBei.length==0">暂无数据</h4>
<div class="shebei" v-if="button2 == '设备'"> <div class="shebei" v-if="button2 == '设备'">
<Row :gutter="15"> <Row :gutter="15">
<!-- {{shebeiId}} --> <!-- {{shebeiId}} -->
...@@ -138,7 +144,8 @@ ...@@ -138,7 +144,8 @@
span="12" span="12"
class="dispatch_card" class="dispatch_card"
v-for="(item,index) in listSheBei" v-for="(item,index) in listSheBei"
:key="index"> :key="index"
>
<Card class="card"> <Card class="card">
<p slot="title" class="card_top"> <p slot="title" class="card_top">
<label @click="setShebeiId(item.id)" class="label"> <label @click="setShebeiId(item.id)" class="label">
...@@ -171,9 +178,9 @@ ...@@ -171,9 +178,9 @@
<Row :gutter="15"> <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"> <CheckboxGroup class="man_body">
<Checkbox v-model="item.checked" border class='checkUser'> <Checkbox v-model="item.checked" border class="checkUser">
<!-- <Tooltip :content="item.userName" placement="top-start"> --> <!-- <Tooltip :content="item.userName" placement="top-start"> -->
<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> --> <!-- <span class="svg">{{item.id}}</span> -->
<!-- </Tooltip> --> <!-- </Tooltip> -->
</Checkbox> </Checkbox>
...@@ -186,8 +193,14 @@ ...@@ -186,8 +193,14 @@
</Col> </Col>
</Row> </Row>
<!-- 拆分 fenModel --> <!-- 拆分 fenModel -->
<Modal v-model="chaiModal" title="拆分工序" :width="400" <Modal
:mask-closable="false" ok-text="拆分" @on-ok="okChai()" > v-model="chaiModal"
title="拆分工序"
:width="400"
: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> <Slider v-model="chaiNum" :max="maxnum" show-stops :min="1"></Slider>
...@@ -217,10 +230,10 @@ ...@@ -217,10 +230,10 @@
<UserSelect <UserSelect
ref="userSelected" ref="userSelected"
v-model="entity.userIds" v-model="entity.userIds"
:type="3"
:multiple="true" :multiple="true"
style="width: 500px" style="width: 500px"
/> />
<!-- :type="3" -->
</FormItem> </FormItem>
</Col> </Col>
<Col span="24" class="drawer_midell"> <Col span="24" class="drawer_midell">
...@@ -291,27 +304,28 @@ ...@@ -291,27 +304,28 @@
</div> </div>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
components: { }, components: {},
data() { data() {
return { return {
action: Api.index, action: Api.index,
toheight: '500px', toheight: "500px",
byheight: '450px', byheight: "450px",
button1: '全部', button1: "全部",
button2: '设备', button2: "设备",
listShow: '订单', listShow: "订单",
shebei: '', shebei: "",
curTask:null,
dateRange: { dateRange: {
//禁选工时时间区间 //禁选工时时间区间
disabledDate(date) { disabledDate(date) {
return date && date.valueOf() < Date.now() - 86400000 return date && date.valueOf() < Date.now() - 86400000;
} }
}, },
shebeiId: -1, shebeiId: -1,
footerToolbar: false, footerToolbar: false,
status: '1', //排产状态 status: "1", //排产状态
footerMore: true, //CheckItem!=null&&CheckItem!='' footerMore: true, //CheckItem!=null&&CheckItem!=''
footerModel: false, //底部按钮 footerModel: false, //底部按钮
facilityModal: false, //设备抽屉 facilityModal: false, //设备抽屉
...@@ -319,358 +333,360 @@ export default { ...@@ -319,358 +333,360 @@ export default {
listSheBei: [], //设备列表 listSheBei: [], //设备列表
listMan: [], //人员列表 listMan: [], //人员列表
listTask: [], //工单列表数据 listTask: [], //工单列表数据
listTitle: [],//订单号列表 listTitle: [], //订单号列表
newList: [], //选中数据 newList: [], //选中数据
chaiModal: false, //拆分弹框 chaiModal: false, //拆分弹框
chaiNum: 1, //拆分数量 chaiNum: 1, //拆分数量
maxnum: 1, maxnum: 1,
rowIndex: 0, //多选项的index rowIndex: 0, //多选项的index
chaiId:0, chaiId: 0,
entity: { entity: {
taskTime: '', //工时 taskTime: "", //工时
userIds: null, //选中人员 userIds: null, //选中人员
remark: '' //备注 remark: "" //备注
}, },
ruleValidate: { ruleValidate: {
taskTime: [{ taskTime: [
{
required: true, required: true,
type: 'array', type: "array",
message: "请选择工时时间段", message: "请选择工时时间段",
trigger: 'blur', trigger: "blur",
fields: { fields: {
0: {type: "date", required: true, message: "请选择工时时间段"}, 0: { type: "date", required: true, message: "请选择工时时间段" },
1: {type: "date", required: true, message: "请选择工时时间段"} 1: { type: "date", required: true, message: "请选择工时时间段" }
}
} }
}], ],
userIds: [ userIds: [
{ {
required: true, required: true,
message: '请选择人员!', message: "请选择人员!",
trigger: 'blur', trigger: "blur",
type: 'array' type: "array"
} }
] ]
}, },
pentity: { pentity: {
taskTime: '', //工时 taskTime: "", //工时
remark: '' //备注 remark: "" //备注
}, },
rulepepole:{ rulepepole: {
taskTime: [{ taskTime: [
{
required: true, required: true,
type: 'array', type: "array",
message: "请选择工时时间段", message: "请选择工时时间段",
trigger: 'blur', trigger: "blur",
fields: { fields: {
0: {type: "date", required: true, message: "请选择工时时间段"}, 0: { type: "date", required: true, message: "请选择工时时间段" },
1: {type: "date", required: true, message: "请选择工时时间段"} 1: { type: "date", required: true, message: "请选择工时时间段" }
} }
}]
},
} }
]
}
};
}, },
created() { created() {
this.getUserInfoFn() this.getUserInfoFn();
this.byheight = window.innerHeight - 208 + 'px' this.byheight = window.innerHeight - 208 + "px";
}, },
mounted() { mounted() {
this.byheight = window.innerHeight - 208 + 'px' this.byheight = window.innerHeight - 208 + "px";
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { methods: {
getUserInfoFn() { getUserInfoFn() {
let userId = this.$store.state.userInfo.userId let userId = this.$store.state.userInfo.userId;
let infoid, departId let infoid, departId;
Api.getUserDepartment({ userId: userId }).then((res) => { Api.getUserDepartment({ userId: userId }).then(res => {
if (res.success) { if (res.success) {
infoid = res.result.id infoid = res.result.id;
} else { } else {
infoid = [] infoid = [];
this.$Message.error('查询失败!') this.$Message.error("查询失败!");
} }
}) });
Api.getUserInfo({ id: userId }).then((res) => { Api.getUserInfo({ id: userId }).then(res => {
if (res.success) { if (res.success) {
departId = res.result.departmentId departId = res.result.departmentId;
this.getEntryList(departId) this.getEntryList(departId);
this.getselectuser(departId) this.getselectuser(departId);
this.getlistall(departId) this.getlistall(departId);
} else { } else {
departId = '' departId = "";
this.$Message.error('查询失败!') this.$Message.error("查询失败!");
} }
}) });
}, },
setShebeiId(id) { setShebeiId(id) {
this.shebeiId = id this.shebeiId = id;
this.footerToolbar = true this.footerToolbar = true;
}, },
// 获取查询人员 // 获取查询人员
getselectuser(id) { getselectuser(id) {
let parme = { departmentId: id, type: '2' } let parme = { departmentId: id, type: "2" };
Api.getUser(parme).then((res) => { Api.getUser(parme).then(res => {
res.result.map((u) => { res.result.map(u => {
u.checked = false u.checked = false;
}) });
this.listMan = res.result this.listMan = res.result;
}) });
}, },
// 获取查询设备 // 获取查询设备
getlistall(id) { getlistall(id) {
let parme = { shopid: id } let parme = { shopid: id };
Api.getlistall(parme).then((res) => { Api.getlistall(parme).then(res => {
res.result.map((u) => { res.result.map(u => {
u.checked = false u.checked = false;
}) });
this.listSheBei = res.result this.listSheBei = res.result;
}) });
}, },
// 获取用户工单 JSON.stringify(parme) // 获取用户工单 JSON.stringify(parme)
getEntryList(id) { getEntryList(id) {
let parme = { departmentId: id, DispatchStatus: this.status } let parme = { departmentId: id, DispatchStatus: this.status };
Api.getEntryList(parme).then((res) => { Api.getEntryList(parme).then(res => {
var savedUl = [] var savedUl = [];
var pid var pid;
res.result.map((u) => { res.result.map(u => {
if(u.pid){ if (u.pid) {
pid = u.pid pid = u.pid;
}else{ } else {
pid = 0 pid = 0;
} }
let detailnew = { let detailnew = {
beginTime: u.beginTime,//开始时间 beginTime: u.beginTime, //开始时间
dispatchStatus: u.dispatchStatus,// dispatchStatus: u.dispatchStatus, //
endTime: u.endTime,// endTime: u.endTime, //
equipCode: u.equipCode,// equipCode: u.equipCode, //
equipId: u.equipId,// equipId: u.equipId, //
executeId: u.executeId,// executeId: u.executeId, //
id: u.id,// id: u.id, //
mesCode: u.mesCode,// mesCode: u.mesCode, //
order_id: u.order_id,// order_id: u.order_id, //
process_content: u.process_content,// process_content: u.process_content, //
process_name: u.process_name,// process_name: u.process_name, //
process_seq: u.process_seq,// process_seq: u.process_seq, //
productName: u.productName,// productName: u.productName, //
quantity: u.quantity,// quantity: u.quantity, //
routingDetailId: u.routingDetailId,// routingDetailId: u.routingDetailId, //
routingHeaderId: u.routingHeaderId,// routingHeaderId: u.routingHeaderId, //
status: u.status,// status: u.status, //
userIds: u.userIds,// userIds: u.userIds, //
userNames: u.userNames, userNames: u.userNames,
pid: pid, //拆分项id pid: pid //拆分项id
} };
savedUl.push(detailnew) savedUl.push(detailnew);
}) });
this.listTask = savedUl this.listTask = savedUl;
}) });
},
// 数组去重
getArray(a) {
const hash = {}
const len = a.length
const result = []
for (let i = 0; i < len; i++) {
if (!hash[a[i]]) {
hash[a[i]] = true
result.push(a[i])
}
}
return result
}, },
// 时间改变方法 // 时间改变方法
handleChange(daterange) { handleChange(daterange) {
this.newList.map((u) => { this.newList.map(u => {
u.beginTime = daterange[0] u.beginTime = daterange[0];
u.endTime = daterange[1] u.endTime = daterange[1];
}) });
}, },
handleChangeTime(time) { handleChangeTime(time) {
this.newList.map((u) => { this.newList.map(u => {
u.beginTime = time[0] u.beginTime = time[0];
u.endTime = time[1] u.endTime = time[1];
}) });
}, },
// 过滤条件 // 过滤条件
changeStatus(a) { changeStatus(a) {
// console.log(a) // console.log(a)
this.getUserInfoFn() this.getUserInfoFn();
}, },
// 打开抽屉 // 打开抽屉
openDrawer() { openDrawer() {
let chekids = this.ids let chekids = this.ids;
let formData = this.listTask let formData = this.listTask;
let timebegin = formData[0].beginTime let timebegin = formData[0].beginTime;
let timend = formData[0].endTime let timend = formData[0].endTime;
this.newList = [] this.newList = [];
chekids.forEach((v) => { // console.log("选中的id",chekids)
var item = formData.filter((u) => { chekids.forEach(v => {
return u.id == v var item = formData.filter(u => {
}) return u.id == v;
});
if (item && item[0]) { if (item && item[0]) {
this.newList.push(item[0]) this.newList.push(item[0]);
} }
}) });
if (this.button2 == '设备') { if (this.button2 == "设备") {
this.entity.taskTime = [timebegin,timend] this.entity.taskTime = [timebegin, timend];
this.facilityModal = true this.facilityModal = true;
} else { } else {
this.pentity.taskTime = [timebegin,timend] this.pentity.taskTime = [timebegin, timend];
if(formData.map(t=>{ // if (
this.newList.filter(m=>{ // formData.map(t => {
if(m.id = t.id){ // this.newList.filter(m => {
console.log(m.checked) // if ((m.id = t.id)) {
// console.log(m.checked);
// }
// });
// })
// ) {
// }
this.manModal = true;
} }
}) // console.log("选中的数据", this.newList);
})){
}
this.manModal = true
}
console.log('选中的数据', this.newList)
}, },
// 设备派工 // 设备派工
sendSheBei() { sendSheBei() {
let item = this.newList let item = this.newList;
item.map((u) => { // console.log(item)
u.userIds = this.entity.userIds item.map(u => {
u.remark = this.entity.remark u.userIds = this.entity.userIds;
u.equipId = this.shebeiId u.remark = this.entity.remark;
}) u.equipId = this.shebeiId;
this.$refs['formValidate'].validate((valid) => { });
if(valid){ this.$refs["formValidate"].validate(valid => {
Api.saveTeamentry(item).then((res) => { if (valid) {
let params = {
isDispatch: 1, //派工是1,保存是0
entryList: item
};
Api.saveTeamentry(params).then(res => {
if (res.success) { if (res.success) {
this.$Message.success('设备派工成功。') this.$Message.success("设备派工成功。");
this.getUserInfoFn() this.getUserInfoFn();
this.facilityModal = false this.facilityModal = false;
} else { } else {
this.$Message.error('设备派工失败...') this.$Message.error("设备派工失败...");
} }
}) });
}else{ } else {
this.$Message.error('校验不通过...') this.$Message.error("校验不通过...");
} }
}) });
}, },
// 人员派工 // 人员派工
sendUser() { sendUser() {
let item = this.newList let item = this.newList;
item.map((u) => { // console.log("派工的数据",item)
u.userIds = this.peploeId item.map(u => {
u.remark = this.pentity.remark u.userIds = this.peploeId;
}) u.remark = this.pentity.remark;
this.$refs['formpepole'].validate((valid) => { });
if(valid){ this.$refs["formpepole"].validate(valid => {
if (valid) {
let params = { let params = {
isDispatch: 1,//派工是1,保存是0 isDispatch: 1, //派工是1,保存是0
entryList: item entryList: item
} };
Api.saveTeamentry(params).then((res) => { Api.saveTeamentry(params).then(res => {
if (res.success) { if (res.success) {
this.$Message.success('人员派工成功。') this.$Message.success("人员派工成功。");
this.getUserInfoFn() this.getUserInfoFn();
this.manModal = false this.manModal = false;
} else { } else {
this.$Message.error('人员派工失败...') this.$Message.error("人员派工失败...");
} }
}) });
}else{ } else {
this.$Message.error('校验不通过...') this.$Message.error("校验不通过...");
} }
}) });
}, },
// 拆分方法 // 拆分方法
setChai(item, index) { setChai(item, index) {
this.chaiModal = true // console.log(item, index)
this.chaiNum = 1 this.curTask=item;
this.maxnum = item.quantity - 1 this.chaiModal = true;
this.rowIndex = index this.chaiNum = 1;
}, this.maxnum = item.quantity - 1;
okChai() { this.rowIndex = index;
var detail = this.$u.clone(this.listTask[this.rowIndex])
this.listTask[this.rowIndex].quantity -= this.chaiNum
detail.pid = detail.id
detail.id = 0
detail.quantity = this.chaiNum
this.listTask.splice(this.rowIndex + 1, 0, detail)
console.log("拆分后数据",this.listTask)
this.saveFameData()
this.getUserInfoFn()
}, },
// 拆分保存 // 拆分保存
saveFameData() { 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;
let params = { let params = {
isDispatch: 0,//派工是1,保存是0 isDispatch: 0, //派工是1,保存是0
entryList: this.listTask entryList: [old, add]
} };
Api.saveTeamentry(params).then((res) => { Api.saveTeamentry(params).then(res => {
if (res.success) { if (res.success) {
this.$Message.success('拆分成功。') this.getUserInfoFn();
this.$Message.success("拆分成功。");
} else { } else {
this.$Message.error('拆分失败...') this.$Message.error("拆分失败...");
} }
}) });
}, },
// 删除行 // 删除行
removeDetail(item, index) { removeDetail(item, index) {
let delid = {id:item.id} let delid = { id: item.id };
Api.deleteItem(delid).then((res) => { Api.deleteItem(delid).then(res => {
if (res.success) { if (res.success) {
this.$Message.success('拆分项已删除。') this.$Message.success("拆分项已删除。");
this.getUserInfoFn() this.getUserInfoFn();
} else { } else {
this.$Message.error('拆分项删除失败!') this.$Message.error("拆分项删除失败!");
} }
}) });
// let oldList = this.listTask; // let oldList = this.listTask;
// let clickRow = oldList.filter(listRow=>listRow.process_name===item.process_name)[0]; // let clickRow = oldList.filter(listRow=>listRow.process_name===item.process_name)[0];
// clickRow.quantity += this.chaiNum // clickRow.quantity += this.chaiNum
// this.listTask.splice(index, 1) // this.listTask.splice(index, 1)
// this.$Message.success('拆分项已删除。') // this.$Message.success('拆分项已删除。')
}, },
cancle() {//取消 cancle() {
this.facilityModal = false //取消
this.manModal = false this.facilityModal = false;
this.footerToolbar=false this.manModal = false;
}, this.footerToolbar = false;
}
}, },
computed: { computed: {
ids() { ids() {
let ids = [] let ids = [];
this.listTask.map((u) => { this.listTask.map(u => {
if (u.checked) { if (u.checked) {
ids.push(u.id) ids.push(u.id);
} }
}) });
if (ids.length > 0) { if (ids.length > 0) {
this.footerToolbar = true this.footerToolbar = true;
} }
return ids return ids;
}, },
listOrder(){ listOrder() {
let orders= this.$u.group(this.listTask,u=>{ let orders = this.$u.group(this.listTask, u => {
return u.mesCode return u.mesCode;
}) });
console.warn("listOrder",orders) // console.warn("listOrder", orders);
return orders; return orders;
}, },
peploeId() { peploeId() {
let peploeId = [] let peploeId = [];
this.listMan.map((u) => { this.listMan.map(u => {
if (u.checked) { if (u.checked) {
peploeId.push(u.id) peploeId.push(u.id);
} }
}) });
this.footerToolbar = true this.footerToolbar = true;
return peploeId return peploeId;
}, },
showOperate() { showOperate() {
return this.ids.length > 0 && (this.shebeiId > 0 || this.peploeId.length >0) return (
this.ids.length > 0 && (this.shebeiId > 0 || this.peploeId.length > 0)
);
} }
}, },
watch:{}, watch: {}
} };
</script> </script>
<style lang="less"> <style lang="less">
</style> </style>
\ No newline at end of file
...@@ -17,6 +17,9 @@ export default { ...@@ -17,6 +17,9 @@ export default {
update(params) { update(params) {
return Api.post(`${systemUrl}/equipcalendarwork/createorupdate`, params); return Api.post(`${systemUrl}/equipcalendarwork/createorupdate`, params);
}, },
set(params) {
return Api.post(`${systemUrl}/planresource/setplanresource`, params);
},
//删除: //删除:
delete(params) { delete(params) {
return Api.delete(`${systemUrl}/planresource/delete`, { params: params }); return Api.delete(`${systemUrl}/planresource/delete`, { params: params });
......
<template> <template>
<div> <div class="resources-p">
<DataGrid :columns="columns" ref="grid" :action="action" :high="false"> <DataGrid
:columns="columns"
ref="grid"
:action="action"
:high="false"
@on-selection-change="onSelect"
>
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys"> <FormItem prop="keys">
<Input placeholder="请输入关键字资源名称/资源编号/资源类型/部门" v-model="easySearch.keys.value" /> <Input placeholder="请输入资源名称/编号/类型/部门" v-model="easySearch.keys.value" />
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button type="primary" @click="search">查询</Button> <Button type="primary" @click="search">查询</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<template slot="batch">
<Form ref="form" :model="entity" :rules="rules" :label-width="90" class="form-row">
<Row>
<Col span="8">
<FormItem :label="l('isimportant')" prop="isimportant">
<RadioGroup v-model="entity.isimportant">
<Radio label="0"></Radio>
<Radio label="1"></Radio>
</RadioGroup>
</FormItem>
</Col>
<Col span="12">
<FormItem :label="l('capabilityValue')">
<InputNumber v-model="entity.capabilityValue"></InputNumber>
</FormItem>
</Col>
<Col span="4">
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
</FormItem>
</Col>
</Row>
</Form>
</template>
</DataGrid> </DataGrid>
<Modal v-model="editModal" title="编辑" footer-hide> <Modal v-model="editModal" title="编辑" footer-hide>
...@@ -38,14 +68,23 @@ export default { ...@@ -38,14 +68,23 @@ export default {
easySearch: { easySearch: {
keys: { op: "title,code,type,departTitle", value: null } keys: { op: "title,code,type,departTitle", value: null }
}, },
entity: {},
disabled: false,
ids: [],
editModal: false, editModal: false,
deletelModal: false, deletelModal: false,
curId: 0, curId: 0,
rules: {
isimportant: [{ required: true, message: "必填", trigger: "blur" }],
capabilityValue: [{ required: true, message: "必填", trigger: "blur" }]
},
columns: [ columns: [
{ key: "id", title: this.l("id"), hide: true, align: "left" }, { key: "id", title: this.l("id"), hide: true, align: "left" },
{
type: "selection",
width: 70,
align: "center"
},
// { // {
// key: "deleterUserId", // key: "deleterUserId",
// title: this.l("deleterUserId"), // title: this.l("deleterUserId"),
...@@ -194,6 +233,46 @@ export default { ...@@ -194,6 +233,46 @@ export default {
this.editModal = false; this.editModal = false;
this.deletedlModal = false; this.deletedlModal = false;
}, },
onSelect(a, b) {
console.log(a);
//批量选择
let selectRows = a;
this.ids = [];
selectRows.forEach(e => {
this.ids.push(e.id);
});
},
handleSubmit() {
this.$refs.form.validate(v => {
if (v) {
this.disabled = true;
let data = {
ids: this.ids,
isimportant: this.entity.isimportant,
capabilityValue: this.entity.capabilityValue
};
Api.set(data)
.then(r => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
} else {
this.$Message.error("保存失败");
}
})
.catch(err => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
});
}
});
},
handleClose() {
this.footer = false;
this.handleSelectAll(false);
},
l(key) { l(key) {
let vkey = "plan_resource" + "." + key; let vkey = "plan_resource" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
...@@ -202,4 +281,24 @@ export default { ...@@ -202,4 +281,24 @@ export default {
}; };
</script> </script>
<style lang="less"> <style lang="less">
.resources-p {
.form-row {
width: 600px;
margin-left: 50px;
margin-top: -45px;
.ivu-form-item-label {
color: #fff !important;
}
}
.ivu-footer-toolbar-right {
width: 1100px;
position: relative !important;
}
.btn {
position: absolute !important;
top: 12px !important;
right: 40px !important;
}
}
</style> </style>
\ No newline at end of file
FROM nginx
WORKDIR /usr/share/nginx/html
COPY dist/ .
COPY nginx.conf /etc/nginx/nginx.conf
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
EXPOSE 3006
ENTRYPOINT ["nginx", "-g","daemon off;"]
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/*.conf;
server {
listen 3006;
root /usr/share/nginx/html;
location / {
try_files $uri $uri/ @router;
index index.html index.htm;
}
location @router {
rewrite ^.*$.index.html last;
}
}
}
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