Commit 5548c7e2 authored by renjintao's avatar renjintao

productMix

parent f63aa323
......@@ -90,6 +90,7 @@ export default {
pageSize: 20,
conditions: [],
},
searchConditions: this.search,
pageSizeOpts: [20, 50, 100],
tableHeight: 0,
firstY: 0,
......@@ -408,6 +409,7 @@ export default {
},
reload(conditions) {
var where = [];
this.searchConditions = conditions
if (conditions) {
Object.keys(conditions).forEach((u) => {
let v = conditions[u].value;
......@@ -482,7 +484,7 @@ export default {
export2Excel() {
//当前显示数据
var where = [];
var conditions = this.conditions;
var conditions = this.searchConditions;
if (conditions) {
Object.keys(conditions).forEach((u) => {
let v = conditions[u].value;
......@@ -496,7 +498,7 @@ export default {
}
});
v = times.join(",");
} else if (op.indexOf("In") > -1) {
} else if (op.indexOf("In") > -1 && Array.isArray(v)) {
v = v.join(",");
}
if (!this.$u.isNull(v)) {
......
......@@ -1448,7 +1448,7 @@ export default {
product_info: {
mmcode: '物料编号',
materialId: '物料',
levelId: '产品分类',
levelId: '产品分类ID',
type: "类型",
drawingNo: '图号',
name: '名称',
......@@ -1457,7 +1457,7 @@ export default {
madeCompanyTitle: '主承制单位',
status: '',
remark: '备注',
madeCompany: '主承制单位',
madeCompany: '主承制单位ID',
creationTime: '创建时间',
extend: '',
productUrl: '产品图像',
......
......@@ -15,10 +15,9 @@
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="add">新增</Button>&nbsp;
</template>
<template slot="buttons">
<Button type="primary" @click="add">新增</Button>
<Button :icon="iconInfo" shape="circle" :title="titleInfo" @click="changeShwo"></Button>
<Button @click="openModalIm">导入</Button>
</template>
<template slot="card" slot-scope="{row}">
<div class="body-card">
......@@ -62,6 +61,7 @@
<Modal v-model="modal" :title="title" width="1200" footer-hide :fullscreen="fullscreen" :mask-closable="false">
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" :parents="parent" />
</Modal>
<ImportExcel ref="importExcel" @on-get-data="getData" :modalTitle="temTitle" :columns="columns" :open="ModalIm" @on-cancel="ModalImCancel" @on-ok="ok" />
</div>
</template>
......@@ -131,26 +131,24 @@ export default {
{
key: "productUrl",
title: this.l("productUrl"),
align: "left",
align: "center",
high: true,
render: (h, params) => {
return h("div", {
class: "action"
}, [
h(
"a", {
params.row.productUrl.length > 0 ? "a" : "span", {
attrs: {
oprate: "detail",
// href: this.fileUrlPath,
// target: "_blank"
},
on: {
click: () => {
this.downFile(params.row.productUrl);
params.row.productUrl.length > 0 ? this.downFile(params.row.productUrl) : null;
},
},
},
"查看图片"
params.row.productUrl.length > 0 ? "查看图片" : '暂无图片'
),
]);
},
......@@ -161,6 +159,14 @@ export default {
align: "left",
high: true,
},
{
key: "levelId",
title: this.l("levelId"),
align: "left",
high: true,
hide: true,
import: true,
},
{
key: "drawingNo",
title: this.l("drawingNo"),
......@@ -174,6 +180,33 @@ export default {
width: 260,
high: true,
},
{
key: "madeCompany",
title: this.l("madeCompany"),
align: "center",
width: 260,
high: true,
hide: true,
import: true,
},
{
key: "version",
title: this.l("version"),
align: "center",
width: 260,
high: true,
hide: true,
import: true,
},
{
key: "materialId",
title: this.l("materialId"),
align: "center",
width: 260,
high: true,
hide: true,
import: true,
},
{
title: "操作",
key: "action",
......@@ -234,6 +267,8 @@ export default {
typeInfo: "card",
iconInfo: "md-apps",
titleInfo: "卡片模式",
ModalIm: false,
temTitle: "产品管理",
};
},
mounted() {
......@@ -336,6 +371,52 @@ export default {
let vkey = "product_info" + "." + key;
return this.$t(vkey) || key;
},
//批量导入start
//导入功能
openModalIm() {
if (this.parent.id) {
this.ModalIm = true
} else {
this.$Message.error("请先选择产品分类");
}
},
ModalImCancel() {
this.ModalIm = false
},
getData(val) {
let url = `${technologyUrl}productinfoimportservice/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 = {
mmcode: ele.mmcode ? ele.mmcode : '',
drawingNo: ele.drawingNo ? ele.drawingNo : '',
name: ele.name ? ele.name : '',
type: ele.type ? ele.type : 1,
madeCompany: ele.madeCompany ? ele.madeCompany : null,
madeCompanyTitle: ele.madeCompanyTitle ? ele.madeCompanyTitle : "",
version: ele.version ? ele.version : 0,
productUrl: "",
productUrlList: "",
levelId: this.parent.id,
levelTitle: this.parent.parentName,
materialId: ele.materialId ? ele.materialId : "",
};
if (ele.name && ele.name != '') {
obj.ico = false
} else {
obj.ico = true
}
tempList.push(obj);
});
return tempList
},
//批量导入end
},
watch: {
"parent.id"(v) {
......
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