Commit 8b9ea898 authored by 康振飞's avatar 康振飞

调试拆分派工

parent a4fff957
...@@ -520,6 +520,7 @@ export default { ...@@ -520,6 +520,7 @@ export default {
let timebegin = formData[0].beginTime; let timebegin = formData[0].beginTime;
let timend = formData[0].endTime; let timend = formData[0].endTime;
this.newList = []; this.newList = [];
console.log("选中的id",chekids)
chekids.forEach(v => { chekids.forEach(v => {
var item = formData.filter(u => { var item = formData.filter(u => {
return u.id == v; return u.id == v;
...@@ -533,16 +534,16 @@ export default { ...@@ -533,16 +534,16 @@ export default {
this.facilityModal = true; this.facilityModal = true;
} else { } else {
this.pentity.taskTime = [timebegin, timend]; this.pentity.taskTime = [timebegin, timend];
if ( // if (
formData.map(t => { // formData.map(t => {
this.newList.filter(m => { // this.newList.filter(m => {
if ((m.id = t.id)) { // if ((m.id = t.id)) {
console.log(m.checked); // console.log(m.checked);
} // }
}); // });
}) // })
) { // ) {
} // }
this.manModal = true; this.manModal = true;
} }
console.log("选中的数据", this.newList); console.log("选中的数据", this.newList);
...@@ -550,53 +551,55 @@ export default { ...@@ -550,53 +551,55 @@ export default {
// 设备派工 // 设备派工
sendSheBei() { sendSheBei() {
let item = this.newList; let item = this.newList;
console.log(item)
item.map(u => { item.map(u => {
u.userIds = this.entity.userIds; u.userIds = this.entity.userIds;
u.remark = this.entity.remark; u.remark = this.entity.remark;
u.equipId = this.shebeiId; u.equipId = this.shebeiId;
}); });
this.$refs["formValidate"].validate(valid => { // this.$refs["formValidate"].validate(valid => {
if (valid) { // if (valid) {
Api.saveTeamentry(item).then(res => { // Api.saveTeamentry(item).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;
console.log("派工的数据",item)
item.map(u => { item.map(u => {
u.userIds = this.peploeId; u.userIds = this.peploeId;
u.remark = this.pentity.remark; u.remark = this.pentity.remark;
}); });
this.$refs["formpepole"].validate(valid => { // this.$refs["formpepole"].validate(valid => {
if (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) {
......
import axios from 'axios'; import axios from 'axios';
import util from '@/libs/util'; import util from '@/libs/util';
import Setting from '@/setting'; import Setting from '@/setting';
import QS from 'querystring'; import QS from 'querystring';
import { Message, Notice } from 'view-design'; import { Message, Notice } from 'view-design';
......
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