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

物料

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