Commit f90079af authored by 仇晓婷's avatar 仇晓婷

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

parents 4718be5b 2688258a
......@@ -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)) {
......
<template>
<div>
<RadioGroup
v-if="type === 'radio'"
ref="dicradio"
v-model="name"
@on-change="change"
:vertical="vertical"
>
<Radio
v-for="(item, index) in dic"
:disabled="item.disabled"
:label="item.value"
:key="index"
:border="border"
>
<span :title="item.value">{{ item.label }}</span>
</Radio>
<div>
<RadioGroup v-if="type === 'radio'" ref="dicradio" v-model="name" @on-change="change" :vertical="vertical">
<Radio v-for="(item, index) in dic" :disabled="item.disabled" :label="item.value" :key="index" :border="border">
<span :title="item.value">{{ item.label }}</span>
</Radio>
</RadioGroup>
<CheckboxGroup
v-else-if="type === 'checkbox'"
ref="dicradio"
v-model="name"
@on-change="change"
:vertical="vertical"
>
<Checkbox
v-for="(item, index) in dic"
:disabled="item.disabled"
:label="item.value"
:key="index"
:border="border"
>
<span :title="item.value">{{ item.label }}</span>
</Checkbox>
<CheckboxGroup v-else-if="type === 'checkbox'" ref="dicradio" v-model="name" @on-change="change" :vertical="vertical">
<Checkbox v-for="(item, index) in dic" :disabled="item.disabled" :label="item.value" :key="index" :border="border">
<span :title="item.value">{{ item.label }}</span>
</Checkbox>
</CheckboxGroup>
<Select
v-else
:placeholder="placeholder"
v-model="name"
@on-change="change"
:disabled="disabled"
:multiple="multiple"
clearable
:transfer="true"
>
<Option
v-for="(item, i) in dic"
:value="item.value"
:disabled="item.disabled"
:key="item.value"
:label="item.label"
>
<span :title="item.value">{{item.label}}</span>
</Option>
<Select v-else :placeholder="placeholder" v-model="name" @on-change="change" :disabled="disabled" :multiple="multiple" clearable :transfer="true">
<Option v-for="(item, i) in dic" :value="item.value" :disabled="item.disabled" :key="item.value" :label="item.label">
<span :title="item.value">{{item.label}}</span>
</Option>
</Select>
</div>
</div>
</template>
<script>
export default {
model: {
prop: "value",
event: "on-change"
},
props: {
code: String,
value: [String, Number, Array],
placeholder: {
type: String,
default: "请选择"
},
type: {
// 显示形式: select 或者radio
type: String,
default: "Select"
model: {
prop: "value",
event: "on-change"
},
border: {//radio可以选择border属性
type: Boolean,
default: false
props: {
code: String,
value: [String, Number, Array],
placeholder: {
type: String,
default: "请选择"
},
type: {
// 显示形式: select 或者radio
type: String,
default: "Select"
},
border: { //radio可以选择border属性
type: Boolean,
default: false
},
multiple: {
//是否多选
type: Boolean,
default: false
},
disabled: {
//是否禁止选择
type: Boolean,
default: false
},
vertical: {
//排列方式 水平或者垂直
type: Boolean,
default: false
},
limit: {
//限制只在此值范围内进行选择,其它值禁用选择。
type: String,
default: ""
}
},
multiple: {
//是否多选
type: Boolean,
default: false
data() {
return {
name: this.value,
data: []
};
},
disabled: {
//是否禁止选择
type: Boolean,
default: false
created() {
this.data = this.$store.getters.dictionaryByKey(this.code);
},
vertical: {
//排列方式 水平或者垂直
type: Boolean,
default: false
mounted() {
// if(this.value==undefined||this.value==''||this.value==null)
// {
// this.value=1
// }
// let v = this.value
// try {
// v = parseInt(v)
// } catch (err) {
// console.warn('数据字典值请设置为int')
// }
// this.name = v
},
limit: {
//限制只在此值范围内进行选择,其它值禁用选择。
type: String,
default: ""
}
},
data() {
return {
name: this.value,
data: []
};
},
created() {
this.data = this.$store.getters.dictionaryByKey(this.code);
},
mounted() {
// if(this.value==undefined||this.value==''||this.value==null)
// {
// this.value=1
// }
// let v = this.value
// try {
// v = parseInt(v)
// } catch (err) {
// console.warn('数据字典值请设置为int')
// }
// this.name = v
},
methods: {
change(event) {
this.$emit("on-change", event);
}
},
computed: {
dic() {
let result = [];
let limit = this.limit.split(",");
this.data.forEach(u => {
let v = u.code;
let s = u.status;
try {
v = parseInt(u.code);
} catch (err) {
console.warn("数据字典值请设置为int");
methods: {
change(event) {
this.$emit("on-change", event);
}
var disabled = this.disabled; //false
if (!this.disabled && !this.$u.isNull(this.limit)) {
disabled = limit.indexOf(v + "") == -1;
},
computed: {
dic() {
let result = [];
let limit = this.limit.split(",");
this.data.forEach(u => {
let v = u.code;
let s = u.status;
try {
v = parseInt(u.code);
} catch (err) {
console.warn("数据字典值请设置为int");
}
var disabled = this.disabled; //false
if (!this.disabled && !this.$u.isNull(this.limit)) {
disabled = limit.indexOf(v + "") == -1;
}
if (!this.disabled) {
disabled = s == 1 ? true : false;
}
result.push({
label: u.name,
value: v,
disabled: disabled
});
});
return result;
}
if (!this.disabled) {
disabled = s == 1 ? true : false;
},
watch: {
value: {
handler(v, o) {
this.name = v;
},
deep: true
}
result.push({
label: u.name,
value: v,
disabled: disabled
});
});
return result;
}
},
watch: {
value: {
handler(v, o) {
this.name = v;
},
deep: true
}
}
};
</script>
<style lang="less">
.w200 {
width: 200px;
width: 200px;
}
</style>
......@@ -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: '产品图像',
......
......@@ -4938,7 +4938,7 @@
"dependencies": {
"commander": {
"version": "2.14.1",
"resolved": "http://r.cnpmjs.org/commander/download/commander-2.14.1.tgz",
"resolved": "https://registry.npm.taobao.org/commander/download/commander-2.14.1.tgz?cache=0&sync_timestamp=1595168224685&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.14.1.tgz",
"integrity": "sha1-IjUSPjevjKPGXfRbAm29NXsBuao="
}
}
......@@ -5467,7 +5467,7 @@
},
"crc-32": {
"version": "1.2.0",
"resolved": "http://r.cnpmjs.org/crc-32/download/crc-32-1.2.0.tgz",
"resolved": "https://registry.npm.taobao.org/crc-32/download/crc-32-1.2.0.tgz",
"integrity": "sha1-yy224puIUI4y2d0OwWk+e0Ghggg=",
"requires": {
"exit-on-epipe": "~1.0.1",
......@@ -7364,7 +7364,7 @@
},
"exit-on-epipe": {
"version": "1.0.1",
"resolved": "http://r.cnpmjs.org/exit-on-epipe/download/exit-on-epipe-1.0.1.tgz",
"resolved": "https://registry.npm.taobao.org/exit-on-epipe/download/exit-on-epipe-1.0.1.tgz",
"integrity": "sha1-C92S6H1ShdJn2qgXHQ6wYVlolpI="
},
"expand-brackets": {
......@@ -8015,7 +8015,7 @@
},
"frac": {
"version": "1.1.2",
"resolved": "http://r.cnpmjs.org/frac/download/frac-1.1.2.tgz",
"resolved": "https://registry.npm.taobao.org/frac/download/frac-1.1.2.tgz",
"integrity": "sha1-PXT39keMiKG1AgMG10fcYxPHTQs="
},
"fragment-cache": {
......@@ -10026,7 +10026,7 @@
},
"iview-loader": {
"version": "1.3.0",
"resolved": "http://r.cnpmjs.org/iview-loader/download/iview-loader-1.3.0.tgz",
"resolved": "https://registry.npm.taobao.org/iview-loader/download/iview-loader-1.3.0.tgz",
"integrity": "sha1-n0Yu6uI4K4tJ746JLNloFJfjVLc=",
"dev": true,
"requires": {
......@@ -11762,7 +11762,7 @@
},
"less-loader": {
"version": "5.0.0",
"resolved": "http://r.cnpmjs.org/less-loader/download/less-loader-5.0.0.tgz",
"resolved": "https://registry.npm.taobao.org/less-loader/download/less-loader-5.0.0.tgz?cache=0&sync_timestamp=1598354442231&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fless-loader%2Fdownload%2Fless-loader-5.0.0.tgz",
"integrity": "sha1-SY3eOmxsT4h0WO6e0/CGoSrRtGY=",
"dev": true,
"requires": {
......@@ -15087,7 +15087,7 @@
},
"printj": {
"version": "1.1.2",
"resolved": "http://r.cnpmjs.org/printj/download/printj-1.1.2.tgz",
"resolved": "https://registry.npm.taobao.org/printj/download/printj-1.1.2.tgz",
"integrity": "sha1-2Q3rKXWoufYA+zoclOP0xTx4oiI="
},
"private": {
......@@ -20540,7 +20540,7 @@
},
"script-loader": {
"version": "0.7.2",
"resolved": "http://r.cnpmjs.org/script-loader/download/script-loader-0.7.2.tgz",
"resolved": "https://registry.npm.taobao.org/script-loader/download/script-loader-0.7.2.tgz",
"integrity": "sha1-IBbbb4byX1z1baOJFdgzeLsWa6c=",
"dev": true,
"requires": {
......@@ -21128,7 +21128,7 @@
},
"ssf": {
"version": "0.10.3",
"resolved": "http://r.cnpmjs.org/ssf/download/ssf-0.10.3.tgz",
"resolved": "https://registry.npm.taobao.org/ssf/download/ssf-0.10.3.tgz",
"integrity": "sha1-jq4fwpyQpVLnkhII+BiS1vd6yys=",
"requires": {
"frac": "~1.1.2"
......@@ -23778,7 +23778,7 @@
},
"wmf": {
"version": "1.0.2",
"resolved": "http://r.cnpmjs.org/wmf/download/wmf-1.0.2.tgz",
"resolved": "https://registry.npm.taobao.org/wmf/download/wmf-1.0.2.tgz",
"integrity": "sha1-fRnWIQcaCMK9xrfmiKnENSmMwto="
},
"word-wrap": {
......@@ -23933,7 +23933,7 @@
},
"xlsx": {
"version": "0.15.6",
"resolved": "http://r.cnpmjs.org/xlsx/download/xlsx-0.15.6.tgz",
"resolved": "https://registry.npm.taobao.org/xlsx/download/xlsx-0.15.6.tgz?cache=0&sync_timestamp=1597272342311&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fxlsx%2Fdownload%2Fxlsx-0.15.6.tgz",
"integrity": "sha1-Rh+EHW2eoag3XizSRr8jrs4IodU=",
"requires": {
"adler-32": "~1.2.0",
......@@ -23948,7 +23948,7 @@
"dependencies": {
"commander": {
"version": "2.17.1",
"resolved": "http://r.cnpmjs.org/commander/download/commander-2.17.1.tgz",
"resolved": "https://registry.npm.taobao.org/commander/download/commander-2.17.1.tgz?cache=0&sync_timestamp=1595168224685&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.17.1.tgz",
"integrity": "sha1-vXerfebelCBc6sxy8XFtKfIKd78="
}
}
......
<template>
<div class="h100">
<DataGrid :columns="columns" ref="grid" :action="action" exportTitle="导入中心">
<DataGrid :columns="columns" ref="grid" :action="action">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
......
......@@ -736,7 +736,73 @@ export default {
easy: true,
high: true
},
],
columns6: [{
title: this.l6("name"),
key: "name",
align: "left",
},
{
key: "mmcode",
title: this.l6("mmcode"),
align: "center",
high: true,
},
{
key: "levelTitle",
title: this.l6("levelTitle"),
align: "left",
high: true,
},
{
key: "levelId",
title: this.l6("levelId"),
align: "left",
high: true,
hide: true,
import: true,
},
{
key: "drawingNo",
title: this.l6("drawingNo"),
align: "right",
high: true,
},
{
key: "madeCompanyTitle",
title: this.l6("madeCompanyTitle"),
align: "center",
width: 260,
high: true,
},
{
key: "madeCompany",
title: this.l6("madeCompany"),
align: "center",
width: 260,
high: true,
hide: true,
import: true,
},
{
key: "version",
title: this.l6("version"),
align: "center",
width: 260,
high: true,
hide: true,
import: true,
},
{
key: "materialId",
title: this.l6("materialId"),
align: "center",
width: 260,
high: true,
hide: true,
import: true,
},
],
tdHeightExcel: "",
excelData: [],
......@@ -1086,6 +1152,9 @@ export default {
case 5:
this.loadColum(this.columns5);
break;
case 6:
this.loadColum(this.columns6);
break;
default:
this.loadColum(this.columns0);
}
......@@ -1121,6 +1190,9 @@ export default {
case 5:
this.importRountingBom();
break;
case 6:
this.importProductMix();
break;
default:
//this.loadColum(this.columns1);
}
......@@ -1459,7 +1531,50 @@ export default {
return routingHeaderId
},
//插入工艺规程 及工艺相关end
//插入产品管理
importProductMix() {
let tempData = this.$u.clone(this.dataIm);
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: ele.levelId ? ele.levelId : null,
levelTitle: ele.levelTitle ? ele.levelTitle : "",
materialId: ele.materialId ? ele.materialId : "",
};
if (ele.name && ele.name != '') {
tempList.push(obj);
}
});
if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!");
} else {
let parms = {
list: tempList,
};
let url = `${technologyUrl}productinfoimportservice/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按钮
changeExcel(val) {
if (val == 1) {
......@@ -1495,6 +1610,10 @@ export default {
key = "routingsupporting" + "." + key;
return this.$t(key);
},
l6(key) {
key = "product_info" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
......
<template>
<div>
<DataGrid
:columns="columns"
ref="grid"
:conditions="easySearch"
:action="action"
exportTitle="工艺Bom"
>
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入关键字物料名称" v-model="easySearch.keys.value" clearable />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<template slot="searchForm">
<Search :headid="hid" />
</template>
<template slot="buttons">
<Button type="primary" @click="add" v-if="headerStatus==0||headerStatus==4">新增</Button>
<Button @click="openModalIm">导入</Button>
</template>
<div>
<DataGrid :columns="columns" ref="grid" :conditions="easySearch" :action="action" exportTitle="工艺Bom">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入关键字物料名称" v-model="easySearch.keys.value" clearable />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<template slot="searchForm">
<Search :headid="hid" />
</template>
<template slot="buttons">
<Button type="primary" @click="add" v-if="headerStatus==0||headerStatus==4">新增</Button>
<Button @click="openModalIm">导入</Button>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="850" footer-hide>
<component
:is="detail"
:eid="curId"
:headid="hid"
:productBomId="productBomId"
:materialId="materialId"
@on-close="cancel"
@on-ok="ok"
/>
<component :is="detail" :eid="curId" :headid="hid" :productBomId="productBomId" :materialId="materialId" @on-close="cancel" @on-ok="ok" />
</Modal>
<ImportExcel
ref="importExcel"
@on-get-data="getData"
:modalTitle="temTitle"
:columns="columns"
:open="ModalIm"
@on-cancel="ModalImCancel"
@on-ok="ok"
/>
</div>
<ImportExcel ref="importExcel" @on-get-data="getData" :modalTitle="temTitle" :columns="columns" :open="ModalIm" @on-cancel="ModalImCancel" @on-ok="ok" />
</div>
</template>
<script>
import Api from "./api";
import Search from "./search";
export default {
name: "list",
components: {
Search,
},
head: {
title: "工艺配套表",
author: "henq",
description: "routingsupporting 4/27/2020 10:35:33 AM",
},
props: ["headerid"],
data() {
return {
materialId: null,
action: Api.index,
easySearch: {
keys: {
op: "nameMaterial",
value: null,
name: "list",
components: {
Search,
},
head: {
title: "工艺配套表",
author: "henq",
description: "routingsupporting 4/27/2020 10:35:33 AM",
},
props: ["headerid"],
data() {
return {
materialId: null,
action: Api.index,
easySearch: {
keys: {
op: "nameMaterial",
value: null,
},
// routingHeaderId: { op: "Equal", value: this.headerid },
routingHeaderId: {
op: "Equal",
value: -1,
},
},
modal: false,
title: "新增",
detail: null,
curId: 0,
hid: 0,
columns: [{
key: "routingDetailNo",
title: this.l("routingDetailNo"),
align: "left",
high: true,
width: 100,
sortable: true,
},
{
key: "routingHeaderId",
title: this.l("routingHeaderName"),
hide: true,
import: true,
techKey: "1",
render: (h, params) => {
return h(
"span", {},
this.getRoutingHeaderName(params.row.routingHeaderId)
);
},
},
{
key: "routingDetailName",
title: this.l("routingDetailName"),
align: "left",
high: true,
},
{
key: "routingDetailId",
title: this.l("routingDetailId"),
hide: true,
import: true,
},
{
key: "materialType",
title: this.l("materialType"),
align: "center",
easy: true,
high: true,
code: "mes_xingchi_resource.material.materialReType",
width: 100,
},
{
key: "materialNumber",
title: this.l("materialNumber"),
align: "left",
easy: true,
high: true,
},
{
key: "materialId",
title: this.l("materialId"),
align: "left",
hide: true,
import: true,
},
{
key: "nameMaterial",
title: this.l("nameMaterial"),
align: "left",
easy: true,
high: true,
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "left",
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
hide: false,
type: "user",
align: "left",
},
{
key: "quantity",
title: this.l("quantity"),
high: true,
width: 80,
},
{
key: "brand",
title: this.l("brand"),
align: "left",
easy: true,
high: true,
},
{
key: "specifications",
title: this.l("specifications"),
align: "left",
easy: true,
high: true,
},
{
key: "xhgg",
title: this.l("xhgg"),
align: "left",
easy: true,
high: true,
hide: true,
},
{
key: "texture",
title: this.l("texture"),
align: "left",
easy: true,
high: true,
},
{
key: "procurementStandards",
title: this.l("procurementStandards"),
align: "left",
easy: true,
high: true,
},
{
key: "qualityGrade",
title: this.l("qualityGrade"),
align: "left",
easy: true,
high: true,
},
{
key: "drawNum",
title: this.l("drawNum"),
align: "left",
easy: true,
high: true,
},
{
key: "creationTime",
title: this.l("creationTime"),
hide: true,
align: "left",
hide: true,
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
hide: true,
align: "left",
hide: true,
type: "user",
},
// {
// key: "lastModificationTime",
// title: this.l("lastModificationTime"),
// hide: true,
// align: "left",
// hide: true,
// },
// {
// key: "lastModifierUserId",
// title: this.l("lastModifierUserId"),
// hide: true,
// align: "left",
// hide: true,
// type: "user",
// },
{
title: "操作",
key: "action",
width: 180,
align: "center",
render: (h, params) => {
return h(
"div", {
class: "action",
},
[
h(
"op", {
attrs: {
oprate: "detail",
},
on: {
click: () => this.view(params.row),
},
},
"查看"
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h(
"op", {
attrs: {
oprate: "edit",
},
on: {
click: () => this.edit(params.row.id),
},
},
this.headerStatus == 4 || this.headerStatus == 0 ? "编辑" : ""
),
h(
"op", {
attrs: {
oprate: "delete",
},
on: {
click: () => this.remove(params.row.id),
},
},
this.headerStatus == 4 || this.headerStatus == 0 ? "删除" : ""
),
]
);
},
},
],
headerStatus: -1,
productBomId: -1,
ModalIm: false,
temTitle: "工艺Bom",
routingHeaderData: [],
};
},
created() {
this.hid = this.easySearch.routingHeaderId.value;
this.headerStatus = this.$route.query.headerStatus;
this.productBomId = Number(this.$route.query.productBomId);
if (this.headerid != -1) {
this.easySearch.routingHeaderId.value = this.headerid;
} else {
this.easySearch.routingHeaderId.value = this.$route.query.id;
}
},
mounted() {
console.log(this);
this.getRoutingHeaderData();
this.search();
},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
// routingHeaderId: { op: "Equal", value: this.headerid },
routingHeaderId: {
op: "Equal",
value: -1,
search() {
this.$refs.grid.reload(this.easySearch);
},
},
modal: false,
title: "新增",
detail: null,
curId: 0,
hid: 0,
columns: [
{
key: "routingDetailNo",
title: this.l("routingDetailNo"),
align: "left",
high: true,
width: 100,
sortable: true,
add() {
this.curId = 0;
this.hid = Number(this.headerid);
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
},
// {
// key: "routingHeaderId",
// title: this.l("routingHeaderName"),
// hide: true,
// import: true,
// techKey: "1",
// render: (h, params) => {
// return h(
// "span",
// {},
// this.getRoutingHeaderName(params.row.routingHeaderId)
// );
// },
// },
{
key: "routingDetailName",
title: this.l("routingDetailName"),
align: "left",
high: true,
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
},
// {
// key: "routingDetailId",
// title: this.l("routingDetailId"),
// hide: true,
// import: true,
// },
// {
// key: "materialType",
// title: this.l("materialType"),
// align: "center",
// easy: true,
// high: true,
// code: "mes_xingchi_resource.material.materialReType",
// width: 100,
// },
{
key: "materialNumber",
title: this.l("materialNumber"),
align: "left",
easy: true,
high: true,
view(row) {
this.curId = row.id;
this.materialId = row.materialId;
this.title = "查看详情";
this.detail = () => import("./detail");
this.modal = true;
},
// {
// key: "materialId",
// title: this.l("materialId"),
// align: "left",
// hide: true,
// import: true,
// },
{
key: "nameMaterial",
title: this.l("nameMaterial"),
align: "left",
easy: true,
high: true,
edit(id) {
this.curId = id;
this.hid = Number(this.headerid);
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "left",
remove(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("删除成功");
}
});
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
hide: false,
type: "user",
align: "left",
cancel() {
this.curId = 0;
this.modal = false;
},
{
key: "quantity",
title: this.l("quantity"),
high: true,
width: 80,
//批量导入start
//导入功能
openModalIm() {
this.ModalIm = true;
},
// {
// key: "brand",
// title: this.l("brand"),
// align: "left",
// easy: true,
// high: true,
// },
// {
// key: "specifications",
// title: this.l("specifications"),
// align: "left",
// easy: true,
// high: true,
// },
// {
// key: "xhgg",
// title: this.l("xhgg"),
// align: "left",
// easy: true,
// high: true,
// hide: true,
// },
// {
// key: "texture",
// title: this.l("texture"),
// align: "left",
// easy: true,
// high: true,
// },
// {
// key: "procurementStandards",
// title: this.l("procurementStandards"),
// align: "left",
// easy: true,
// high: true,
// },
// {
// key: "qualityGrade",
// title: this.l("qualityGrade"),
// align: "left",
// easy: true,
// high: true,
// },
// {
// key: "drawNum",
// title: this.l("drawNum"),
// align: "left",
// easy: true,
// high: true,
// },
// {
// key: "creationTime",
// title: this.l("creationTime"),
// hide: true,
// align: "left",
// hide: true,
// },
// {
// key: "creatorUserId",
// title: this.l("creatorUserId"),
// hide: true,
// align: "left",
// hide: true,
// type: "user",
// },
// {
// key: "lastModificationTime",
// title: this.l("lastModificationTime"),
// hide: true,
// align: "left",
// hide: true,
// },
// {
// key: "lastModifierUserId",
// title: this.l("lastModifierUserId"),
// hide: true,
// align: "left",
// hide: true,
// type: "user",
// },
{
title: "操作",
key: "action",
width: 180,
align: "center",
render: (h, params) => {
return h(
"div",
{
class: "action",
},
[
h(
"op",
{
attrs: {
oprate: "detail",
},
on: {
click: () => this.view(params.row),
},
},
"查看"
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h(
"op",
{
attrs: {
oprate: "edit",
},
on: {
click: () => this.edit(params.row.id),
},
},
this.headerStatus == 4 || this.headerStatus == 0 ? "编辑" : ""
),
h(
"op",
{
attrs: {
oprate: "delete",
},
on: {
click: () => this.remove(params.row.id),
},
},
this.headerStatus == 4 || this.headerStatus == 0 ? "删除" : ""
),
]
);
},
ModalImCancel() {
this.ModalIm = false;
},
getData(val) {
let url = `${technologyUrl}routingsupportingimportservice/import`;
this.$refs.importExcel.deelData(url, this.cols, this.formatMethod(val));
},
//根据页面二次处理数据
formatMethod(val) {
// alert(JSON.stringify(val))
let tempData = this.$u.clone(val);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
routingHeaderId: Number(this.headerid),
routingDetailId: ele.routingDetailId ?
Number(ele.routingDetailId) : null,
routingDetailNo: ele.routingDetailNo ?
Number(ele.routingDetailNo) : null,
routingDetailName: ele.routingDetailName ? ele.routingDetailName : "",
routingStepId: 0,
quantity: ele.quantity ? Number(ele.quantity) : 0,
materialId: ele.materialId ? ele.materialId : "",
materialType: ele.materialType ? Number(ele.materialType) : "",
materialNumber: ele.materialNumber ? ele.materialNumber : "",
nameMaterial: ele.nameMaterial ? ele.nameMaterial : "",
brand: ele.brand ? ele.brand : "",
specifications: ele.specifications ? ele.specifications : "",
xhgg: ele.xhgg ? ele.xhgg : "",
texture: ele.texture ? ele.texture : "",
procurementStandards: ele.procurementStandards ?
ele.procurementStandards : "",
qualityGrade: ele.qualityGrade ? ele.qualityGrade : "",
state: null,
extend: "",
remark: "",
drawNum: ele.drawNum ? ele.drawNum : "",
json: {}
};
if (ele.routingDetailId && ele.routingDetailId != null) {
obj.ico = false;
} else {
obj.ico = true;
}
tempList.push(obj);
});
return tempList;
},
//批量导入end
//工艺规程id和name之间的转换
//获取工艺规程信息
getRoutingHeaderData() {
let data = {
conditions: [],
};
Api.getRoutingheaderList(data).then((r) => {
if (r.success) {
this.routingHeaderData = r.result || [];
}
});
},
//根据工艺规程ID获得name
getRoutingHeaderName(val) {
let routingHeaderDataList = this.$u.clone(this.routingHeaderData);
let routingHeaderName = "";
routingHeaderDataList.forEach((ele) => {
if (ele.id == Number(val)) {
routingHeaderName = ele.name;
}
});
return routingHeaderName;
},
l(key) {
let vkey = "routingsupporting" + "." + key;
return this.$t(vkey) || key;
},
],
headerStatus: -1,
productBomId: -1,
ModalIm: false,
temTitle: "工艺Bom",
routingHeaderData: [],
};
},
created() {
this.hid = this.easySearch.routingHeaderId.value;
this.headerStatus = this.$route.query.headerStatus;
this.productBomId = Number(this.$route.query.productBomId);
if (this.headerid != -1) {
this.easySearch.routingHeaderId.value = this.headerid;
} else {
this.easySearch.routingHeaderId.value = this.$route.query.id;
}
},
mounted() {
console.log(this);
this.getRoutingHeaderData();
this.search();
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
add() {
this.curId = 0;
this.hid = Number(this.headerid);
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
},
view(row) {
this.curId = row.id;
this.materialId = row.materialId;
this.title = "查看详情";
this.detail = () => import("./detail");
this.modal = true;
},
edit(id) {
this.curId = id;
this.hid = Number(this.headerid);
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
},
remove(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("删除成功");
}
});
},
cancel() {
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) {
// alert(JSON.stringify(val))
let tempData = this.$u.clone(val);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
routingHeaderId: Number(this.headerid),
routingDetailId: ele.routingDetailId
? Number(ele.routingDetailId)
: null,
routingDetailNo: ele.routingDetailNo
? Number(ele.routingDetailNo)
: null,
routingDetailName: ele.routingDetailName ? ele.routingDetailName : "",
routingStepId: 0,
quantity: ele.quantity ? Number(ele.quantity) : 0,
materialId: ele.materialId ? ele.materialId : "",
materialType: ele.materialType ? Number(ele.materialType) : "",
materialNumber: ele.materialNumber ? ele.materialNumber : "",
nameMaterial: ele.nameMaterial ? ele.nameMaterial : "",
brand: ele.brand ? ele.brand : "",
specifications: ele.specifications ? ele.specifications : "",
xhgg: ele.xhgg ? ele.xhgg : "",
texture: ele.texture ? ele.texture : "",
procurementStandards: ele.procurementStandards
? ele.procurementStandards
: "",
qualityGrade: ele.qualityGrade ? ele.qualityGrade : "",
state: null,
extend: "",
remark: "",
drawNum: ele.drawNum ? ele.drawNum : "",
};
if (ele.routingDetailId && ele.routingDetailId != null) {
obj.ico = false;
} else {
obj.ico = true;
}
tempList.push(obj);
});
return tempList;
},
//批量导入end
//工艺规程id和name之间的转换
//获取工艺规程信息
getRoutingHeaderData() {
let data = {
conditions: [],
};
Api.getRoutingheaderList(data).then((r) => {
if (r.success) {
this.routingHeaderData = r.result || [];
}
});
},
//根据工艺规程ID获得name
getRoutingHeaderName(val) {
let routingHeaderDataList = this.$u.clone(this.routingHeaderData);
let routingHeaderName = "";
routingHeaderDataList.forEach((ele) => {
if (ele.id == Number(val)) {
routingHeaderName = ele.name;
}
});
return routingHeaderName;
},
l(key) {
let vkey = "routingsupporting" + "." + key;
return this.$t(vkey) || key;
},
},
};
</script>
......
<template>
<div class="product-m">
<DataGrid
:columns="columns"
ref="grid"
:action="action"
:conditions="easySearch"
:type="typeInfo"
:high="false"
:span="6"
:lazy="true"
>
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入物料编号/名称" v-model="easySearch.keys.value" />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="add">新增</Button>&nbsp;
</template>
<template slot="buttons">
<Button :icon="iconInfo" shape="circle" :title="titleInfo" @click="changeShwo"></Button>
</template>
<template slot="card" slot-scope="{row}">
<div class="body-card">
<Row class="title-i">
<Col :span="16">
<Ellipsis :text="row.name" :length="12" tooltip />
</Col>
<Col :span="8" class="btn-click">{{row.mmcode}}</Col>
</Row>
<Row class="row-down" :gutter="10">
<Col span="7">
<div class="img-i">
<img :src="downUrl +row.productUrl" v-if="row.productUrl" />
<!-- onerror="this.src='/imgicon/chan_Pin.png'" -->
<img src="@/assets/imgicon/chan_Pin.png" v-else width="100%" height="100%" />
</div>
</Col>
<Col span="17" class="c">
<div>分类:{{row.levelTitle}}</div>
<div>图号:{{row.drawingNo}}</div>
<div>主制单位:{{row.madeCompanyTitle}}</div>
<p class="a-icon">
<a @click="bom(row)">
<Icon type="md-git-merge" />BOM
</a>&nbsp;
<a @click="edit(row)">
<Icon type="md-create" />编辑
</a>&nbsp;
<a @click="remove(row)">
<Icon type="ios-trash" />删除
</a>&nbsp;
<a @click="view(row)">
<Icon type="md-document" />详情
</a>
</p>
</Col>
</Row>
</div>
</template>
<div class="product-m">
<DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch" :type="typeInfo" :high="false" :span="6" :lazy="true" exportTitle="产品管理">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入物料编号/名称" v-model="easySearch.keys.value" />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<template slot="searchForm">
<Search />
</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">
<Row class="title-i">
<Col :span="16">
<Ellipsis :text="row.name" :length="12" tooltip />
</Col>
<Col :span="8" class="btn-click">{{row.mmcode}}</Col>
</Row>
<Row class="row-down" :gutter="10">
<Col span="7">
<div class="img-i">
<img :src="downUrl +row.productUrl" v-if="row.productUrl" />
<!-- onerror="this.src='/imgicon/chan_Pin.png'" -->
<img src="@/assets/imgicon/chan_Pin.png" v-else width="100%" height="100%" />
</div>
</Col>
<Col span="17" class="c">
<div>分类:{{row.levelTitle}}</div>
<div>图号:{{row.drawingNo}}</div>
<div>主制单位:{{row.madeCompanyTitle}}</div>
<p class="a-icon">
<a @click="bom(row)">
<Icon type="md-git-merge" />BOM
</a>&nbsp;
<a @click="edit(row)">
<Icon type="md-create" />编辑
</a>&nbsp;
<a @click="remove(row)">
<Icon type="ios-trash" />删除
</a>&nbsp;
<a @click="view(row)">
<Icon type="md-document" />详情
</a>
</p>
</Col>
</Row>
</div>
</template>
</DataGrid>
<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 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>
</div>
<ImportExcel ref="importExcel" @on-get-data="getData" :modalTitle="temTitle" :columns="columns" :open="ModalIm" @on-cancel="ModalImCancel" @on-ok="ok" />
</div>
</template>
<script>
import Api from "./api";
import Search from "./search";
export default {
name: "list",
components: {
Search,
},
head: {
title: "",
author: "henq",
description: "product_info 5/20/2020 3:13:51 PM",
},
props: {
parent: {
id: Number,
parentName: String,
ids: String,
bomId: Number,
name: "list",
components: {
Search,
},
head: {
title: "",
author: "henq",
description: "product_info 5/20/2020 3:13:51 PM",
},
},
data() {
return {
action: Api.index,
fullscreen: false,
easySearch: {
keys: { op: "mmcode,name", value: null },
levelId: { op: "In", value: this.id },
upId: { op: "In", value: 0 },
},
modal: false,
title: "新增",
detail: null,
downUrl: fileUrlDown,
curId: 0,
columns: [
{
key: "id",
title: this.$t("id"),
hide: true,
align: "left",
high: true,
props: {
parent: {
id: Number,
parentName: String,
ids: String,
bomId: Number,
},
{
title: this.l("name"),
key: "name",
},
data() {
return {
action: Api.index,
fullscreen: false,
easySearch: {
keys: {
op: "mmcode,name",
value: null
},
levelId: {
op: "In",
value: this.id
},
upId: {
op: "In",
value: 0
},
},
modal: false,
title: "新增",
detail: null,
downUrl: fileUrlDown,
curId: 0,
columns: [{
key: "id",
title: this.$t("id"),
hide: true,
align: "left",
high: true,
},
{
title: this.l("name"),
key: "name",
align: "left",
},
{
key: "mmcode",
title: this.l("mmcode"),
align: "center",
high: true,
},
{
key: "productUrl",
title: this.l("productUrl"),
align: "left",
high: true,
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"a",
align: "left",
},
{
key: "mmcode",
title: this.l("mmcode"),
align: "center",
high: true,
},
{
attrs: {
oprate: "detail",
// href: this.fileUrlPath,
// target: "_blank"
},
on: {
click: () => {
this.downFile(params.row.productUrl);
key: "productUrl",
title: this.l("productUrl"),
align: "center",
high: true,
render: (h, params) => {
return h("div", {
class: "action"
}, [
h(
params.row.productUrl.length > 0 ? "a" : "span", {
attrs: {
oprate: "detail",
},
on: {
click: () => {
params.row.productUrl.length > 0 ? this.downFile(params.row.productUrl) : null;
},
},
},
params.row.productUrl.length > 0 ? "查看图片" : '暂无图片'
),
]);
},
},
},
"查看图片"
),
]);
},
},
{
key: "levelTitle",
title: this.l("levelTitle"),
align: "left",
high: true,
},
{
key: "drawingNo",
title: this.l("drawingNo"),
align: "right",
high: true,
},
{
key: "madeCompanyTitle",
title: this.l("madeCompanyTitle"),
align: "center",
width: 260,
high: true,
},
{
title: "操作",
key: "action",
width: 200,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "edit" },
on: {
click: () => this.bom(params.row),
},
key: "levelTitle",
title: this.l("levelTitle"),
align: "left",
high: true,
},
"BOM"
),
h(
"op",
{
attrs: { oprate: "edit" },
on: {
click: () => this.edit(params.row),
},
key: "levelId",
title: this.l("levelId"),
align: "left",
high: true,
hide: true,
import: true,
},
"编辑"
),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row) },
key: "drawingNo",
title: this.l("drawingNo"),
align: "right",
high: true,
},
"删除"
),
h(
"op",
{
attrs: { oprate: "view" },
on: {
click: () => this.view(params.row),
},
key: "madeCompanyTitle",
title: this.l("madeCompanyTitle"),
align: "center",
width: 260,
high: true,
},
"详情"
),
]);
},
},
],
typeInfo: "card",
iconInfo: "md-apps",
titleInfo: "卡片模式",
};
},
mounted() {
this.$refs.grid.reload(this.easySearch);
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
changeShwo() {
//显示模式切换
if (this.typeInfo == "card") {
this.typeInfo = "table";
this.iconInfo = "md-list";
this.titleInfo = "列表模式";
} else {
this.typeInfo = "card";
this.iconInfo = "md-apps";
this.titleInfo = "卡片模式";
}
},
downFile(url) {
let url1 = this.downUrl + url;
if (url) {
window.open(url1, "_blank");
} else {
this.$Message.error("暂无图片");
}
},
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
add() {
if (this.parent.id) {
this.curId = 0;
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
this.fullscreen = false;
} else {
this.$Message.error("请先选择产品分类");
}
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
this.fullscreen = false;
},
view(row) {
this.curId = row.id;
this.parent.id = row.levelId;
this.parent.parentName = row.levelTitle;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
this.fullscreen = false;
},
edit(row) {
this.curId = row.id;
this.parent.id = row.levelId;
this.parent.parentName = row.levelTitle;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
this.fullscreen = false;
},
bom(row) {
this.curId = row.id;
this.parent.bomId = row.bomId;
this.parent.id = row.levelId;
this.parent.parentName = row.levelTitle;
this.title = "BOM";
this.detail = () => import("./bom");
this.modal = true;
this.fullscreen = 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",
width: 200,
align: "center",
render: (h, params) => {
return h("div", {
class: "action"
}, [
h(
"op", {
attrs: {
oprate: "edit"
},
on: {
click: () => this.bom(params.row),
},
},
"BOM"
),
h(
"op", {
attrs: {
oprate: "edit"
},
on: {
click: () => this.edit(params.row),
},
},
"编辑"
),
h(
"op", {
attrs: {
oprate: "delete"
},
on: {
click: () => this.remove(params.row)
},
},
"删除"
),
h(
"op", {
attrs: {
oprate: "view"
},
on: {
click: () => this.view(params.row),
},
},
"详情"
),
]);
},
},
],
typeInfo: "card",
iconInfo: "md-apps",
titleInfo: "卡片模式",
ModalIm: false,
temTitle: "产品管理",
};
},
remove(row) {
Api.delete(row.bomId).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("删除成功");
}
});
mounted() {
this.$refs.grid.reload(this.easySearch);
},
cancel() {
this.curId = 0;
this.modal = false;
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
l(key) {
let vkey = "product_info" + "." + key;
return this.$t(vkey) || key;
methods: {
changeShwo() {
//显示模式切换
if (this.typeInfo == "card") {
this.typeInfo = "table";
this.iconInfo = "md-list";
this.titleInfo = "列表模式";
} else {
this.typeInfo = "card";
this.iconInfo = "md-apps";
this.titleInfo = "卡片模式";
}
},
downFile(url) {
let url1 = this.downUrl + url;
if (url) {
window.open(url1, "_blank");
} else {
this.$Message.error("暂无图片");
}
},
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
add() {
if (this.parent.id) {
this.curId = 0;
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
this.fullscreen = false;
} else {
this.$Message.error("请先选择产品分类");
}
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
this.fullscreen = false;
},
view(row) {
this.curId = row.id;
this.parent.id = row.levelId;
this.parent.parentName = row.levelTitle;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
this.fullscreen = false;
},
edit(row) {
this.curId = row.id;
this.parent.id = row.levelId;
this.parent.parentName = row.levelTitle;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
this.fullscreen = false;
},
bom(row) {
this.curId = row.id;
this.parent.bomId = row.bomId;
this.parent.id = row.levelId;
this.parent.parentName = row.levelTitle;
this.title = "BOM";
this.detail = () => import("./bom");
this.modal = true;
this.fullscreen = true;
},
remove(row) {
Api.delete(row.bomId).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("删除成功");
}
});
},
cancel() {
this.curId = 0;
this.modal = false;
},
l(key) {
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) {
if (v) {
let data = {
levelId: { op: "In", value: this.parent.ids },
upId: { op: "In", value: 0 },
};
this.$refs.grid.reload(data);
}
watch: {
"parent.id"(v) {
if (v) {
let data = {
levelId: {
op: "In",
value: this.parent.ids
},
upId: {
op: "In",
value: 0
},
};
this.$refs.grid.reload(data);
}
},
},
},
};
</script>
<style lang="less">
.product-m {
.body-card {
border: 1px solid rgba(38, 128, 235, 1);
margin: 10px;
border-radius: 4px;
.title-i {
border-bottom: 1px solid #2680eb;
padding: 0 10px;
height: 35px;
line-height: 35px;
background: rgba(38, 128, 235, 0.2);
color: #2680eb;
.btn-click {
text-align: right;
}
}
.row-down {
padding: 10px;
.img-i {
width: 90px;
background: #eee;
height: 90px;
margin-right: 15px;
// overflow: hidden;
img {
width: 90px;
height: 90px;
.body-card {
border: 1px solid rgba(38, 128, 235, 1);
margin: 10px;
border-radius: 4px;
.title-i {
border-bottom: 1px solid #2680eb;
padding: 0 10px;
height: 35px;
line-height: 35px;
background: rgba(38, 128, 235, 0.2);
color: #2680eb;
.btn-click {
text-align: right;
}
}
.row-down {
padding: 10px;
.img-i {
width: 90px;
background: #eee;
height: 90px;
margin-right: 15px;
// overflow: hidden;
img {
width: 90px;
height: 90px;
}
}
.c div {
margin-bottom: 8px;
}
.a-icon {
text-align: right;
margin-bottom: -5px;
}
}
}
.c div {
margin-bottom: 8px;
}
.a-icon {
text-align: right;
margin-bottom: -5px;
}
}
}
}
</style>
\ No newline at end of file
</style>
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