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 { ...@@ -34,4 +34,7 @@ export default {
listbyid(params){ listbyid(params){
return Api.get(`${material}/documentpropertydefinition/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>
<template> <template>
<div class="myBug"> <div class="myBug">
<Tabs :animated="false" @on-click="tab" value="3"> <Tabs :animated="false" @on-click="tab" value="3">
<TabPane label="我发起的" name="0"></TabPane> <TabPane label="我发起的" name="0"></TabPane>
<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 :columns="columns" ref="grid" :action="action" :conditions="easySearch" :high="false" v-show="tabIndex != 4" :height="gridHeight"> <DataGrid
<template slot="easySearch"> :columns="columns"
<Row style="line-height: 32px; width: 1000px"> ref="grid"
<Col span="5"> :action="action"
<Select v-model="easySearch.schemaId.value" style="width: 200px" clearable placeholder="请选择审批类别" transfer> :conditions="easySearch"
<Option value class="option-text">请选择审批类别</Option> :high="false"
<Option :value="item.id" :label="item.name" :key="index" v-for="(item, index) in schemaList"></Option> v-show="tabIndex != 4"
</Select> :height="gridHeight"
</Col> >
<Col span="10"> <template slot="easySearch">
<DTSearch v-model="easySearch.range.value" @on-change="setTime" type="date"></DTSearch> <Row style="line-height: 32px; width: 1000px">
</Col> <Col span="5">
<Col span="9"> <Select
<Input search enter-button placeholder="请输入编号" @on-search="search" v-model="easySearch.keys.value" /> v-model="easySearch.schemaId.value"
</Col> style="width: 200px"
</Row> clearable
</template> placeholder="请选择审批类别"
transfer
>
<Option value class="option-text">请选择审批类别</Option>
<Option
:value="item.id"
:label="item.name"
:key="index"
v-for="(item, index) in schemaList"
></Option>
</Select>
</Col>
<Col span="10">
<DTSearch
v-model="easySearch.range.value"
@on-change="setTime"
type="date"
></DTSearch>
</Col>
<Col span="9">
<Input
search
enter-button
placeholder="请输入编号"
@on-search="search"
v-model="easySearch.keys.value"
/>
</Col>
</Row>
</template>
</DataGrid> </DataGrid>
<!-- 审批modal --> <!-- 审批modal -->
<Modal v-model="modalOrderExamine" :title="titleOrderExamine" footer-hide fullscreen @on-cancel="cancelModal"> <Modal
<iframe width="100%" id="mainFrame" :height="iframeHeight" frameborder="0" :src="srcUrl"></iframe> v-model="modalOrderExamine"
:title="titleOrderExamine"
footer-hide
fullscreen
@on-cancel="cancelModal"
>
<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,
}, },
data() { data() {
return { return {
show: false, show: false,
action: Api.index, action: Api.index,
easySearch: { easySearch: {
type: { type: {
op: "Equal", op: "Equal",
value: 1 value: 1,
}, // 1我发起的 2待我审批的 3 我已审批的 }, // 1我发起的 2待我审批的 3 我已审批的
keys: { keys: {
op: "code", op: "code",
value: "" value: "",
}, },
schemaId: { schemaId: {
op: "Equal", op: "Equal",
value: null value: null,
}, //审批类别 }, //审批类别
range: { range: {
op: "Range", op: "Range",
value: null value: null,
}, },
}, },
schemaList: [], schemaList: [],
results: [], results: [],
footerBar: false, footerBar: false,
modalInfo: false, modalInfo: false,
tabIndex: 4, tabIndex: 4,
columns: [{ columns: [
key: "id", {
width: 80, key: "id",
title: this.l("id"), width: 80,
hide: true, title: this.l("id"),
}, hide: true,
{ },
key: "code", {
width: 240, key: "code",
title: this.l("code"), width: 240,
}, title: this.l("code"),
{ },
title: this.l("schemaId"), {
key: "schemaId", title: this.l("schemaId"),
hide: true, key: "schemaId",
}, hide: true,
{ },
title: this.l("status"), {
key: "status", title: this.l("status"),
align: "center", key: "status",
width: 120, align: "center",
high: true, width: 120,
code: "Handle.todoList.status", high: true,
}, code: "Handle.todoList.status",
{
title: this.l("creator"),
key: "creatorUserId",
type: "user"
},
{
title: this.l("creationTime"),
key: "creationTime",
align: "center",
},
{
title: this.l("schemaName"),
key: "schemaName",
},
// {
// title: this.l('status'),
// key: 'status',
// hide: true
// },
{
title: this.l("startRecordId"),
key: "startRecordId",
hide: true,
},
{
title: this.l("currentNodeId"),
key: "currentNodeId",
hide: true,
},
{
title: this.l("currentNodeName"),
key: "currentNodeName",
},
{
title: this.l("nextNodeId"),
key: "nextNodeId",
hide: true,
},
{
title: this.l("nextNodeName"),
key: "nextNodeName",
},
{
title: "操作",
align: "center",
render: (h, params) => {
return h("div", {
class: "action"
}, [
h(
"op", {
attrs: {
oprate: "detail",
title: this.tabIndex == 2 ? "审核" : "查看",
},
on: {
click: () => {
this.listInfo(
params.row.schemaId,
params.row.schemaName,
params.row.code,
params.row.id
);
},
},
},
this.tabIndex == 2 ? "审核" : "查看"
),
]);
},
},
],
codeTypeName: "", //审核类型
gridHeight: "",
//订单审核开始
modalOrderExamine: false,
srcUrl: "",
iframeHeight: "",
titleOrderExamine: "",
OrderExamine: "",
//订单审核结束
};
},
created() {
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();
},
computed: {},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
setTime(v) {
this.easySearch.range.value = v;
}, },
//选项卡切换 {
tab(data) { title: this.l("creator"),
this.tabIndex = Number(data) + 1; key: "creatorUserId",
this.easySearch.type.value = this.tabIndex; type: "user",
if (this.tabIndex < 4) {
this.search();
}
}, },
search() { {
this.$refs.grid.easySearch(this.easySearch); title: this.l("creationTime"),
key: "creationTime",
align: "center",
}, },
//获取所以审核类型 {
getSchema() { title: this.l("schemaName"),
Api.getAll().then((r) => { key: "schemaName",
if (r.success) {
this.schemaList = r.result;
} else {
this.$Message.error("加载类型失败");
}
});
}, },
//点击审核或查看 // {
listInfo(schemaId, schemaName, code, id) { // title: this.l('status'),
console.log(code); // key: 'status',
let type = this.returnType(schemaId); // hide: true
this.srcUrl = ""; // },
this.modalOrderExamine = true; {
this.codeTypeName = schemaName; title: this.l("startRecordId"),
this.titleOrderExamine = this.codeTypeName + " 编号:" + code; key: "startRecordId",
document.getElementById("mainFrame").contentWindow.location.reload(true); hide: true,
this.srcUrl =
"/handle/examine" + type + "?id=" + id + "&statu=" + this.tabIndex;
}, },
//将schameId转为type1、2、3.... {
returnType(schemaId) { title: this.l("currentNodeId"),
console.log(schemaId); key: "currentNodeId",
let types = 1; hide: true,
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 "b6303ddc-8b5e-40a3-a51b-294657d1d913": //物料审批
types = 13;
break;
default:
types = 14;
break;
}
return types;
}, },
cancelModal() { {
this.search(); title: this.l("currentNodeName"),
key: "currentNodeName",
}, },
l(key) { {
let vkey = "handleList" + "." + key; title: this.l("nextNodeId"),
return this.$t(vkey) || key; key: "nextNodeId",
hide: true,
}, },
{
title: this.l("nextNodeName"),
key: "nextNodeName",
},
{
title: "操作",
align: "center",
render: (h, params) => {
return h(
"div",
{
class: "action",
},
[
h(
"op",
{
attrs: {
oprate: "detail",
title: this.tabIndex == 2 ? "审核" : "查看",
},
on: {
click: () => {
this.listInfo(
params.row.schemaId,
params.row.schemaName,
params.row.code,
params.row.id
);
},
},
},
this.tabIndex == 2 ? "审核" : "查看"
),
]
);
},
},
],
codeTypeName: "", //审核类型
gridHeight: "",
//订单审核开始
modalOrderExamine: false,
srcUrl: "",
iframeHeight: "",
titleOrderExamine: "",
OrderExamine: "",
//订单审核结束
};
},
created() {
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();
},
computed: {},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
setTime(v) {
this.easySearch.range.value = v;
},
//选项卡切换
tab(data) {
this.tabIndex = Number(data) + 1;
this.easySearch.type.value = this.tabIndex;
if (this.tabIndex < 4) {
this.search();
}
},
search() {
this.$refs.grid.easySearch(this.easySearch);
},
//获取所以审核类型
getSchema() {
Api.getAll().then((r) => {
if (r.success) {
this.schemaList = r.result;
} else {
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);
this.srcUrl =
"/handle/examine" + type + "?id=" + id + "&statu=" + this.tabIndex;
},
//将schameId转为type1、2、3....
returnType(schemaId) {
console.log(schemaId);
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 "b6303ddc-8b5e-40a3-a51b-294657d1d913": //物料审批
types = 13;
break;
case "39cbf6c0-72c7-4e22-8f00-6d3b0512dd1d": //项目审批
types = 15;
break;
default:
types = 14; //文档
break;
}
return types;
},
cancelModal() {
this.search();
},
l(key) {
let vkey = "handleList" + "." + 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 {
padding: 0px; padding: 0px;
} }
</style> </style>
<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 { ...@@ -25,5 +25,8 @@ export default {
}, },
deletes(params) { deletes(params) {
return Api.post(`${material}/projectmain/batchdelete`,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 @@ ...@@ -131,7 +131,7 @@
footer-hide footer-hide
:mask-closable="false" :mask-closable="false"
> >
<FilesViewer :parms="parms"/> <FilesViewer :parms="parms" />
<!-- <FilesView ref="refFile" :parms="parms" /> --> <!-- <FilesView ref="refFile" :parms="parms" /> -->
</Modal> </Modal>
</div> </div>
...@@ -343,7 +343,7 @@ export default { ...@@ -343,7 +343,7 @@ export default {
title: "操作", title: "操作",
key: "action", key: "action",
width: 160, width: 160,
align: "center", // align: "center",
render: (h, params) => { render: (h, params) => {
return h("div", { class: "action" }, [ return h("div", { class: "action" }, [
// h( // h(
...@@ -371,6 +371,18 @@ export default { ...@@ -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 { ...@@ -394,6 +406,14 @@ export default {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { 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) { formatFun(data) {
data.map((e) => { 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