Commit a571d877 authored by renjintao's avatar renjintao

mesplan order handel

parent 3608078b
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
type="daterange" type="daterange"
placeholder="请选择日期" placeholder="请选择日期"
style="width:240px" style="width:240px"
transfer="true" :transfer="true"
:options="optionsDate" :options="optionsDate"
@on-change="inputOrderCat(row,index)" @on-change="inputOrderCat(row,index)"
></DatePicker> ></DatePicker>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<TabPane label="待我审批的" name="1"></TabPane> <TabPane label="待我审批的" name="1"></TabPane>
<TabPane label="我已审批的" name="2"></TabPane> <TabPane label="我已审批的" name="2"></TabPane>
<TabPane label="待办任务" name="3"> <TabPane label="待办任务" name="3">
<Task v-if='tabIndex==4'></Task> <Task v-if="tabIndex==4"></Task>
</TabPane> </TabPane>
</Tabs> </Tabs>
<DataGrid <DataGrid
...@@ -37,11 +37,7 @@ ...@@ -37,11 +37,7 @@
</Select> </Select>
</Col> </Col>
<Col span="10"> <Col span="10">
<DTSearch <DTSearch v-model="easySearch.range.value" @on-change="setTime" type="date"></DTSearch>
v-model="easySearch.range.value"
@on-change="setTime"
type="date"
></DTSearch>
</Col> </Col>
<Col span="9"> <Col span="9">
<Input <Input
...@@ -63,21 +59,15 @@ ...@@ -63,21 +59,15 @@
fullscreen fullscreen
@on-cancel="cancelModal" @on-cancel="cancelModal"
> >
<iframe <iframe width="100%" id="mainFrame" :height="iframeHeight" frameborder="0" :src="srcUrl"></iframe>
width="100%"
id="mainFrame"
:height="iframeHeight"
frameborder="0"
:src="srcUrl"
></iframe>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
import Task from './task' import Task from "./task";
export default { export default {
name: 'handle', name: "handle",
components: { components: {
Task Task
}, },
...@@ -86,10 +76,10 @@ export default { ...@@ -86,10 +76,10 @@ export default {
show: false, show: false,
action: Api.index, action: Api.index,
easySearch: { easySearch: {
type: { op: 'Equal', value: 1 }, // 1我发起的 2待我审批的 3 我已审批的 type: { op: "Equal", value: 1 }, // 1我发起的 2待我审批的 3 我已审批的
keys: { op: 'code', value: '' }, keys: { op: "code", value: "" },
schemaId: { op: 'Equal', value: null }, //审批类别 schemaId: { op: "Equal", value: null }, //审批类别
range: { op: 'Range', value: null } range: { op: "Range", value: null }
}, },
schemaList: [], schemaList: [],
results: [], results: [],
...@@ -98,24 +88,24 @@ export default { ...@@ -98,24 +88,24 @@ export default {
tabIndex: 4, tabIndex: 4,
columns: [ columns: [
{ {
key: 'id', key: "id",
width: 80, width: 80,
title: this.l('id'), title: this.l("id"),
hide: true hide: true
}, },
{ {
key: 'code', key: "code",
width: 240, width: 240,
title: this.l('code') title: this.l("code")
}, },
{ {
title: this.l('schemaId'), title: this.l("schemaId"),
key: 'schemaId', key: "schemaId",
hide: true hide: true
}, },
{ {
title: this.l('schemaName'), title: this.l("schemaName"),
key: 'schemaName' key: "schemaName"
}, },
// { // {
// title: this.l('status'), // title: this.l('status'),
...@@ -123,60 +113,60 @@ export default { ...@@ -123,60 +113,60 @@ export default {
// hide: true // hide: true
// }, // },
{ {
title: this.l('startRecordId'), title: this.l("startRecordId"),
key: 'startRecordId', key: "startRecordId",
hide: true hide: true
}, },
{ {
title: this.l('currentNodeId'), title: this.l("currentNodeId"),
key: 'currentNodeId', key: "currentNodeId",
hide: true hide: true
}, },
{ {
title: this.l('currentNodeName'), title: this.l("currentNodeName"),
key: 'currentNodeName' key: "currentNodeName"
}, },
{ {
title: this.l('nextNodeId'), title: this.l("nextNodeId"),
key: 'nextNodeId', key: "nextNodeId",
hide: true hide: true
}, },
{ {
title: this.l('nextNodeName'), title: this.l("nextNodeName"),
key: 'nextNodeName' key: "nextNodeName"
}, },
{ {
title: this.l('status'), title: this.l("status"),
key: 'status', key: "status",
high: true, high: true,
code: 'Handle.todoList.status' code: "Handle.todoList.status"
}, },
{ {
title: this.l('creatorUserId'), title: this.l("creatorUserId"),
key: 'creatorUserId', key: "creatorUserId",
hide: true hide: true
}, },
{ {
title: this.l('creator'), title: this.l("creator"),
key: 'creator', key: "creator",
align: 'center' align: "center"
}, },
{ {
title: this.l('creationTime'), title: this.l("creationTime"),
key: 'creationTime', key: "creationTime",
align: 'center' align: "center"
}, },
{ {
title: '操作', title: "操作",
align: 'center', align: "center",
render: (h, params) => { render: (h, params) => {
return h('div', { class: 'action' }, [ return h("div", { class: "action" }, [
h( h(
'op', "op",
{ {
attrs: { attrs: {
oprate: 'detail' oprate: "detail"
}, },
on: { on: {
click: () => { click: () => {
...@@ -185,142 +175,139 @@ export default { ...@@ -185,142 +175,139 @@ export default {
params.row.schemaName, params.row.schemaName,
params.row.code, params.row.code,
params.row.id params.row.id
) );
} }
} }
}, },
this.tabIndex == 2 ? '审核' : '查看' this.tabIndex == 2 ? "审核" : "查看"
) )
]) ]);
} }
} }
], ],
codeTypeName: '', //审核类型 codeTypeName: "", //审核类型
gridHeight: '', gridHeight: "",
//订单审核开始 //订单审核开始
modalOrderExamine: false, modalOrderExamine: false,
srcUrl: '', srcUrl: "",
iframeHeight: '', iframeHeight: "",
titleOrderExamine: '', titleOrderExamine: "",
OrderExamine: '' OrderExamine: ""
//订单审核结束 //订单审核结束
} };
}, },
created() { created() {
window.screenHeight = window.innerHeight window.screenHeight = window.innerHeight;
this.iframeHeight = window.screenHeight - 58 this.iframeHeight = window.screenHeight - 58;
this.gridHeight = window.screenHeight - 260 this.gridHeight = window.screenHeight - 260;
}, },
mounted() { mounted() {
window.onresize = () => { window.onresize = () => {
///浏览器窗口大小变化 ///浏览器窗口大小变化
return (() => { return (() => {
window.screenHeight = window.innerHeight window.screenHeight = window.innerHeight;
this.iframeHeight = window.screenHeight - 58 this.iframeHeight = window.screenHeight - 58;
this.gridHeight = window.screenHeight - 260 this.gridHeight = window.screenHeight - 260;
})() })();
} };
this.getSchema() this.getSchema();
}, },
computed: {}, computed: {},
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { methods: {
setTime(v) { setTime(v) {
this.easySearch.range.value = v this.easySearch.range.value = v;
}, },
//选项卡切换 //选项卡切换
tab(data) { tab(data) {
this.tabIndex = Number(data) + 1 this.tabIndex = Number(data) + 1;
this.easySearch.type.value = this.tabIndex this.easySearch.type.value = this.tabIndex;
this.search() if (this.tabIndex < 4) {
// if (data == 3) { this.search();
// this.show = true }
// } else {
// this.show = false
// }
}, },
search() { search() {
this.$refs.grid.easySearch(this.easySearch) this.$refs.grid.easySearch(this.easySearch);
}, },
//获取所以审核类型 //获取所以审核类型
getSchema() { getSchema() {
Api.getAll().then((r) => { Api.getAll().then(r => {
if (r.success) { if (r.success) {
this.schemaList = r.result this.schemaList = r.result;
} else { } else {
this.$Message.error('加载类型失败') this.$Message.error("加载类型失败");
} }
}) });
}, },
//点击审核或查看 //点击审核或查看
listInfo(schemaId, schemaName, code, id) { listInfo(schemaId, schemaName, code, id) {
console.log(code) console.log(code);
let type = this.returnType(schemaId) let type = this.returnType(schemaId);
this.srcUrl = '' this.srcUrl = "";
this.modalOrderExamine = true this.modalOrderExamine = true;
this.codeTypeName = schemaName this.codeTypeName = schemaName;
this.titleOrderExamine = this.codeTypeName + ' 编号:' + code this.titleOrderExamine = this.codeTypeName + " 编号:" + code;
document.getElementById('mainFrame').contentWindow.location.reload(true) document.getElementById("mainFrame").contentWindow.location.reload(true);
this.srcUrl = this.srcUrl =
'/handle/examine' + type + '?id=' + id + '&statu=' + this.tabIndex "/handle/examine" + type + "?id=" + id + "&statu=" + this.tabIndex;
}, },
//将schameId转为type1、2、3.... //将schameId转为type1、2、3....
returnType(schemaId) { returnType(schemaId) {
let types = 1 let types = 1;
switch (schemaId) { switch (schemaId) {
case '123327da-42b3-41f6-b785-cf933f137a95': //订单送审 case "123327da-42b3-41f6-b785-cf933f137a95": //订单送审
types = 1 types = 1;
break break;
case 'cf192e27-1e81-4000-98ee-392eeb539616': //订单报价 case "cf192e27-1e81-4000-98ee-392eeb539616": //订单报价
types = 2 types = 2;
break break;
case '2085025d-9c38-4834-846a-8f9d2f4c8553': //工艺规程 case "2085025d-9c38-4834-846a-8f9d2f4c8553": //工艺规程
types = 3 types = 3;
break break;
case '0c7f3e21-0cf1-4fb0-8986-95c6fbda406e': //材料消耗单 case "0c7f3e21-0cf1-4fb0-8986-95c6fbda406e": //材料消耗单
types = 4 types = 4;
break break;
case '56a0a52c-4d7f-45b1-8e31-860efcee5c6d': //工艺数据 case "56a0a52c-4d7f-45b1-8e31-860efcee5c6d": //工艺数据
types = 5 types = 5;
break break;
case 'd0cdafe3-2341-4499-a4f5-278ef0f30740': //工艺更改单 case "d0cdafe3-2341-4499-a4f5-278ef0f30740": //工艺更改单
types = 6 types = 6;
break break;
case 'c2e09c9b-02a9-4188-97a6-cdb68d50a64a': //不合格品审理 case "c2e09c9b-02a9-4188-97a6-cdb68d50a64a": //不合格品审理
types = 7 types = 7;
break break;
case '2c921502-41a2-4fa5-b659-71d0e1e19ffc': //生产调节单 case "2c921502-41a2-4fa5-b659-71d0e1e19ffc": //生产调节单
types = 8 types = 8;
break break;
case '207b59eb-4fca-4324-b5cd-46f48a5ff21d': //产品合格证 case "207b59eb-4fca-4324-b5cd-46f48a5ff21d": //产品合格证
types = 9 types = 9;
break break;
case '00875796-7675-4c68-bd4f-47e70764dd9e': //修复文件审批 case "00875796-7675-4c68-bd4f-47e70764dd9e": //修复文件审批
types = 10 types = 10;
break break;
case '9ce046c3-9585-4bd5-992d-1667f60f8e8f': //支撑文件审批 case "9ce046c3-9585-4bd5-992d-1667f60f8e8f": //支撑文件审批
types = 11 types = 11;
break break;
case 'bd2cb81a-d955-4b68-ae67-bcf7f92e8cb8': //切片文件审批 case "bd2cb81a-d955-4b68-ae67-bcf7f92e8cb8": //切片文件审批
types = 12 types = 12;
break break;
default: default:
types = 1 types = 1;
break break;
} }
return types return types;
}, },
cancelModal() { cancelModal() {
this.search() this.search();
}, },
l(key) { l(key) {
let vkey = 'handleList' + '.' + key let vkey = "handleList" + "." + key;
return this.$t(vkey) || key return this.$t(vkey) || key;
} }
} }
} };
</script> </script>
<style lang="less"> <style lang="less">
.ivu-modal-fullscreen-no-footer .ivu-modal-body { .ivu-modal-fullscreen-no-footer .ivu-modal-body {
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<DataGrid <DataGrid
:action="action" :action="action"
:columns="columns" :columns="columns"
:conditions="easySearch"
ref="grid" ref="grid"
@on-selection-change="onSelect" @on-selection-change="onSelect"
:batch="true" :batch="true"
...@@ -114,8 +115,10 @@ export default { ...@@ -114,8 +115,10 @@ export default {
easySearch: { easySearch: {
keys: { keys: {
op: "mesCode,productName", op: "mesCode,productName",
value: null value: null,
} default: true
},
productId: { op: "In", value: "" }
}, },
addModal: false, addModal: false,
editModal: false, editModal: false,
...@@ -303,7 +306,14 @@ export default { ...@@ -303,7 +306,14 @@ export default {
{ {
attrs: { oprate: "edit" }, attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row) }, on: { click: () => this.edit(params.row) },
style: params.row._disabled||params.row.id!=params.row.rootId ? "display:none" : "" style:
(params.row.status == 1 &&
params.row.id == params.row.rootId &&
params.row.divideMark != 0) ||
params.row.id != params.row.rootId ||
params.row.status != 1
? "display:none"
: ""
}, },
"编辑" "编辑"
), ),
...@@ -312,7 +322,14 @@ export default { ...@@ -312,7 +322,14 @@ export default {
{ {
attrs: { oprate: "remove" }, attrs: { oprate: "remove" },
on: { click: () => this.remove(params.row) }, on: { click: () => this.remove(params.row) },
style: params.row._disabled ? "display:none" : "" style:
(params.row.status == 1 &&
params.row.id == params.row.rootId &&
params.row.divideMark != 0) ||
params.row.status != 1
// ||(params.row.id != params.row.rootId && this.sondeletecheck1(params.row.rootId)>0)
? "display:none"
: ""
}, },
"删除" "删除"
), ),
...@@ -321,7 +338,13 @@ export default { ...@@ -321,7 +338,13 @@ export default {
{ {
attrs: { oprate: "detail" }, attrs: { oprate: "detail" },
on: { click: () => this.split(params.row) }, on: { click: () => this.split(params.row) },
style: params.row._disabled&&params.row.status!=1 ? "display:none" : "" style:
(params.row.divideMark != 0 &&
params.row.id == params.row.rootId) ||
params.row.status != 1 ||
params.row.quantity <= 1
? "display:none"
: ""
}, },
"分解" "分解"
) )
...@@ -371,7 +394,8 @@ export default { ...@@ -371,7 +394,8 @@ export default {
metCodesStrTxt: "", metCodesStrTxt: "",
actIds: [], //批量处理时ids actIds: [], //批量处理时ids
actMescodes: [], actMescodes: [],
delNum: 0 delNum: 0, //判断是否可以进行修改
arrayIds: [] //选择列表后的ids
}; };
}, },
created() { created() {
...@@ -560,12 +584,35 @@ export default { ...@@ -560,12 +584,35 @@ export default {
}, },
//确定派发 //确定派发
sendOk() { sendOk() {
this.$refs.orderSplit.$refs["formValidate"].validate(valid => { this.$refs.orderSend.$refs["formValidate"].validate(valid => {
if (valid) { if (valid) {
let objInfo = this.$refs.orderSplit.returnData(); let objInfo = this.$refs.orderSend.returnData();
let params = { let ids = this.arrayIds;
ids: this.delIds let parms = [];
}; ids.forEach(e => {
objInfo.id = e;
parms.push(objInfo);
});
Api.mesorderdistribute(parms)
.then(r => {
if (r.success) {
if (r.result) {
this.$refs.grid.load();
this.sendModal = false;
this.$Message.success("派发成功");
} else {
this.sendModal = false;
this.$Message.error("派发失败");
}
} else {
this.sendModal = false;
this.$Message.error("派发失败");
}
})
.catch(err => {
this.sendModal = false;
this.$Message.error("操作失败");
});
} }
}); });
}, },
...@@ -591,7 +638,7 @@ export default { ...@@ -591,7 +638,7 @@ export default {
let metCodesSingle = []; //没有子订单的订单 let metCodesSingle = []; //没有子订单的订单
let metCodesFather = []; //有子订单的原始订单 let metCodesFather = []; //有子订单的原始订单
this.actIds = []; this.actIds = [];
alert(JSON.stringify(this.rowDataArry)) //alert(JSON.stringify(this.rowDataArry));
if (this.rowDataArry.length > 0) { if (this.rowDataArry.length > 0) {
this.rowDataArry.forEach(data => { this.rowDataArry.forEach(data => {
this.delNum = 0; this.delNum = 0;
...@@ -629,6 +676,19 @@ export default { ...@@ -629,6 +676,19 @@ export default {
this.delNum += 1; this.delNum += 1;
} }
}); });
},
//删除前判断子订单
sondeletecheck1(code) {
let param = { id: code };
let delStaut=0
Api.sondeletecheck(param).then(res => {
if (res.result == 1) {//可以删除
delStaut = 0;
} else {
delStaut = 1;
}
});
return delStaut
}, },
//删除确定 //删除确定
removeOk() { removeOk() {
...@@ -694,7 +754,9 @@ export default { ...@@ -694,7 +754,9 @@ export default {
this.orderSearchForm.productId = "-1"; this.orderSearchForm.productId = "-1";
this.orderSearchForm.productName = ""; this.orderSearchForm.productName = "";
} }
//this.$refs.CustomTable.easySearch(this.orderSearchForm);
this.easySearch.productId.value = this.orderSearchForm.productId;
this.$refs.grid.easySearch();
} }
}, },
//得到此树节点下所有是产品的productId //得到此树节点下所有是产品的productId
...@@ -750,11 +812,11 @@ export default { ...@@ -750,11 +812,11 @@ export default {
//alert(JSON.stringify(a)); //alert(JSON.stringify(a));
//批量选择 //批量选择
let selectRows = a; let selectRows = a;
this.arrPartPkId = []; this.arrayIds = [];
this.rowDataArry = a; this.rowDataArry = a;
// selectRows.forEach(e => { selectRows.forEach(e => {
// this.arrPartPkId.push(e.part_task_pk); this.arrayIds.push(e.id);
// }); });
} }
//list end //list end
} }
......
...@@ -169,10 +169,23 @@ export default { ...@@ -169,10 +169,23 @@ export default {
return objStr; return objStr;
}, },
getTimeProductPFD(value) { getTimeProductPFD(value) {
this.orderForm.ProductingPreparationFinishDate = value; this.orderForm.ProductingPreparationFinishDate = this.getFormatDateEnd(value);
}, },
getTimeQuotationFD(value) { getTimeQuotationFD(value) {
this.orderForm.QuotationFinishDate = value; this.orderForm.QuotationFinishDate = this.getFormatDateEnd(value);
},
getFormatDateEnd(dates) {
const d = new Date(dates);
const resDate =
d.getFullYear() +
"-" +
this.p(d.getMonth() + 1) +
"-" +
this.p(d.getDate())+ " 23:59:59";
return resDate;
},
p(s) {
return s < 10 ? "0" + s : s;
} }
}, },
created() { created() {
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
type="daterange" type="daterange"
placeholder="请选择日期" placeholder="请选择日期"
style="width:240px" style="width:240px"
transfer="true" :transfer="true"
:options="optionsDate" :options="optionsDate"
@on-change="inputOrderCat(row,index)" @on-change="inputOrderCat(row,index)"
></DatePicker> ></DatePicker>
......
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