Commit a571d877 authored by renjintao's avatar renjintao

mesplan order handel

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