Commit 79d5c600 authored by renjintao's avatar renjintao

Merge branch 'master' of git.mes123.com:zhouyx/mes-ui into product-rjt

parents 3081981e 6f4108de
......@@ -34,4 +34,7 @@ export default {
listbyid(params){
return Api.get(`${material}/documentpropertydefinition/listbyid`,params);
},
users(params){//项目成员
return Api.post(`${material}/projectgroupuser/list`,params);
},
}
\ No newline at end of file
<template>
<div class="new-detail det">
<Row>
<Col span="20">
<div>
<Row>
<Filed :span="8" :name="l('title') + ':'">{{
entity.title
}}</Filed>
<Filed :span="8" :name="l('state') + ':'">
<state code="project.main.state" :value="entity.state" />
</Filed>
<!-- <Filed :span="12" :name="l('phase')">{{ entity.phase }}</Filed> -->
<Filed :span="8" :name="l('date') + ':'">
<DateRange v-model="entity" />
</Filed>
<Filed :span="8" :name="l('creationTime') + ':'">{{
entity.creationTime
}}</Filed>
<Filed :span="8" :name="l('creatorUserId') + ':'">
<User :value="entity.creatorUserId" />
</Filed>
<Filed :span="8" :name="l('type') + ':'">
<state code="project.main.type" :value="entity.type" />
</Filed>
<Filed :span="24" :name="l('users') + ':'">
<User
v-for="(u, i) in users"
:value="u.userId"
:key="u.userId"
mode="text"
class="mr10"
/>
</Filed>
<Filed :span="24" :name="l('note') + ':'">{{ entity.note }}</Filed>
<Filed :span="24" :name="l('attachment')">
<FilesView ref="refFile" :parms="parms" />
<!-- <files
ref="refFile"
:parms="parms"
fileFormat
:showList="false"
/> -->
</Filed>
</Row>
</div>
</Col>
<Col span="4" class="dcm-right">
<div class="img-touxiang">
<Pictrue :src="avatorPath" v-if="avatorPath" />
<img
src="@/assets/images/files_header.png"
v-else
width="100%"
height="100%"
/>
</div>
</Col>
</Row>
</div>
</template>
<script>
import Api from "../api";
export default {
name: "detail",
components: {},
props: {
idVal: {
type: String,
default: "",
},
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
data() {
return {
entity: {
state: "",
},
avatorPath: "",
users: [],
parms: {
app: "material",
eid: null,
name: "",
field: "",
},
};
},
created() {
this.dataImmut = [];
this.dataMut = [];
this.parms.eid = this.$u.guid();
Api.get({ Id: this.idVal }).then((r) => {
if (r.success) {
this.entity = JSON.parse(r.result.formData);
this.avatorPath = this.entity.picture;
this.parms.eid = this.entity.attachment;
let params = {
conditions: [
{
fieldName: "projectId",
fieldValue: this.entity.id,
conditionalType: "Equal",
},
],
};
Api.users(params).then((r) => {
if (r.success) {
this.users = r.result;
}
});
} else {
this.$Message.error("加载失败");
}
});
},
methods: {
load(v) {},
l(key) {
key = "project_main" + "." + key;
return this.$t(key);
},
},
watch: {},
};
</script>
<style lang="less" >
.det {
.files-view {
min-height: 100px;
}
}
</style>
\ No newline at end of file
<template>
<div style="padding: 30px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'" style="text-align: left">
<Form
:model="formMyCheck"
:label-width="100"
:rules="ruleValidate"
inline
ref="formValidate"
>
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width: 200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem
label="驳回节点:"
v-if="formMyCheck.radioSp === '驳回'"
prop="rejectToNodeId"
>
<Select
style="width: 200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width: 400px; margin-left: 10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align: right; padding-right: 40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<Modal
v-model="modalCheckNo"
title="项目审批"
width="800"
:scrollable="true"
>
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此项目审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</template>
<script>
import Api from "../api";
import Detail from "./detail";
import Process from "../process";
export default {
layout: "empty",
name: "Index",
components: {
Detail,
Process,
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: "通过",
comment: "",
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: "", //设备
materialWeight: 0, //材料重量
rejectToNodeId: null,
},
modalCheckOk: false,
modalCheckNo: false,
detailId: null,
statuTitle: "",
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj: {},
ruleValidate: {
rejectToNodeId: [
{
required: true,
message: "请选择驳回节点",
type: "number",
trigger: "change",
},
],
comment: [
{
required: true,
message: "请输入原因",
trigger: "blur",
},
],
},
};
},
props: {},
async fetch({ store, params }) {
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);
},
methods: {
nextCheckOk() {
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 = "驳回";
} else {
}
});
} else {
this.$refs["formValidate"].validate((valid) => {
if (valid) {
this.modalCheckNo = true;
this.statuTitle = "终止";
} else {
}
});
}
},
getDetailInfos(idVal) {
this.getDetailRecords = [];
let param = {
Id: idVal,
};
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);
} else {
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);
});
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value;
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
(item) => item.value == this.currentNodeID
);
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value;
} else {
this.preNodeID = this.nodeList[0].value;
}
},
changeToNode(val) {
if (val == "1") {
this.formMyCheck.rejectToNodeId = this.preNodeID;
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID;
}
},
//审批通过
checkOk() {
// alert(this.passId)
let param = {
id: this.passId,
comment: "",
nextOperationIdList: this.nextNodeUserIdList,
data: {},
};
// alert(JSON.stringify(param))
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success("审批通过成功");
this.$refs.userProcess.load(this.detailId);
this.modalCheckNo = false;
} else {
this.$Message.error("审批通过失败");
this.modalCheckNo = true;
}
});
},
//审批驳回
checkNo() {
// alert(this.passId)
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId,
};
// alert(JSON.stringify(param))
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success("驳回审批成功");
this.$refs.userProcess.load(this.detailId);
this.modalCheckNo = false;
} else {
this.$Message.error("加载失败");
this.modalCheckNo = true;
}
});
},
//审批终止
checkCancel() {
// alert(this.passId)
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
};
//alert(JSON.stringify(param))
Api.terminate(param).then((r) => {
if (r.success) {
this.$Message.success("终止审批成功");
this.$refs.userProcess.load(this.detailId);
this.modalCheckNo = false;
} else {
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();
}
this.footerStatu = 3;
},
l(key) {
key = "OrderDataReview" + "." + key;
return this.$t(key);
},
},
watch: {},
};
</script>
This diff is collapsed.
<template>
<div class="flex">
<div v-width="300">
<h2>
{{files.length}}
</h2>
<ul>
<li v-for="li in files" @click="load(li)">
{{li}}
</li>
</ul>
<Table :columns="column" :data="data"></Table>
</div>
<div class="fg" v-html="txt">
</div>
</div>
</template>
<script>
const indexFiles = require.context(`./`, true, /\.vue$/)
// const fs = require('fs')
export default {
name: '',
layout:'empty',
data() {
return {
files:[],
txt:"",
}
},
mounted(){
this.files=indexFiles.keys();
console.log("vvv",this.files)
},
methods:{
load(f){
// fs.readFile('map.vue',(e,d)=>{
// if(!e){
// this.txt=d.toString();
// }else{
// this.txt="Erro!"
// }
// })
}
}
}
</script>
<style lang="less">
</style>
\ No newline at end of file
......@@ -25,5 +25,8 @@ export default {
},
deletes(params) {
return Api.post(`${material}/projectmain/batchdelete`,params);
}
},
batchstart(params) {
return Api.post(`${workflowUrl}/instance/batchstart`, params); //送审
},
}
\ No newline at end of file
......@@ -131,7 +131,7 @@
footer-hide
:mask-closable="false"
>
<FilesViewer :parms="parms"/>
<FilesViewer :parms="parms" />
<!-- <FilesView ref="refFile" :parms="parms" /> -->
</Modal>
</div>
......@@ -343,7 +343,7 @@ export default {
title: "操作",
key: "action",
width: 160,
align: "center",
// align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
// h(
......@@ -371,6 +371,18 @@ export default {
},
"删除"
),
h(
"op",
{
attrs: {
oprate: "edit",
},
on: {
click: () => this.send(params.row),
},
},
params.row.state == 1 ? "送审" : ""
),
]);
},
},
......@@ -394,6 +406,14 @@ export default {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
send(row) {
this.fullscreen = true;
this.curId = row.id;
this.rootCategoryId = row.rootCategoryId;
this.title = "项目送审";
this.detail = () => import("./submit");
this.modal = true;
},
//格式化原始数据
formatFun(data) {
data.map((e) => {
......
<template>
<div class="bom">
<Row class="row-filed">
<Col span="20">
<div class="new-detail">
<Row>
<Filed :span="8" :name="l('title') + ':'">{{
entity.title
}}</Filed>
<Filed :span="8" :name="l('state') + ':'">
<state code="project.main.state" :value="entity.state" />
</Filed>
<!-- <Filed :span="12" :name="l('phase')">{{ entity.phase }}</Filed> -->
<Filed :span="8" :name="l('date') + ':'">
<DateRange v-model="entity" />
</Filed>
<Filed :span="8" :name="l('creationTime') + ':'">{{
entity.creationTime
}}</Filed>
<Filed :span="8" :name="l('creatorUserId') + ':'">
<User :value="entity.creatorUserId" />
</Filed>
<Filed :span="8" :name="l('type') + ':'">
<state code="project.main.type" :value="entity.type" />
</Filed>
<Filed :span="24" :name="l('users') + ':'">
<User
v-for="(u, i) in users"
:value="u.userId"
:key="u.userId"
mode="text"
class="mr10"
/>
</Filed>
<Filed :span="24" :name="l('note') + ':'">{{ entity.note }}</Filed>
<Filed :span="24" :name="l('attachment')">
<FilesView ref="refFile" :parms="parms" />
<!-- <files
ref="refFile"
:parms="parms"
fileFormat
:showList="false"
/> -->
</Filed>
</Row>
</div>
</Col>
<Col span="4" class="dcm-right">
<div class="img-touxiang">
<Pictrue :src="avatorPath" v-if="avatorPath" />
<img
src="@/assets/images/files_header.png"
v-else
width="100%"
height="100%"
/>
</div>
</Col>
</Row>
<div class="table-r">
<Process
ref="userProcess"
schemaIdVal="39cbf6c0-72c7-4e22-8f00-6d3b0512dd1d"
/>
</div>
<div slot="footer">
<Button @click="modalInfo">取消</Button>
<Button type="primary" @click="upSave">确定送审</Button>
</div>
<!-- 信息提示 -->
<Modal
v-model="ModalInfo"
title="信息提示"
width="600"
:mask-closable="false"
:scrollable="true"
ok-text="确定"
cancel-text="取消"
>
<!-- {{ metCodesStrTxt }} -->
<p>
<span>您确定送审此:</span
><span class="sub-title">{{ entity.title }}</span> {{ metCodesStrTxt }}
</p>
<div slot="footer">
<Button @click="ModalInfo = false">取消</Button>
<Button type="primary" @click="modalInfoOk">确定</Button>
</div>
</Modal>
</div>
</template>
<script>
import Api from "./api";
import Process from "@/components/orderOperator/process";
export default {
components: {
Process,
},
data() {
return {
curId: this.eid,
avatorPath: "",
entity: {},
users: [],
ModalInfo: false,
metCodesStrTxt: "",
dataList: [],
dataListRetrun: [], //确定后返回数据
dataListRetrunNew: {
schemaId: "39cbf6c0-72c7-4e22-8f00-6d3b0512dd1d", //合格证流程id:schemaId
idList: [], //合格证id List
codeList: [], //合格证编号List
operatorIdList: [], //操作员id
}, //确定后返回数据
parms: {
app: "material",
eid: null,
name: "",
field: "",
},
};
},
props: ["eid"],
mounted() {
if (this.eid) {
this.load(this.eid);
}
this.parms.eid = this.$u.guid();
},
methods: {
load(v) {
Api.get({
id: v,
}).then((r) => {
this.entity = r.result;
this.entity.type = r.result.type + "";
this.entity.state = r.result.state + "";
this.avatorPath = r.result.picture;
this.parms.eid = r.result.attachment;
this.$emit("on-load");
});
this.loadUsers();
},
loadUsers() {
let params = {
conditions: [
{
fieldName: "projectId",
fieldValue: this.eid,
conditionalType: "Equal",
},
],
};
Api.users(params).then((r) => {
if (r.success) {
this.users = r.result;
}
});
},
upSave() {
this.dataListRetrunNew.idList = [];
this.dataListRetrunNew.codeList = [];
let codeList = [];
let idList = [];
if (this.eid !== 0) {
codeList.push(this.eid);
// if (this.entity.code != 0) {
// codeList.push(this.entity.code);
// } else {
// codeList.push(this.eid);
// }
idList.push(this.eid);
} else {
// this.rowsTable.forEach((e) => {
// idList.push(e.id);
// if (e.code) {
// codeList.push(e.code);
// } else {
// codeList.push(e.id);
// }
// });
}
this.dataListRetrunNew.idList = idList;
this.dataListRetrunNew.codeList = codeList;
let metCodesStr = JSON.stringify(codeList)
.replace("[", "")
.replace("]", "")
.replace(/\"/g, "");
this.ModalInfoStaut = "orderSendReview";
this.metCodesStrTxt = "项目吗?";
this.ModalInfo = true;
},
modalInfoOk() {
let ues = this.$refs.userProcess;
this.dataListRetrunNew.operatorIdList = ues.immutData;
Api.batchstart(this.dataListRetrunNew).then((r) => {
if (r.success) {
this.ModalInfo = false;
this.$Message.success("送审成功");
this.$emit("on-close");
this.$emit("on-ok");
}
});
},
modalInfo() {
this.$emit("on-close");
},
l(key) {
key = "project_main" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
},
},
};
</script>
<style lang="less">
.bom {
.row-filed {
box-shadow: 0 0 6px 2px #ccc;
padding: 15px;
border-radius: 5px;
.files-view {
min-height: 100px;
}
.label {
font-weight: bold;
height: 30px;
}
.value {
margin-bottom: 10px;
}
.upload-body {
border: none;
// height: 66px;
// overflow: auto;
.demo-upload-list {
margin-top: 0;
margin: 0 2px;
}
}
.ivu-divider-inner-text {
font-weight: bold;
font-size: 14px;
}
}
.table-r {
margin: 20px 0;
box-shadow: 0 0 6px 2px #ccc;
padding: 1px 25px 0 25px;
min-height: 350px;
border-radius: 5px;
.mb10 {
float: right;
margin-bottom: 10px;
}
}
}
.sub-title {
color: red;
}
</style>
\ No newline at end of file
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