Commit 8c1db422 authored by 仇晓婷's avatar 仇晓婷

物料

parent 6ea0649c
<template>
<div class="new-detail" style="width:90%;margin:0 auto">
<Row>
<Filed :span="8" name="编码:">{{entity.code}}</Filed>
<Filed :span="8" name="编码:">{{!entity.code?'未分配':entity.code}}</Filed>
<Filed :span="8" name="名称:">{{entity.name}}</Filed>
<Filed :span="8" name="状态:">
<State code="materail.category.status" :value="parseInt(entity.status)" />
......@@ -15,8 +15,13 @@
<State v-if="li.dataType==3" :code="li.note" :value="entity[li.field]" />
<div v-else-if="li.dataType==8">{{entity[li.field]}}</div>
<div v-else-if="li.dataType==5" v-html="entity[li.field]"></div>
<DTSpan v-else-if="li.dataType==4" :value="entity[li.field]" />
<span v-else>{{entity[li.field]}}</span>
<span v-if="li.unitName" v-text="li.unitName" class="ml10"></span>
<State
v-if="li.unitName&&(li.dataType==1||li.dataType==2)"
:code="li.note"
:value="entity[li.field]"
/>
</Filed>
</Row>
</div>
......
......@@ -56,7 +56,7 @@
</Form>
</div>
<Modal v-model="modalCheckNo" title="切片文件审批" width="800" :scrollable="true">
<Modal v-model="modalCheckNo" title="物料审批" width="800" :scrollable="true">
<br />
<h4>
您确定
......@@ -71,13 +71,13 @@
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
import Api from "../api";
import Detail from "./detail";
import Process from "../process";
export default {
layout: 'empty',
name: 'Index',
layout: "empty",
name: "Index",
components: {
Detail,
Process
......@@ -86,18 +86,18 @@ export default {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
radioSp: "通过",
comment: "",
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
equipment: "", //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
modalCheckOk: false,
modalCheckNo: false,
detailId: null,
statuTitle: '',
statuTitle: "",
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
......@@ -114,97 +114,98 @@ export default {
rejectToNodeId: [
{
required: true,
message: '请选择驳回节点',
type: 'number',
trigger: 'change'
message: "请选择驳回节点",
type: "number",
trigger: "change"
}
],
comment: [
{
required: true,
message: '请输入原因',
trigger: 'blur'
message: "请输入原因",
trigger: "blur"
}
]
}
}
};
},
props: {},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
await store.dispatch("loadDictionary"); // 加载数据字典
},
created() {
this.currentUserId=this.$store.state.userInfo.userId
this.detailId = this.$http.common.getquerystring('id')
this.footerStatu = this.$http.common.getquerystring('statu')
this.getDetailInfos(this.detailId)
this.currentUserId = this.$store.state.userInfo.userId;
this.detailId = this.$http.common.getquerystring("id");
this.footerStatu = this.$http.common.getquerystring("statu");
this.getDetailInfos(this.detailId);
},
methods: {
nextCheckOk() {
if (this.formMyCheck.radioSp == '通过') {
this.modalCheckNo = true
} else if (this.formMyCheck.radioSp == '驳回') {
this.$refs['formValidate'].validate((valid) => {
if (this.formMyCheck.radioSp == "通过") {
this.statuTitle = "通过";
this.modalCheckNo = true;
} else if (this.formMyCheck.radioSp == "驳回") {
this.$refs["formValidate"].validate(valid => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '驳回'
this.modalCheckNo = true;
this.statuTitle = "驳回";
} else {
}
})
});
} else {
this.$refs['formValidate'].validate((valid) => {
this.$refs["formValidate"].validate(valid => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '终止'
this.modalCheckNo = true;
this.statuTitle = "终止";
} else {
}
})
});
}
},
getDetailInfos(idVal) {
this.getDetailRecords = []
this.getDetailRecords = [];
let param = {
Id: idVal
}
Api.getdetail(param).then((r) => {
this.testObj = r
};
Api.getdetail(param).then(r => {
this.testObj = r;
if (r.success) {
this.currentNodeID = r.result.currentNodeId
this.passId=r.result.currentRecordId
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人
this.getNodes(r.result.nodes)
this.currentNodeID = r.result.currentNodeId;
this.passId = r.result.currentRecordId;
this.nextNodeUserIdList = this.$refs.userProcess.immutData; //获取下一节点的审核人
this.getNodes(r.result.nodes);
} else {
this.$Message.error('加载失败')
this.$Message.error("加载失败");
}
})
});
},
//获取流程节点
getNodes(nodes) {
this.nodeList = []
nodes.forEach((data) => {
let nodeObj = {}
nodeObj.value = data.id
nodeObj.label = data.name
nodeObj.statu = 1
this.nodeList.push(nodeObj)
})
this.nodeList = [];
nodes.forEach(data => {
let nodeObj = {};
nodeObj.value = data.id;
nodeObj.label = data.name;
nodeObj.statu = 1;
this.nodeList.push(nodeObj);
});
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value
this.firstNodeID = this.nodeList[0].value;
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
(item) => item.value == this.currentNodeID
)
item => item.value == this.currentNodeID
);
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value
this.preNodeID = this.nodeList[index - 1].value;
} else {
this.preNodeID = this.nodeList[0].value
this.preNodeID = this.nodeList[0].value;
}
},
changeToNode(val) {
if (val == '1') {
this.formMyCheck.rejectToNodeId = this.preNodeID
if (val == "1") {
this.formMyCheck.rejectToNodeId = this.preNodeID;
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID
this.formMyCheck.rejectToNodeId = this.firstNodeID;
}
},
//审批通过
......@@ -212,20 +213,20 @@ export default {
// alert(this.passId)
let param = {
id: this.passId,
comment: '',
comment: "",
nextOperationIdList: this.nextNodeUserIdList,
data: {}
}
};
// alert(JSON.stringify(param))
Api.pass(param).then((r) => {
Api.pass(param).then(r => {
if (r.success) {
this.$Message.success('审批通过成功')
this.modalCheckNo = false
this.$Message.success("审批通过成功");
this.modalCheckNo = false;
} else {
this.$Message.error('审批通过失败')
this.modalCheckNo = true
this.$Message.error("审批通过失败");
this.modalCheckNo = true;
}
})
});
},
//审批驳回
checkNo() {
......@@ -234,17 +235,17 @@ export default {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
};
// alert(JSON.stringify(param))
Api.reject(param).then((r) => {
Api.reject(param).then(r => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.modalCheckNo = false
this.$Message.success("驳回审批成功");
this.modalCheckNo = false;
} else {
this.$Message.error('加载失败')
this.modalCheckNo = true
this.$Message.error("加载失败");
this.modalCheckNo = true;
}
})
});
},
//审批终止
checkCancel() {
......@@ -252,34 +253,34 @@ export default {
let param = {
id: this.passId,
comment: this.formMyCheck.comment
}
};
//alert(JSON.stringify(param))
Api.terminate(param).then((r) => {
Api.terminate(param).then(r => {
if (r.success) {
this.$Message.success('终止审批成功')
this.modalCheckNo = false
this.$Message.success("终止审批成功");
this.modalCheckNo = false;
} else {
this.$Message.error('加载失败')
this.modalCheckNo = true
this.$Message.error("加载失败");
this.modalCheckNo = true;
}
})
});
},
//终止或驳回
checkFalse() {
if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
} else if (this.formMyCheck.radioSp == '终止') {
this.checkCancel()
} else if (this.formMyCheck.radioSp == '通过') {
this.checkOk()
if (this.formMyCheck.radioSp == "驳回") {
this.checkNo();
} else if (this.formMyCheck.radioSp == "终止") {
this.checkCancel();
} else if (this.formMyCheck.radioSp == "通过") {
this.checkOk();
}
this.footerStatu = 3
this.footerStatu = 3;
},
l(key) {
key = 'OrderDataReview' + '.' + key
return this.$t(key)
key = "OrderDataReview" + "." + key;
return this.$t(key);
}
},
watch: {}
}
};
</script>
......@@ -283,7 +283,7 @@ export default {
.replace("]", "")
.replace(/\"/g, "");
this.ModalInfoStaut = "orderSendReview";
this.metCodesStrTxt = "确定送审此物料 " + metCodesStr + "?";
this.metCodesStrTxt = "确定送审此物料吗? ";
this.ModalInfo = true;
},
modalInfoOk() {
......
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