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"
>
<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"
>
<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"
>
<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: {
......@@ -74,7 +36,7 @@ export default {
type: String,
default: "Select"
},
border: {//radio可以选择border属性
border: { //radio可以选择border属性
type: Boolean,
default: false
},
......@@ -165,6 +127,7 @@ export default {
}
};
</script>
<style lang="less">
.w200 {
width: 200px;
......
......@@ -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"
>
<div>
<DataGrid :columns="columns" ref="grid" :conditions="easySearch" :action="action" exportTitle="工艺Bom">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
......@@ -26,26 +20,10 @@
</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>
......@@ -82,8 +60,7 @@ export default {
detail: null,
curId: 0,
hid: 0,
columns: [
{
columns: [{
key: "routingDetailNo",
title: this.l("routingDetailNo"),
align: "left",
......@@ -91,42 +68,41 @@ export default {
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: "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: "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: "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"),
......@@ -134,13 +110,13 @@ export default {
easy: true,
high: true,
},
// {
// key: "materialId",
// title: this.l("materialId"),
// align: "left",
// hide: true,
// import: true,
// },
{
key: "materialId",
title: this.l("materialId"),
align: "left",
hide: true,
import: true,
},
{
key: "nameMaterial",
title: this.l("nameMaterial"),
......@@ -166,71 +142,71 @@ export default {
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: "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"),
......@@ -253,14 +229,12 @@ export default {
align: "center",
render: (h, params) => {
return h(
"div",
{
"div", {
class: "action",
},
[
h(
"op",
{
"op", {
attrs: {
oprate: "detail",
},
......@@ -272,8 +246,7 @@ export default {
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h(
"op",
{
"op", {
attrs: {
oprate: "edit",
},
......@@ -284,8 +257,7 @@ export default {
this.headerStatus == 4 || this.headerStatus == 0 ? "编辑" : ""
),
h(
"op",
{
"op", {
attrs: {
oprate: "delete",
},
......@@ -322,7 +294,10 @@ export default {
this.getRoutingHeaderData();
this.search();
},
async fetch({ store, params }) {
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
......@@ -382,7 +357,7 @@ export default {
this.ModalIm = false;
},
getData(val) {
let url = `${technologyUrl}productinfoimportservice/import`;
let url = `${technologyUrl}routingsupportingimportservice/import`;
this.$refs.importExcel.deelData(url, this.cols, this.formatMethod(val));
},
//根据页面二次处理数据
......@@ -393,12 +368,10 @@ export default {
tempData.forEach((ele) => {
let obj = {
routingHeaderId: Number(this.headerid),
routingDetailId: ele.routingDetailId
? Number(ele.routingDetailId)
: null,
routingDetailNo: ele.routingDetailNo
? Number(ele.routingDetailNo)
: null,
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,
......@@ -410,14 +383,14 @@ export default {
specifications: ele.specifications ? ele.specifications : "",
xhgg: ele.xhgg ? ele.xhgg : "",
texture: ele.texture ? ele.texture : "",
procurementStandards: ele.procurementStandards
? ele.procurementStandards
: "",
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;
......
<template>
<div class="product-m">
<DataGrid
:columns="columns"
ref="grid"
:action="action"
:conditions="easySearch"
:type="typeInfo"
:high="false"
:span="6"
:lazy="true"
>
<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">
......@@ -24,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">
......@@ -68,18 +58,13 @@
</div>
</template>
</DataGrid>
<Modal
v-model="modal"
:title="title"
width="1200"
footer-hide
:fullscreen="fullscreen"
:mask-closable="false"
>
<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";
......@@ -106,17 +91,25 @@ export default {
action: Api.index,
fullscreen: false,
easySearch: {
keys: { op: "mmcode,name", value: null },
levelId: { op: "In", value: this.id },
upId: { op: "In", value: 0 },
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: [
{
columns: [{
key: "id",
title: this.$t("id"),
hide: true,
......@@ -138,25 +131,24 @@ export default {
{
key: "productUrl",
title: this.l("productUrl"),
align: "left",
align: "center",
high: true,
render: (h, params) => {
return h("div", { class: "action" }, [
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 ? "查看图片" : '暂无图片'
),
]);
},
......@@ -167,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"),
......@@ -180,17 +180,47 @@ 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",
width: 200,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
return h("div", {
class: "action"
}, [
h(
"op",
{
attrs: { oprate: "edit" },
"op", {
attrs: {
oprate: "edit"
},
on: {
click: () => this.bom(params.row),
},
......@@ -198,9 +228,10 @@ export default {
"BOM"
),
h(
"op",
{
attrs: { oprate: "edit" },
"op", {
attrs: {
oprate: "edit"
},
on: {
click: () => this.edit(params.row),
},
......@@ -208,17 +239,21 @@ export default {
"编辑"
),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row) },
"op", {
attrs: {
oprate: "delete"
},
on: {
click: () => this.remove(params.row)
},
},
"删除"
),
h(
"op",
{
attrs: { oprate: "view" },
"op", {
attrs: {
oprate: "view"
},
on: {
click: () => this.view(params.row),
},
......@@ -232,12 +267,17 @@ export default {
typeInfo: "card",
iconInfo: "md-apps",
titleInfo: "卡片模式",
ModalIm: false,
temTitle: "产品管理",
};
},
mounted() {
this.$refs.grid.reload(this.easySearch);
},
async fetch({ store, params }) {
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
......@@ -331,13 +371,65 @@ 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) {
if (v) {
let data = {
levelId: { op: "In", value: this.parent.ids },
upId: { op: "In", value: 0 },
levelId: {
op: "In",
value: this.parent.ids
},
upId: {
op: "In",
value: 0
},
};
this.$refs.grid.reload(data);
}
......@@ -345,12 +437,14 @@ export default {
},
};
</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;
......@@ -358,26 +452,32 @@ export default {
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;
......
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