Commit 5b32ebb1 authored by 仇晓婷's avatar 仇晓婷

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

parents 67ae6e9f b582466d
<template> <template>
<Modal v-model="ImportModal" title="导入" fullscreen footer-hide @on-cancel="cancelModal"> <Modal v-model="ImportModal" :title="modalTitles" fullscreen footer-hide @on-cancel="cancelModal">
<div class="table-content"> <div class="table-content">
<div class="table-tools"> <div class="table-tools">
...@@ -99,6 +99,7 @@ export default { ...@@ -99,6 +99,7 @@ export default {
columnsIm: this.columns, columnsIm: this.columns,
ImportModal: this.open, ImportModal: this.open,
batchImportUrl: '', batchImportUrl: '',
modalTitles: '导入',
}; };
}, },
props: { props: {
...@@ -118,6 +119,10 @@ export default { ...@@ -118,6 +119,10 @@ export default {
open: { open: {
type: Boolean, type: Boolean,
default: false default: false
},
modalTitle: {
type: String,
default: ""
} }
}, },
created() { created() {
...@@ -133,6 +138,7 @@ export default { ...@@ -133,6 +138,7 @@ export default {
//if (this.eid > 0) { //if (this.eid > 0) {
// this.load(this.eid); // this.load(this.eid);
//} //}
this.modalTitles = "导入到【" + this.modalTitle + "】"
window.onresize = () => { window.onresize = () => {
///浏览器窗口大小变化 ///浏览器窗口大小变化
return (() => { return (() => {
...@@ -411,7 +417,10 @@ export default { ...@@ -411,7 +417,10 @@ export default {
}, },
open(v) { open(v) {
this.ImportModal = v this.ImportModal = v
} },
modalTitle(v) {
this.modalTitles = "导入到【" + v + "】"
},
}, },
}; };
</script> </script>
......
...@@ -332,6 +332,116 @@ export default { ...@@ -332,6 +332,116 @@ export default {
code: "User.base.status", code: "User.base.status",
}, },
], ],
columns3: [{
key: "resourceCode",
title: this.l3("resourceId"),
align: "left",
easy: true,
},
{
key: "nameOfResource",
title: this.l3("nameOfResource"),
align: "left",
easy: true,
tooltip: true,
},
{
key: "code",
title: "编码",
align: "left",
},
{
key: "creatorUserId",
title: this.l3("creatorUserId"),
hide: false,
type: "user",
align: "left",
},
{
key: "lastModificationTime",
title: this.l3("lastModificationTime"),
hide: true,
align: "left",
},
{
key: "lastModifierUserId",
title: this.l3("lastModifierUserId"),
hide: true,
align: "left",
},
{
key: "isDeleted",
title: this.l3("isDeleted"),
hide: true,
align: "left",
},
{
key: "deletionTime",
title: this.l3("deletionTime"),
hide: true,
align: "left",
},
{
key: "deleterUserId",
title: this.l3("deleterUserId"),
hide: true,
align: "left",
},
{
key: "totalNum",
title: this.l3("totalNum"),
align: "right",
easy: true,
},
{
key: "numberAvailable",
title: this.l3("numberAvailable"),
align: "right",
easy: true,
},
{
key: "measuringUnit",
title: this.l3("measuringUnit"),
align: "left",
easy: true,
high: true,
hide: true,
},
{
key: "qualityCharacteristics",
title: this.l3("qualityCharacteristics"),
align: "left",
easy: true,
high: true,
hide: true,
},
{
key: "batchNo",
title: this.l3("batchNo"),
align: "left",
easy: true,
high: true,
hide: true,
},
{
key: "storeId",
title: this.l3("storeId"),
align: "left",
high: true,
hide: true,
},
{
key: "storeTitle",
title: this.l3("storeTitle"),
align: "left",
},
{
key: "state",
title: this.l3("state"),
align: "center",
code: "mes_xingchi_resource.resource.state",
}
],
tdHeightExcel: "", tdHeightExcel: "",
excelData: [], excelData: [],
excelDataBack: [], //临时存储原始数据 excelDataBack: [], //临时存储原始数据
...@@ -650,6 +760,9 @@ export default { ...@@ -650,6 +760,9 @@ export default {
case 1: case 1:
this.loadColum(this.columns1); this.loadColum(this.columns1);
break; break;
case 3:
this.loadColum(this.columns3);
break;
default: default:
this.loadColum(this.columns0); this.loadColum(this.columns0);
} }
...@@ -673,8 +786,8 @@ export default { ...@@ -673,8 +786,8 @@ export default {
case 0: case 0:
this.importUser(); this.importUser();
break; break;
case 1: case 3:
//this.loadColum(this.columns1); this.importResource();
break; break;
default: default:
//this.loadColum(this.columns1); //this.loadColum(this.columns1);
...@@ -723,6 +836,52 @@ export default { ...@@ -723,6 +836,52 @@ export default {
} }
}, },
//批量插入制造资源
importResource() {
let tempData = this.$u.clone(this.dataIm);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
nameOfResource: ele.nameOfResource ? ele.nameOfResource : "",
resourceCode: ele.resourceCode ? ele.resourceCode : "",
code: ele.code ? ele.code : "",
totalNum: ele.totalNum ? ele.totalNum : 0,
storeTitle: ele.storeTitle ? ele.storeTitle : "",
storeId: ele.storeId ? ele.storeId : null,
state: 1,
numberAvailable: ele.numberAvailable ? ele.numberAvailable : 0,
json: {},
};
if (ele.nameOfResource &&
ele.nameOfResource != "" &&
ele.code &&
ele.code != "" &&
ele.resourceCode &&
ele.resourceCode != "") {
tempList.push(obj);
}
});
if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!");
} else {
let parms = {
list: tempList,
};
let url = `${resourceUrl}/resourceimportservice/import`
this.$api.post(url, parms).then((r) => {
if (r.success) {
this.$Message.success("成功批量导入制造资源成功模块 " + tempList.length + " 条数据");
this.imBtn = false;
this.cancelExcel();
} else {
this.$Message.error("批量导入失败")
}
}).catch(err => {
this.$Message.error("数据异常!");
});
}
},
//切换列表和excel按钮 //切换列表和excel按钮
changeExcel(val) { changeExcel(val) {
if (val == 1) { if (val == 1) {
...@@ -746,6 +905,10 @@ export default { ...@@ -746,6 +905,10 @@ export default {
key = "user" + "." + key; key = "user" + "." + key;
return this.$t(key); return this.$t(key);
}, },
l3(key) {
key = "resource" + "." + key;
return this.$t(key);
},
}, },
watch: { watch: {
eid(v) { eid(v) {
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<Modal v-model="modal" :title="title" width="1000" footer-hide :mask-closable="false" :fullscreen="fullscreen"> <Modal v-model="modal" :title="title" width="1000" footer-hide :mask-closable="false" :fullscreen="fullscreen">
<component :is="detail" :eid="curId" :rootCategoryId="rootCategoryId" :rowsTable="rowsTable" :nodeInfo="nodeInfo" @on-close="cancel" @on-cancel="cancel" @on-ok="ok" ref="chlidren" /> <component :is="detail" :eid="curId" :rootCategoryId="rootCategoryId" :rowsTable="rowsTable" :nodeInfo="nodeInfo" @on-close="cancel" @on-cancel="cancel" @on-ok="ok" ref="chlidren" />
</Modal> </Modal>
<ImportExcel ref="importExcel" @on-get-data="getData" :columns="cols" :open="ModalIm" @on-cancel="ModalImCancel" @on-ok="ok" /> <ImportExcel ref="importExcel" @on-get-data="getData" :modalTitle="temTitle" :columns="cols" :open="ModalIm" @on-cancel="ModalImCancel" @on-ok="ok" />
</div> </div>
</template> </template>
...@@ -48,6 +48,7 @@ export default { ...@@ -48,6 +48,7 @@ export default {
rowsTable: [], rowsTable: [],
fullscreen: false, fullscreen: false,
detail: null, detail: null,
temTitle: "物料管理",
sets: v => { sets: v => {
v.categoryId = this.nodeInfo.categoryId; v.categoryId = this.nodeInfo.categoryId;
v.rootCategoryId = this.nodeInfo.rootCategoryId; v.rootCategoryId = this.nodeInfo.rootCategoryId;
...@@ -67,6 +68,22 @@ export default { ...@@ -67,6 +68,22 @@ export default {
width: 70, width: 70,
align: "center" align: "center"
}, },
{
key: "codeRuleType",
title: "类型",
align: "center",
code: "material.code.type"
},
{
key: "rootCategoryId",
title: "大类编号",
align: "right",
},
{
key: "categoryId",
title: "子类编号",
align: "right",
},
{ {
key: "code", key: "code",
title: "编码", title: "编码",
...@@ -405,6 +422,7 @@ export default { ...@@ -405,6 +422,7 @@ export default {
nodeInfo: { nodeInfo: {
handler(newName, oldName) { handler(newName, oldName) {
// console.log("ovo", newName, oldName); // console.log("ovo", newName, oldName);
this.temTitle = "物料管理(" + newName.rootCategoryName + ")"
if (newName.rootCategoryId) { if (newName.rootCategoryId) {
this.initCols(() => { this.initCols(() => {
if (newName.categoryId) { if (newName.categoryId) {
...@@ -419,7 +437,7 @@ export default { ...@@ -419,7 +437,7 @@ export default {
}, },
immediate: true, immediate: true,
deep: true deep: true
} },
} }
}; };
</script> </script>
......
<template> <template>
<Layout class="full"> <Layout class="full">
<Sider hide-trigger v-if="showMenu" class="menu_side" width="300"> <Sider hide-trigger v-if="showMenu" class="menu_side" width="300">
<StoreTree @on-hide="onHide" @on-select="productSearch" /> <StoreTree @on-hide="onHide" @on-select="productSearch" />
</Sider> </Sider>
...@@ -9,26 +9,11 @@ ...@@ -9,26 +9,11 @@
</a> </a>
</div> </div>
<Content class="content" :class="!showMenu?'con_bord':''"> <Content class="content" :class="!showMenu?'con_bord':''">
<DataGrid <DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch" :batch="true" :format="checkData" @all-change="allchange" @on-selection-change="onSelect" exportTitle="制造资源">
:columns="columns"
ref="grid"
:action="action"
:conditions="easySearch"
:batch="true"
:format="checkData"
@all-change="allchange"
@on-selection-change="onSelect"
exportTitle="制造资源"
>
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys"> <FormItem prop="keys">
<Input <Input clearable placeholder="请输入资源名称/资源编码/编码" v-model.trim="easySearch.keys.value" v-width="260" />
clearable
placeholder="请输入资源名称/资源编码/编码"
v-model.trim="easySearch.keys.value"
v-width="260"
/>
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button type="primary" @click="search">查询</Button> <Button type="primary" @click="search">查询</Button>
...@@ -51,31 +36,11 @@ ...@@ -51,31 +36,11 @@
</template> </template>
</DataGrid> </DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide :fullscreen="fscreeen"> <Modal v-model="modal" :title="title" width="1200" footer-hide :fullscreen="fscreeen">
<component <component :is="detail" :eid="curId" :rootName="rootName" :storeTitle="storeTitle" :materialType="materialType" :codeRuleType="codeRuleType" :storeId="storeId" :mcode="mCode" :cartList="this.$u.clone(this.$store.state.cart)" @on-close="cancel" @on-ok="ok" @substr="substr" />
:is="detail"
:eid="curId"
:rootName="rootName"
:storeTitle="storeTitle"
:materialType="materialType"
:codeRuleType="codeRuleType"
:storeId="storeId"
:mcode="mCode"
:cartList="this.$u.clone(this.$store.state.cart)"
@on-close="cancel"
@on-ok="ok"
@substr="substr"
/>
</Modal> </Modal>
<ImportExcel <ImportExcel ref="importExcel" @on-get-data="getData" modalTitle="制造资源" :columns="columns" :open="ModalIm" @on-cancel="ModalImCancel" @on-ok="ok" />
ref="importExcel"
@on-get-data="getData"
:columns="columns"
:open="ModalIm"
@on-cancel="ModalImCancel"
@on-ok="ok"
/>
</Content> </Content>
</Layout> </Layout>
</template> </template>
<script> <script>
...@@ -111,8 +76,7 @@ export default { ...@@ -111,8 +76,7 @@ export default {
storeTitle: "", storeTitle: "",
materialType: "", materialType: "",
mCode: "", mCode: "",
columns: [ columns: [{
{
key: "selection", key: "selection",
type: "selection", type: "selection",
width: 50, width: 50,
...@@ -134,8 +98,7 @@ export default { ...@@ -134,8 +98,7 @@ export default {
width: 60, width: 60,
render: (h, params) => { render: (h, params) => {
return h( return h(
"div", "div", {
{
class: "action", class: "action",
}, },
[ [
...@@ -291,22 +254,18 @@ export default { ...@@ -291,22 +254,18 @@ export default {
hide: false, hide: false,
render: (h, params) => { render: (h, params) => {
return h( return h(
"div", "div", {
{
class: "action", class: "action",
}, },
[ [
h( h(
"op", "op", {
{
attrs: { attrs: {
oprate: "delete", oprate: "delete",
title: "删除", title: "删除",
}, },
class: class: params.row.totalNum === params.row.numberAvailable ?
params.row.totalNum === params.row.numberAvailable "remove" : "disable",
? "remove"
: "disable",
on: { on: {
click: () => this.remove(params.row), click: () => this.remove(params.row),
}, },
...@@ -314,8 +273,7 @@ export default { ...@@ -314,8 +273,7 @@ export default {
"删除" "删除"
), ),
h( h(
"op", "op", {
{
attrs: { attrs: {
oprate: "detail", oprate: "detail",
title: "查看日志", title: "查看日志",
...@@ -356,7 +314,10 @@ export default { ...@@ -356,7 +314,10 @@ export default {
})(); })();
}; };
}, },
async fetch({ store, params }) { async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
computed: {}, computed: {},
...@@ -580,11 +541,11 @@ export default { ...@@ -580,11 +541,11 @@ export default {
nameOfResource: ele.nameOfResource ? ele.nameOfResource : "", nameOfResource: ele.nameOfResource ? ele.nameOfResource : "",
resourceCode: ele.resourceCode ? ele.resourceCode : "", resourceCode: ele.resourceCode ? ele.resourceCode : "",
code: ele.code ? ele.code : "", code: ele.code ? ele.code : "",
totalNum: ele.totalNum ? ele.nameOfResource : 0, totalNum: ele.totalNum ? ele.totalNum : 0,
storeTitle: ele.storeTitle ? ele.storeTitle : "", storeTitle: ele.storeTitle ? ele.storeTitle : "",
storeId: ele.storeId ? ele.nameOfResource : null, storeId: ele.storeId ? ele.storeId : null,
state: 1, state: 1,
numberAvailable: ele.numberAvailable ? ele.nameOfResource : 0, numberAvailable: ele.numberAvailable ? ele.numberAvailable : 0,
json: {}, json: {},
}; };
if ( if (
......
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