Commit b1c93d17 by yucheng.jiang
parents 62a416fc 7da0dd05
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
</div> </div>
<div class="choose"> <div class="choose">
<p class="selectTitle">3.操作</p> <p class="selectTitle">3.操作</p>
<Tabs type="card"> <Tabs type="card" :value="tabindex">
<TabPane label="上料" :disabled="attr1"> <TabPane label="上料" :disabled="attr1" name="1">
<div class="filter"> <div class="filter">
<label style="font-size: 16px" <label style="font-size: 16px"
>上料信息:</label >上料信息:</label
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
<Button type="primary">安装完成</Button> <Button type="primary">安装完成</Button>
</div> </div>
</TabPane> </TabPane>
<TabPane label="下料" :disabled="attr2" <TabPane label="下料" :disabled="attr2" name="2"
><div class="flex"> ><div class="flex">
<div> <div>
<Table <Table
...@@ -158,7 +158,11 @@ ...@@ -158,7 +158,11 @@
>状态:</span >状态:</span
> >
<span class="info">{{ <span class="info">{{
orderDetail.code orderDetail.status == 1
? "待上料"
: orderDetail.status == 2
? "运行中"
: "待下料"
}}</span> }}</span>
</p> </p>
<p class="flex"> <p class="flex">
...@@ -181,12 +185,12 @@ ...@@ -181,12 +185,12 @@
<div> <div>
<Button <Button
type="primary" type="primary"
@click="feedReady()" @click="blankReady()"
>准备下料</Button >准备下料</Button
> >
<Button <Button
type="primary" type="primary"
@click="installOver()" @click="uninstallOver()"
>拆卸完成</Button >拆卸完成</Button
> >
</div> </div>
...@@ -297,6 +301,7 @@ export default { ...@@ -297,6 +301,7 @@ export default {
orderDetail: {}, orderDetail: {},
detailobj: {}, detailobj: {},
sectionid: 0, sectionid: 0,
tabindex: "1",
}; };
}, },
created() { created() {
...@@ -347,9 +352,16 @@ export default { ...@@ -347,9 +352,16 @@ export default {
this.b = index; this.b = index;
let status = this.stationList[index].status; let status = this.stationList[index].status;
this.sectionid = this.stationList[index].section; this.sectionid = this.stationList[index].section;
if (status == 1) { if (status == 3) {
this.attr1 = true;
this.tabindex = "2";
this.getRunningDetail(index);
} else {
this.attr2 = true; this.attr2 = true;
} }
if (status == 2) {
this.getRunningDetail(index);
}
}, },
//获取储位 //获取储位
getStorages() { getStorages() {
...@@ -388,22 +400,48 @@ export default { ...@@ -388,22 +400,48 @@ export default {
console.log(err); console.log(err);
}); });
}, },
getRunningDetail(i) {
// /acc/AutomationOperate/GetLoadingState?section=4861
// 获取已上料的信息
this.request(
"/acc/AutomationOperate/GetLoadingState?section=" +
this.stationList[i].section,
"",
"get"
)
.then((res) => {
if (res.data.ret == 1) {
let obj = res.data.data;
this.orderDetail = Object.assign(
{},
this.orderDetail,
obj
);
} else {
this.$Message.error(this.$t(res.data, msg));
}
})
.catch((err) => {
console.log(err);
});
},
feedReady() { feedReady() {
// 准备上料 // 准备上料
if (this.sectionid == 0) { if (this.sectionid == 0) {
this.$Message.error("请选择工位"); this.$Message.error("请选择工位");
return false;
} }
let data = { let data = {
section: this.sectionid, section: this.sectionid,
code: this.orderDetail.orderNumber, code: this.orderDetail.orderNumber,
guid:this.orderDetail.fixtureGuid, guid: this.orderDetail.fixtureGuid,
locationid:this.orderDetail.location locationid: this.orderDetail.location,
}; };
this.request("/acc/AutomationOperate/Loading", data, "post").then( this.request("/acc/AutomationOperate/Loading", data, "post").then(
(res) => { (res) => {
if (res.data.ret == 1) { if (res.data.ret == 1) {
console.log(res.data.data); console.log(res.data.data);
this.$Message.success(this.$t(res.data.msg));
} else { } else {
this.$Message.error(this.$t(res.data.msg)); this.$Message.error(this.$t(res.data.msg));
} }
...@@ -412,12 +450,62 @@ export default { ...@@ -412,12 +450,62 @@ export default {
}, },
installOver() { installOver() {
// 安装完成 // 安装完成
if (this.sectionid == 0) {
this.$Message.error("请选择工位");
return false;
}
let data = { let data = {
section: 13, section: 13,
}; };
this.request("", data, "post").thne((res) => { this.request(
"/acc/AutomationOperate/CompalateAssemble",
data,
"post"
).thne((res) => {
if (res.data.ret == 1) {
this.$Message.success(this.$t(res.data.msg));
} else {
this.$Message.error(this.$t(res.data.msg));
}
});
},
blankReady() {
// 准备下料
if (this.sectionid == 0) {
this.$Message.error("请选择工位");
return false;
}
let data = {
section: this.sectionid,
};
this.request("/acc/AutomationOperate/Unloading", data, "post").thne(
(res) => {
if (res.data.ret == 1) {
this.$Message.success(this.$t(res.data.msg));
} else {
this.$Message.error(this.$t(res.data.msg));
}
}
);
},
uninstallOver() {
// 拆卸完成
if (this.sectionid == 0) {
this.$Message.error("请选择工位");
return false;
}
let data = {
section: this.sectionid,
};
this.request(
"/acc/AutomationOperate/Disassemble",
data,
"post"
).thne((res) => {
if (res.data.ret == 1) { if (res.data.ret == 1) {
this.$Message.success(this.$t(res.data.msg));
} else {
this.$Message.error(this.$t(res.data.msg));
} }
}); });
}, },
...@@ -425,7 +513,6 @@ export default { ...@@ -425,7 +513,6 @@ export default {
this.detailobj = currentRow; this.detailobj = currentRow;
this.orderDetail.fixtureGuid = this.detailobj.fixtureguid; this.orderDetail.fixtureGuid = this.detailobj.fixtureguid;
this.orderDetail.location = this.detailobj.locationid; this.orderDetail.location = this.detailobj.locationid;
}, },
request(url, data, type) { request(url, data, type) {
if (type == "get") { if (type == "get") {
......
...@@ -107,6 +107,8 @@ ...@@ -107,6 +107,8 @@
:columns="columns1" :columns="columns1"
:data="data1" :data="data1"
highlight-row highlight-row
@on-current-change="handleRowChange"
@on-row-click="onExpand"
></Table> ></Table>
<div class="pageDiv"> <div class="pageDiv">
<div class="pageDirection"> <div class="pageDirection">
...@@ -117,6 +119,8 @@ ...@@ -117,6 +119,8 @@
show-sizer show-sizer
show-total show-total
:page-size-opts="[10, 20, 30, 40, 100]" :page-size-opts="[10, 20, 30, 40, 100]"
@on-change="changePage"
@on-page-size-change="handlePageSize"
></Page> ></Page>
</div> </div>
</div> </div>
...@@ -256,6 +260,28 @@ export default { ...@@ -256,6 +260,28 @@ export default {
}, },
columns1: [ columns1: [
{ {
type: "expand",
width: "50",
render: (h, params) => {
// let str = "";
// if (params.row.managetype === 1) {
// str = "单件";
// } else if (params.row.managetype === 2) {
// str = "批次";
// }
return h("Table", {
props: {
data: params.row.childrens,
columns: this.columns2,
highlightRow: true,
},
on: {
onCurrentChange: () => {},
},
});
},
},
{
type: "index2", type: "index2",
title: this.$t("1008"), title: this.$t("1008"),
key: "xuhao", key: "xuhao",
...@@ -286,66 +312,61 @@ export default { ...@@ -286,66 +312,61 @@ export default {
title: "父工装编号", title: "父工装编号",
key: "code", key: "code",
}, },
// {
// // type: "expand", {
// title: "装配详情", title: "装配详情",
// key: "children", key: "s",
// render: (h, params) => { render: (h, params) => {
// // let str = ""; // let str = "";
// // if (params.row.managetype === 1) { // if (params.row.managetype === 1) {
// // str = "单件"; // str = "单件";
// // } else if (params.row.managetype === 2) { // } else if (params.row.managetype === 2) {
// // str = "批次"; // str = "批次";
// // } // }
// // return h(Table, { return h("div", "详情");
// // props:{ },
// // data:params.row.children, },
// // columns:this.columns2
// // }
// // });
// },
// },
{ {
title: "状态", title: "状态",
key: "status", key: "status",
// render: (h, params) => { render: (h, params) => {
// let str = ""; let str = "";
// if (params.row.status === 1) { if (params.row.status === 1) {
// str = "可用"; str = "可用";
// } else { } else {
// str = "停用"; str = "停用";
// } }
// return h("span", str); return h("span", str);
// }, },
},
{
title: "备注",
key: "remark",
}, },
// {
// title: "备注",
// key: "remark",
// },
{ {
title: "附件", title: "附件",
key: "filename", key: "filename",
// render: (h, params) => { render: (h, params) => {
// return h( return h(
// "span", "span",
// { {
// style: { style: {
// color: "#2b85e4", color: "#2b85e4",
// cursor: "pointer", cursor: "pointer",
// }, },
// on: { on: {
// click: () => { click: () => {
// let name = params.row.filename; let name = params.row.filename;
// let url = params.row.fileurl; let url = params.row.fileurl;
// if (url) { if (url) {
// this.downFile(url, name); this.downFile(url, name);
// } }
// }, },
// }, },
// }, },
// params.row.filename params.row.filename
// ); );
// }, },
}, },
{ {
title: "维护人", title: "维护人",
...@@ -362,24 +383,24 @@ export default { ...@@ -362,24 +383,24 @@ export default {
pagesize: 10, pagesize: 10,
columns2: [ columns2: [
{ {
title: "工装类型", title: "工装类型",
key: "category", key: "category",
}, },
{ {
title: "工装料号", title: "工装料号",
key: "category", key: "partnumber",
}, },
{ {
title: "工装名称", title: "工装名称",
key: "category", key: "name",
}, },
{ {
title: "工装规格", title: "工装规格",
key: "category", key: "specfication",
}, },
{ {
title: "工装编号", title: "工装编号",
key: "category", key: "code",
}, },
], ],
modal: false, modal: false,
...@@ -403,6 +424,7 @@ export default { ...@@ -403,6 +424,7 @@ export default {
fileurl: "", fileurl: "",
filename: "", filename: "",
UploadAction: this.axios.publicPath + "config/upload/UploadImage", UploadAction: this.axios.publicPath + "config/upload/UploadImage",
childObj:{}
}; };
}, },
created() { created() {
...@@ -428,15 +450,14 @@ export default { ...@@ -428,15 +450,14 @@ export default {
).then((res) => { ).then((res) => {
if (res.data.ret == 1) { if (res.data.ret == 1) {
this.total = res.data.total; this.total = res.data.total;
let arr = []; // let arr = [];
arr = res.data.data; // arr = res.data.data;
arr.forEach(ele=>{ // arr.forEach(ele=>{
ele.parentcate_guid = ''; // ele.parentcate_guid = '';
}) // })
this.data1 = arr; // this.data1 = arr;
console.log(this.data1); console.log(this.data1);
// this.data1 = res.data.data; this.data1 = res.data.data;
} }
}); });
}, },
...@@ -555,6 +576,28 @@ export default { ...@@ -555,6 +576,28 @@ export default {
} }
}); });
}, },
handleRowChange(currentRow, oldCurrentRow) {
this.detailobj = currentRow;
},
onExpand(row, index) {
this.detailobj = row;
this.data1.forEach((item, i) => {
//这个循环是为了每次只能展开一个,其他自动收起,不需要可以去掉
i !== index ? (this.data1[i]._expanded = false) : "";
});
this.data1[index]._expanded = !this.data1[index]._expanded;
this.data1.sort();
},
handlePageSize(value) {
this.page = 1;
this.pagesize = value;
this.search(0);
},
changePage(value) {
this.page = value;
this.search(0);
},
/*********文件上传 start******** */ /*********文件上传 start******** */
handleBeforeUpload(file) { handleBeforeUpload(file) {
this.spinShow = true; this.spinShow = true;
...@@ -584,20 +627,24 @@ export default { ...@@ -584,20 +627,24 @@ export default {
/*********文件上传 end******** */ /*********文件上传 end******** */
request(url, data, type) { request(url, data, type) {
if (type == "get") { if (type == "get") {
return this.axios.request({ return this.axios
url: url, .request({
params: data, url: url,
method: type, params: data,
}).then((res) => { method: type,
})
.then((res) => {
return res; return res;
}) })
.catch((error) => error); .catch((error) => error);
} else { } else {
return this.axios.request({ return this.axios
url: url, .request({
data, url: url,
method: type, data,
}).then((res) => { method: type,
})
.then((res) => {
return res; return res;
}) })
.catch((error) => error); .catch((error) => error);
......
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