Commit a917e12f authored by renjintao's avatar renjintao

工艺规程/智能排产/物料管理/datagrid......

parent abc532dd
......@@ -519,9 +519,9 @@ export default {
const filterVal = []; //list里对象的属性
var tempCol = [];
var tempCol1 = [];
var columnsCur = this.$u.clone(this.columnsNow); //导出列标题信息griddata this.$refs.grid.columnsCur
var columnsCur = this.$u.clone(this.columnsCur); //导出列标题信息griddata this.$refs.grid.columnsCur
columnsCur.forEach((el) => {
if ((el.hide && !el.import) || (!el.hide && el.key != "action" && el.type != "selection" && el.key != "ico")) {
if ((el.hide && el.import) || (!el.hide && el.key != "action" && el.type != "selection" && el.key != "ico")) {
if (el.code) {
tempCol.push({
key: el.key,
......
......@@ -215,12 +215,13 @@ export default {
useData.forEach(eles => {
//如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id
if (
eles.departmentTitle &&
eles.departmentTitle != "" &&
[(eles.departmentTitle &&
eles.departmentTitle != "") || (eles.departmentName &&
eles.departmentName != "")] &&
(!eles.departmentId || eles.departmentId == "")
) {
this.departArr.forEach((e) => {
if (eles.departmentTitle && eles.departmentTitle == e.name) {
if ((eles.departmentTitle && eles.departmentTitle == e.name) || (eles.departmentName && eles.departmentName == e.name)) {
eles.departmentId = e.id;
}
});
......@@ -228,14 +229,16 @@ export default {
//如果导入文件没有departmentTitle,但存在departmentid的话,通过id获取departmentTitle
eles.departmentId &&
eles.departmentId + "" != "" &&
(!eles.departmentTitle || eles.departmentTitle == "")
(!eles.departmentTitle || eles.departmentTitle == "") && (!eles.departmentName || eles.departmentName == "")
) {
this.departArr.forEach((e) => {
if (eles.departmentId && eles.departmentId == e.id) {
eles.departmentTitle = e.name;
eles.departmentName = e.name;
}
});
}
arrTitleUse.forEach((elem) => {
if (eles[elem.key] && eles[elem.key] != "" && eles[elem.key] != null) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值
......
<template>
<Select v-model="dep" :placeholder="placeholdeinfo" clearable @on-clear="onClear">
<Option
v-for="(item,index) in list"
:key="index"
:value="item.value"
style="display:none"
:label="item.label"
></Option>
<template>
<Select v-model="dep" :placeholder="placeholdeinfo" clearable @on-clear="onClear">
<Option v-for="(item,index) in list" :key="index" :value="item.value" style="display:none" :label="item.label"></Option>
<Tree key="mytree" :data="data1" ref="mytree" :render="renderContent"></Tree>
</Select>
</Select>
</template>
<script>
<script>
export default {
name: "Add",
model: {
......@@ -59,7 +54,10 @@ export default {
this.selectdata = data;
if (data[0].isProduct == "1") {
this.list = [];
this.list.push({ label: data[0].title, value: data[0].id });
this.list.push({
label: data[0].title,
value: data[0].id
});
this.orderSearchForm.productName = data[0].title;
this.orderSearchForm.productId = data[0].productId;
this.orderSearchForm.drawingNo = data[0].drawingNo;
......@@ -97,7 +95,11 @@ export default {
}
});
},
renderContent(h, { root, node, data }) {
renderContent(h, {
root,
node,
data
}) {
let type = "md-folder";
let title = data.title;
if (data.isProduct != 0) {
......@@ -114,8 +116,7 @@ export default {
}
//渲染树的样式
return h(
"span",
{
"span", {
on: {
click: () => {
let arrTree = [];
......@@ -134,8 +135,7 @@ export default {
}
}),
h(
"span",
{
"span", {
style: {
color: data.isProduct == 0 ? "#000" : "rgba(38, 128, 235, 1)"
}
......@@ -171,7 +171,10 @@ export default {
dataTemp.forEach(data => {
if (data.isProduct == 1 && data.id == this.dep) {
this.placeholdeinfo = data.title;
this.list.push({ label: data.title, value: data.id });
this.list.push({
label: data.title,
value: data.id
});
}
});
}
......
......@@ -1173,10 +1173,11 @@ export default {
code: '工艺文件编号',
productId: '产品id',
productName: '产品名称',
productBomId: '产品BomId',
drawingNo: '图号',
version: '版本',
author: '编制人',
departmentId: '主制车间',
departmentId: '主制车间Id',
departmentName: '主制车间',
isMain: '主工艺',
upId: '父工艺',
......@@ -1186,8 +1187,8 @@ export default {
approvalStatus: '审批状态',
remark: '工艺说明',
approvalStatusRemark: '审批备注',
auditUserId1: '审批人',
auditUserId2: '审批人',
auditUserId1: '审批人1',
auditUserId2: '审批人2',
isDeleted: '是否删除',
platesnum: '板数',
isEffect: '有效',
......
......@@ -6,6 +6,7 @@
<Search />
</template>
<template slot="buttons">
应用规则:
<Select v-model="rulesAi" multiple style="width:280px;" class="tl">
<Option v-for="item in rulesAiList" :value="item.value" :key="item.value">{{ item.label }}</Option>
</Select>
......
......@@ -678,12 +678,13 @@ export default {
useData.forEach(eles => {
//如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id
if (
eles.departmentTitle &&
eles.departmentTitle != "" &&
[(eles.departmentTitle &&
eles.departmentTitle != "") || (eles.departmentName &&
eles.departmentName != "")] &&
(!eles.departmentId || eles.departmentId == "")
) {
this.departArr.forEach((e) => {
if (eles.departmentTitle && eles.departmentTitle == e.name) {
if ((eles.departmentTitle && eles.departmentTitle == e.name) || (eles.departmentName && eles.departmentName == e.name)) {
eles.departmentId = e.id;
}
});
......@@ -691,11 +692,12 @@ export default {
//如果导入文件没有departmentTitle,但存在departmentid的话,通过id获取departmentTitle
eles.departmentId &&
eles.departmentId + "" != "" &&
(!eles.departmentTitle || eles.departmentTitle == "")
(!eles.departmentTitle || eles.departmentTitle == "") && (!eles.departmentName || eles.departmentName == "")
) {
this.departArr.forEach((e) => {
if (eles.departmentId && eles.departmentId == e.id) {
eles.departmentTitle = e.name;
eles.departmentName = e.name;
}
});
}
......
......@@ -74,12 +74,16 @@ export default {
key: "codeRuleType",
title: "类型",
align: "center",
code: "material.code.type"
code: "material.code.type",
import: true,
hide: true,
},
{
key: "codeRuleId",
title: "编码名称",
materialKey: '3',
import: true,
hide: true,
render: (h, params) => {
return h(
"span", {},
......@@ -92,6 +96,8 @@ export default {
title: "大类",
align: "right",
materialKey: '1',
import: true,
hide: true,
render: (h, params) => {
return h(
"span", {},
......@@ -104,6 +110,8 @@ export default {
title: "子类",
align: "right",
materialKey: '2',
import: true,
hide: true,
render: (h, params) => {
return h(
"span", {},
......
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="110">
<Form ref="form" :model="entity" :rules="rules" :label-width="110">
<Row>
<!-- <Col :span="12">
<FormItem :label="l('classId')" prop="classId">
......@@ -52,7 +52,7 @@
</Col>
<Col :span="8">
<FormItem :label="l('departmentName')" prop="departmentId">
<departmentSelect v-model="entity.departmentId" type="3" @on-change="departChange"></departmentSelect>
<departmentSelect v-model="entity.departmentId" :type="3" @on-change="departChange"></departmentSelect>
</FormItem>
</Col>
<Col :span="8">
......@@ -151,9 +151,11 @@
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</Form>
</template>
<script>
<script>
import Api from "./api";
import ApiWorkflow from "../workflow/process/api";
import iQuill from "@/components/quill";
......@@ -197,16 +199,22 @@ export default {
fileId: ""
},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }],
routingType: [
{
name: [{
required: true,
message: "必填",
trigger: "blur"
}],
code: [{
required: true,
message: "必填",
trigger: "blur"
}],
routingType: [{
required: true,
message: "请选择工艺类型",
trigger: "change",
type: "number"
}
]
}]
},
parms: {
app: "technology",
......@@ -328,7 +336,9 @@ export default {
}
},
load(v) {
Api.get({ id: v }).then(r => {
Api.get({
id: v
}).then(r => {
this.entity = r.result;
this.entity.isEffect = parseInt(r.result.isEffect);
this.entity.id = 0;
......@@ -336,7 +346,10 @@ export default {
this.getCodNumber();
},
getCodNumber() {
Api.getCodeNumber({ code: "GY", count: "1" }).then(r => {
Api.getCodeNumber({
code: "GY",
count: "1"
}).then(r => {
if (r.success) {
this.entity.code = r.result[0];
} else {
......
......@@ -16,11 +16,13 @@
</template>
<template slot="buttons">
<Button type="primary" @click="add" v-show="headerStatus==0||headerStatus==4">新增</Button>
<Button @click="openModalIm">导入</Button>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" :headid="hid" :productBomId="productBomId" @on-close="cancel" @on-ok="ok" />
</Modal>
<ImportExcel ref="importExcel" @on-get-data="getData" :modalTitle="temTitle" :columns="cols" :open="ModalIm" @on-cancel="ModalImCancel" @on-ok="ok" />
</div>
</template>
......@@ -229,6 +231,8 @@ export default {
],
headerStatus: -1,
productBomId: -1,
ModalIm: false,
temTitle: "工艺Bom",
};
},
created() {
......@@ -298,6 +302,48 @@ export default {
this.curId = 0;
this.modal = false;
},
//批量导入start
//导入功能
openModalIm() {
this.ModalIm = true
},
ModalImCancel() {
this.ModalIm = false
},
getData(val) {
let url = `${technologyUrl}productinfoimportservice/import`;
this.$refs.importExcel.deelData(url, this.cols, this.formatMethod(val))
},
//根据页面二次处理数据
formatMethod(val) {
let tempData = this.$u.clone(val);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
name: ele.name ? ele.name : '',
version: ele.version ? Number(ele.version) : '',
drawing: ele.drawing ? ele.drawing : '',
description: ele.description ? ele.description : "",
code: 0,
status: this.nodeInfo.status == 1 ? 3 : 0,
codeRuleId: this.nodeInfo.codeRuleId,
categoryId: this.nodeInfo.categoryId, //左侧树点击的id
customProperties: {},
rootCategoryId: this.nodeInfo.rootCategoryId, //左侧树点击的数据的最顶层id
codeRuleType: this.nodeInfo.codeRuleType
};
if (ele.name && ele.name != '') {
obj.ico = false
} else {
obj.ico = true
}
tempList.push(obj);
});
return tempList
},
//批量导入end
l(key) {
let vkey = "routingsupporting" + "." + key;
return this.$t(vkey) || key;
......
......@@ -12,6 +12,7 @@
// right: 100%;
z-index: 100;
background-color: white;
// background: red;
.top {
height: 42px;
......@@ -21,7 +22,7 @@
}
</style>
<template>
<Layout class="lay100">
<Layout class="lay100">
<Sider hide-trigger v-if="showMenu" class="menu_side" width="300">
<ProductTree @on-hide="onHide" @on-select="productSearch" />
</Sider>
......@@ -31,16 +32,11 @@
</a>
</div>
<Content class="con" :class="!showMenu?'con_bord':''">
<DataGrid :columns="columns" ref="grid" :action="action">
<DataGrid :columns="columns" ref="grid" :action="action" exportTitle="工艺规程">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input
placeholder="请输入工艺名称/工艺编号"
v-width="200"
v-model="easySearch.keys.value"
clearable
/>
<Input placeholder="请输入工艺名称/工艺编号" v-width="200" v-model="easySearch.keys.value" clearable />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
......@@ -52,28 +48,13 @@
</template>
<template slot="buttons">
<Button type="primary" @click="add">新增</Button>
<Button @click="openModalIm">导入</Button>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1120" footer-hide>
<component
:is="detail"
:eid="curId"
:uid="uId"
:title="title"
:headid="hid"
@on-close="cancel"
@on-ok="ok"
/>
<component :is="detail" :eid="curId" :uid="uId" :title="title" :headid="hid" @on-close="cancel" @on-ok="ok" />
</Modal>
<Modal
v-model="documentShow"
title="送审"
:mask-closable="false"
:scrollable="true"
ok-text="确定"
cancel-text="取消"
fullscreen
>
<Modal v-model="documentShow" title="送审" :mask-closable="false" :scrollable="true" ok-text="确定" cancel-text="取消" fullscreen>
<sendAudit ref="sendAudit"></sendAudit>
<div slot="footer">
......@@ -111,8 +92,9 @@
<iframe width="100%" id="infoFrame" height="100%" frameborder="0" :src="src"></iframe>
</div>
</div>
<ImportExcel ref="importExcel" @on-get-data="getData" :modalTitle="temTitle" :columns="columns" :open="ModalIm" @on-cancel="ModalImCancel" @on-ok="ok" />
</Content>
</Layout>
</Layout>
</template>
<script>
......@@ -142,7 +124,10 @@ export default {
treeHeight: "",
action: Api.index,
easySearch: {
keys: { op: "unicode,name,code", value: null }
keys: {
op: "unicode,name,code",
value: null
}
},
hid: 0,
modal: false,
......@@ -154,8 +139,7 @@ export default {
curId: 0,
uId: "",
documentShow: false,
columns: [
{
columns: [{
key: "code",
title: this.l("code"),
align: "left",
......@@ -169,7 +153,7 @@ export default {
align: "left",
easy: true,
high: true,
tooltip:true,
tooltip: true,
},
{
key: "phase",
......@@ -185,14 +169,14 @@ export default {
align: "center",
high: true,
width: 100,
code:"Process.Routing.version"
code: "Process.Routing.version"
},
{
title: this.l("approvalStatus"),
key: "approvalStatus",
align: "center",
width: "120",
code:"process.RoutingStatus"
code: "process.RoutingStatus"
},
{
key: "routingType",
......@@ -213,7 +197,21 @@ export default {
title: this.l("productName"),
align: "left",
high: true,
tooltip:true,
tooltip: true,
},
{
key: "productId",
title: this.l("productId"),
align: "left",
import: true,
hide: true,
},
{
key: "productBomId",
title: this.l("productBomId"),
align: "left",
import: true,
hide: true,
},
{
key: "departmentName",
......@@ -221,7 +219,14 @@ export default {
width: 100,
align: "left",
high: true,
tooltip:true,
tooltip: true,
},
{
key: "departmentId",
title: this.l("departmentId"),
align: "left",
import: true,
hide: true,
},
{
key: "isEffect",
......@@ -257,7 +262,7 @@ export default {
title: this.$t("creatorUserId"),
align: "left",
hide: true,
type:"user"
type: "user"
},
{
key: "lastModificationTime",
......@@ -270,7 +275,7 @@ export default {
title: this.$t("lastModifierUserId"),
align: "left",
hide: true,
type:"user"
type: "user"
},
{
title: "操作",
......@@ -278,61 +283,84 @@ export default {
width: 260,
align: "left",
render: (h, params) => {
return h("div", { class: "action" }, [
return h("div", {
class: "action"
}, [
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.viewprocess(params.row) }
"op", {
attrs: {
oprate: "detail"
},
on: {
click: () => this.viewprocess(params.row)
}
},
"预览"
),
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.view(params.row) }
"op", {
attrs: {
oprate: "detail"
},
on: {
click: () => this.view(params.row)
}
},
"查看"
),
h(
"op",
{
attrs: { oprate: "copy" },
on: { click: () => this.copy(params.row.id) }
"op", {
attrs: {
oprate: "copy"
},
on: {
click: () => this.copy(params.row.id)
}
},
"克隆"
),
h(
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row) }
"op", {
attrs: {
oprate: "edit"
},
on: {
click: () => this.edit(params.row)
}
},
'编辑'
// params.row.approvalStatus == 4||params.row.approvalStatus == 0 ? "编辑" : ""
),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) }
"op", {
attrs: {
oprate: "delete"
},
params.row.approvalStatus == 4||params.row.approvalStatus == 0 ? "删除" : ""
on: {
click: () => this.remove(params.row.id)
}
},
params.row.approvalStatus == 4 || params.row.approvalStatus == 0 ? "删除" : ""
),
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.TechnologyChange(params.row) }
"op", {
attrs: {
oprate: "detail"
},
on: {
click: () => this.TechnologyChange(params.row)
}
},
params.row.approvalStatus == 1 ? "新增更改单" : ""
),
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.sendAuditFun(params.row) }
"op", {
attrs: {
oprate: "detail"
},
on: {
click: () => this.sendAuditFun(params.row)
}
},
params.row.approvalStatus == 4 ? "送审" : ""
)
......@@ -347,13 +375,18 @@ export default {
version: "", //工艺版本
departmentName: null //车间
},
processviewModal: false
processviewModal: false,
ModalIm: false,
temTitle: "工艺规程",
};
},
created() {
this.treeHeight = window.innerHeight - 120;
},
async fetch({ store, params }) {
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
mounted() {
......@@ -375,7 +408,12 @@ export default {
this.showMenu = true;
},
productSearch(id, item, ids) {
let where = { productId: { op: "In", value: ids } };
let where = {
productId: {
op: "In",
value: ids
}
};
this.$refs.grid.reload(where);
},
// 详情页面
......@@ -390,7 +428,7 @@ export default {
};
// this.info=()=>import("./details")
this.src = "/technology/details?id=" + row.id+"&headerStatus="+row.approvalStatus+"&productBomId="+row.productBomId;
this.src = "/technology/details?id=" + row.id + "&headerStatus=" + row.approvalStatus + "&productBomId=" + row.productBomId;
},
viewClose() {
this.viewModal = false;
......@@ -497,7 +535,9 @@ export default {
this.seleId = data.row.id;
this.$refs.changelist.seleId = data.row.id;
let url = `${designUrl}/routingheaderchangeorder/getpaged`;
service.get(`${url}`, { routing_header_id: this.seleId }).then(res => {
service.get(`${url}`, {
routing_header_id: this.seleId
}).then(res => {
//console.log(res)
this.$refs.changelist.data2 = res.result.items;
this.$refs.changelist.myloading = false;
......@@ -508,7 +548,65 @@ export default {
}
this.$refs.changelist.show3 = true;
});
},
//批量导入start
//导入功能
openModalIm() {
this.ModalIm = true
},
ModalImCancel() {
this.ModalIm = false
},
getData(val) {
let url = `${technologyUrl}routingheaderimportservice/import`;
this.$refs.importExcel.deelData(url, this.columns, this.formatMethod(val))
},
//根据页面二次处理数据
formatMethod(val) {
let tempData = this.$u.clone(val);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
classId: null,
unicode: "",
name: ele.name ? ele.name : '',
code: ele.code ? ele.code : '',
productId: ele.productId ? ele.productId : '', //?
productName: ele.productName ? ele.productName : "", //?
productBomId: ele.productBomId ? ele.productBomId : "", //?
drawingNo: ele.drawingNo ? ele.drawingNo : "", //?
version: "",
versionid: ele.versionid ? ele.versionid : "",
author: null,
departmentId: ele.departmentId ? ele.departmentId : null, //?
departmentName: ele.departmentName ? ele.departmentName : "", //?
isMain: 1,
upId: null,
upDetailId: null,
routingType: ele.routingType ? ele.routingType : null,
status: 0,
approvalStatus: 4, //?
remark: "",
approvalStatusRemark: "",
auditUserId1: "",
auditUserId2: "",
platesnum: null,
versionnotes: "",
isSendPpm: 1,
fileId: "",
phase: ele.phase ? ele.phase : null
};
if (ele.name && ele.name != '') {
obj.ico = false
} else {
obj.ico = true
}
tempList.push(obj);
});
return tempList
},
//批量导入end
}
};
</script>
......
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