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 { ...@@ -90,6 +90,7 @@ export default {
pageSize: 20, pageSize: 20,
conditions: [], conditions: [],
}, },
searchConditions: this.search,
pageSizeOpts: [20, 50, 100], pageSizeOpts: [20, 50, 100],
tableHeight: 0, tableHeight: 0,
firstY: 0, firstY: 0,
...@@ -408,6 +409,7 @@ export default { ...@@ -408,6 +409,7 @@ export default {
}, },
reload(conditions) { reload(conditions) {
var where = []; var where = [];
this.searchConditions = conditions
if (conditions) { if (conditions) {
Object.keys(conditions).forEach((u) => { Object.keys(conditions).forEach((u) => {
let v = conditions[u].value; let v = conditions[u].value;
...@@ -482,7 +484,7 @@ export default { ...@@ -482,7 +484,7 @@ export default {
export2Excel() { export2Excel() {
//当前显示数据 //当前显示数据
var where = []; var where = [];
var conditions = this.conditions; var conditions = this.searchConditions;
if (conditions) { if (conditions) {
Object.keys(conditions).forEach((u) => { Object.keys(conditions).forEach((u) => {
let v = conditions[u].value; let v = conditions[u].value;
...@@ -496,7 +498,7 @@ export default { ...@@ -496,7 +498,7 @@ export default {
} }
}); });
v = times.join(","); v = times.join(",");
} else if (op.indexOf("In") > -1) { } else if (op.indexOf("In") > -1 && Array.isArray(v)) {
v = v.join(","); v = v.join(",");
} }
if (!this.$u.isNull(v)) { if (!this.$u.isNull(v)) {
......
<template> <template>
<div> <div>
<RadioGroup <RadioGroup v-if="type === 'radio'" ref="dicradio" v-model="name" @on-change="change" :vertical="vertical">
v-if="type === 'radio'" <Radio v-for="(item, index) in dic" :disabled="item.disabled" :label="item.value" :key="index" :border="border">
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> <span :title="item.value">{{ item.label }}</span>
</Radio> </Radio>
</RadioGroup> </RadioGroup>
<CheckboxGroup <CheckboxGroup v-else-if="type === 'checkbox'" ref="dicradio" v-model="name" @on-change="change" :vertical="vertical">
v-else-if="type === 'checkbox'" <Checkbox v-for="(item, index) in dic" :disabled="item.disabled" :label="item.value" :key="index" :border="border">
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> <span :title="item.value">{{ item.label }}</span>
</Checkbox> </Checkbox>
</CheckboxGroup> </CheckboxGroup>
<Select <Select v-else :placeholder="placeholder" v-model="name" @on-change="change" :disabled="disabled" :multiple="multiple" clearable :transfer="true">
v-else <Option v-for="(item, i) in dic" :value="item.value" :disabled="item.disabled" :key="item.value" :label="item.label">
: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> <span :title="item.value">{{item.label}}</span>
</Option> </Option>
</Select> </Select>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
model: { model: {
...@@ -74,7 +36,7 @@ export default { ...@@ -74,7 +36,7 @@ export default {
type: String, type: String,
default: "Select" default: "Select"
}, },
border: {//radio可以选择border属性 border: { //radio可以选择border属性
type: Boolean, type: Boolean,
default: false default: false
}, },
...@@ -165,6 +127,7 @@ export default { ...@@ -165,6 +127,7 @@ export default {
} }
}; };
</script> </script>
<style lang="less"> <style lang="less">
.w200 { .w200 {
width: 200px; width: 200px;
......
...@@ -1448,7 +1448,7 @@ export default { ...@@ -1448,7 +1448,7 @@ export default {
product_info: { product_info: {
mmcode: '物料编号', mmcode: '物料编号',
materialId: '物料', materialId: '物料',
levelId: '产品分类', levelId: '产品分类ID',
type: "类型", type: "类型",
drawingNo: '图号', drawingNo: '图号',
name: '名称', name: '名称',
...@@ -1457,7 +1457,7 @@ export default { ...@@ -1457,7 +1457,7 @@ export default {
madeCompanyTitle: '主承制单位', madeCompanyTitle: '主承制单位',
status: '', status: '',
remark: '备注', remark: '备注',
madeCompany: '主承制单位', madeCompany: '主承制单位ID',
creationTime: '创建时间', creationTime: '创建时间',
extend: '', extend: '',
productUrl: '产品图像', productUrl: '产品图像',
......
...@@ -4938,7 +4938,7 @@ ...@@ -4938,7 +4938,7 @@
"dependencies": { "dependencies": {
"commander": { "commander": {
"version": "2.14.1", "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=" "integrity": "sha1-IjUSPjevjKPGXfRbAm29NXsBuao="
} }
} }
...@@ -5467,7 +5467,7 @@ ...@@ -5467,7 +5467,7 @@
}, },
"crc-32": { "crc-32": {
"version": "1.2.0", "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=", "integrity": "sha1-yy224puIUI4y2d0OwWk+e0Ghggg=",
"requires": { "requires": {
"exit-on-epipe": "~1.0.1", "exit-on-epipe": "~1.0.1",
...@@ -7364,7 +7364,7 @@ ...@@ -7364,7 +7364,7 @@
}, },
"exit-on-epipe": { "exit-on-epipe": {
"version": "1.0.1", "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=" "integrity": "sha1-C92S6H1ShdJn2qgXHQ6wYVlolpI="
}, },
"expand-brackets": { "expand-brackets": {
...@@ -8015,7 +8015,7 @@ ...@@ -8015,7 +8015,7 @@
}, },
"frac": { "frac": {
"version": "1.1.2", "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=" "integrity": "sha1-PXT39keMiKG1AgMG10fcYxPHTQs="
}, },
"fragment-cache": { "fragment-cache": {
...@@ -10026,7 +10026,7 @@ ...@@ -10026,7 +10026,7 @@
}, },
"iview-loader": { "iview-loader": {
"version": "1.3.0", "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=", "integrity": "sha1-n0Yu6uI4K4tJ746JLNloFJfjVLc=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -11762,7 +11762,7 @@ ...@@ -11762,7 +11762,7 @@
}, },
"less-loader": { "less-loader": {
"version": "5.0.0", "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=", "integrity": "sha1-SY3eOmxsT4h0WO6e0/CGoSrRtGY=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -15087,7 +15087,7 @@ ...@@ -15087,7 +15087,7 @@
}, },
"printj": { "printj": {
"version": "1.1.2", "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=" "integrity": "sha1-2Q3rKXWoufYA+zoclOP0xTx4oiI="
}, },
"private": { "private": {
...@@ -20540,7 +20540,7 @@ ...@@ -20540,7 +20540,7 @@
}, },
"script-loader": { "script-loader": {
"version": "0.7.2", "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=", "integrity": "sha1-IBbbb4byX1z1baOJFdgzeLsWa6c=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -21128,7 +21128,7 @@ ...@@ -21128,7 +21128,7 @@
}, },
"ssf": { "ssf": {
"version": "0.10.3", "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=", "integrity": "sha1-jq4fwpyQpVLnkhII+BiS1vd6yys=",
"requires": { "requires": {
"frac": "~1.1.2" "frac": "~1.1.2"
...@@ -23778,7 +23778,7 @@ ...@@ -23778,7 +23778,7 @@
}, },
"wmf": { "wmf": {
"version": "1.0.2", "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=" "integrity": "sha1-fRnWIQcaCMK9xrfmiKnENSmMwto="
}, },
"word-wrap": { "word-wrap": {
...@@ -23933,7 +23933,7 @@ ...@@ -23933,7 +23933,7 @@
}, },
"xlsx": { "xlsx": {
"version": "0.15.6", "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=", "integrity": "sha1-Rh+EHW2eoag3XizSRr8jrs4IodU=",
"requires": { "requires": {
"adler-32": "~1.2.0", "adler-32": "~1.2.0",
...@@ -23948,7 +23948,7 @@ ...@@ -23948,7 +23948,7 @@
"dependencies": { "dependencies": {
"commander": { "commander": {
"version": "2.17.1", "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=" "integrity": "sha1-vXerfebelCBc6sxy8XFtKfIKd78="
} }
} }
......
<template> <template>
<div class="h100"> <div class="h100">
<DataGrid :columns="columns" ref="grid" :action="action" exportTitle="导入中心"> <DataGrid :columns="columns" ref="grid" :action="action">
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys"> <FormItem prop="keys">
......
...@@ -736,7 +736,73 @@ export default { ...@@ -736,7 +736,73 @@ export default {
easy: true, easy: true,
high: 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: "", tdHeightExcel: "",
excelData: [], excelData: [],
...@@ -1086,6 +1152,9 @@ export default { ...@@ -1086,6 +1152,9 @@ export default {
case 5: case 5:
this.loadColum(this.columns5); this.loadColum(this.columns5);
break; break;
case 6:
this.loadColum(this.columns6);
break;
default: default:
this.loadColum(this.columns0); this.loadColum(this.columns0);
} }
...@@ -1121,6 +1190,9 @@ export default { ...@@ -1121,6 +1190,9 @@ export default {
case 5: case 5:
this.importRountingBom(); this.importRountingBom();
break; break;
case 6:
this.importProductMix();
break;
default: default:
//this.loadColum(this.columns1); //this.loadColum(this.columns1);
} }
...@@ -1459,7 +1531,50 @@ export default { ...@@ -1459,7 +1531,50 @@ export default {
return routingHeaderId return routingHeaderId
}, },
//插入工艺规程 及工艺相关end //插入工艺规程 及工艺相关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按钮 //切换列表和excel按钮
changeExcel(val) { changeExcel(val) {
if (val == 1) { if (val == 1) {
...@@ -1495,6 +1610,10 @@ export default { ...@@ -1495,6 +1610,10 @@ export default {
key = "routingsupporting" + "." + key; key = "routingsupporting" + "." + key;
return this.$t(key); return this.$t(key);
}, },
l6(key) {
key = "product_info" + "." + key;
return this.$t(key);
},
}, },
watch: { watch: {
eid(v) { eid(v) {
......
<template> <template>
<div> <div>
<DataGrid <DataGrid :columns="columns" ref="grid" :conditions="easySearch" :action="action" exportTitle="工艺Bom">
:columns="columns"
ref="grid"
:conditions="easySearch"
:action="action"
exportTitle="工艺Bom"
>
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys"> <FormItem prop="keys">
...@@ -26,26 +20,10 @@ ...@@ -26,26 +20,10 @@
</template> </template>
</DataGrid> </DataGrid>
<Modal v-model="modal" :title="title" width="850" footer-hide> <Modal v-model="modal" :title="title" width="850" footer-hide>
<component <component :is="detail" :eid="curId" :headid="hid" :productBomId="productBomId" :materialId="materialId" @on-close="cancel" @on-ok="ok" />
:is="detail"
:eid="curId"
:headid="hid"
:productBomId="productBomId"
:materialId="materialId"
@on-close="cancel"
@on-ok="ok"
/>
</Modal> </Modal>
<ImportExcel <ImportExcel ref="importExcel" @on-get-data="getData" :modalTitle="temTitle" :columns="columns" :open="ModalIm" @on-cancel="ModalImCancel" @on-ok="ok" />
ref="importExcel" </div>
@on-get-data="getData"
:modalTitle="temTitle"
:columns="columns"
:open="ModalIm"
@on-cancel="ModalImCancel"
@on-ok="ok"
/>
</div>
</template> </template>
<script> <script>
...@@ -82,8 +60,7 @@ export default { ...@@ -82,8 +60,7 @@ export default {
detail: null, detail: null,
curId: 0, curId: 0,
hid: 0, hid: 0,
columns: [ columns: [{
{
key: "routingDetailNo", key: "routingDetailNo",
title: this.l("routingDetailNo"), title: this.l("routingDetailNo"),
align: "left", align: "left",
...@@ -91,42 +68,41 @@ export default { ...@@ -91,42 +68,41 @@ export default {
width: 100, width: 100,
sortable: true, sortable: true,
}, },
// { {
// key: "routingHeaderId", key: "routingHeaderId",
// title: this.l("routingHeaderName"), title: this.l("routingHeaderName"),
// hide: true, hide: true,
// import: true, import: true,
// techKey: "1", techKey: "1",
// render: (h, params) => { render: (h, params) => {
// return h( return h(
// "span", "span", {},
// {}, this.getRoutingHeaderName(params.row.routingHeaderId)
// this.getRoutingHeaderName(params.row.routingHeaderId) );
// ); },
// }, },
// },
{ {
key: "routingDetailName", key: "routingDetailName",
title: this.l("routingDetailName"), title: this.l("routingDetailName"),
align: "left", align: "left",
high: true, high: true,
}, },
// { {
// key: "routingDetailId", key: "routingDetailId",
// title: this.l("routingDetailId"), title: this.l("routingDetailId"),
// hide: true, hide: true,
// import: true, import: true,
// }, },
// { {
// key: "materialType", key: "materialType",
// title: this.l("materialType"), title: this.l("materialType"),
// align: "center", align: "center",
// easy: true, easy: true,
// high: true, high: true,
// code: "mes_xingchi_resource.material.materialReType", code: "mes_xingchi_resource.material.materialReType",
// width: 100, width: 100,
// }, },
{ {
key: "materialNumber", key: "materialNumber",
title: this.l("materialNumber"), title: this.l("materialNumber"),
...@@ -134,13 +110,13 @@ export default { ...@@ -134,13 +110,13 @@ export default {
easy: true, easy: true,
high: true, high: true,
}, },
// { {
// key: "materialId", key: "materialId",
// title: this.l("materialId"), title: this.l("materialId"),
// align: "left", align: "left",
// hide: true, hide: true,
// import: true, import: true,
// }, },
{ {
key: "nameMaterial", key: "nameMaterial",
title: this.l("nameMaterial"), title: this.l("nameMaterial"),
...@@ -166,71 +142,71 @@ export default { ...@@ -166,71 +142,71 @@ export default {
high: true, high: true,
width: 80, width: 80,
}, },
// { {
// key: "brand", key: "brand",
// title: this.l("brand"), title: this.l("brand"),
// align: "left", align: "left",
// easy: true, easy: true,
// high: true, high: true,
// }, },
// { {
// key: "specifications", key: "specifications",
// title: this.l("specifications"), title: this.l("specifications"),
// align: "left", align: "left",
// easy: true, easy: true,
// high: true, high: true,
// }, },
// { {
// key: "xhgg", key: "xhgg",
// title: this.l("xhgg"), title: this.l("xhgg"),
// align: "left", align: "left",
// easy: true, easy: true,
// high: true, high: true,
// hide: true, hide: true,
// }, },
// { {
// key: "texture", key: "texture",
// title: this.l("texture"), title: this.l("texture"),
// align: "left", align: "left",
// easy: true, easy: true,
// high: true, high: true,
// }, },
// { {
// key: "procurementStandards", key: "procurementStandards",
// title: this.l("procurementStandards"), title: this.l("procurementStandards"),
// align: "left", align: "left",
// easy: true, easy: true,
// high: true, high: true,
// }, },
// { {
// key: "qualityGrade", key: "qualityGrade",
// title: this.l("qualityGrade"), title: this.l("qualityGrade"),
// align: "left", align: "left",
// easy: true, easy: true,
// high: true, high: true,
// }, },
// { {
// key: "drawNum", key: "drawNum",
// title: this.l("drawNum"), title: this.l("drawNum"),
// align: "left", align: "left",
// easy: true, easy: true,
// high: true, high: true,
// }, },
// { {
// key: "creationTime", key: "creationTime",
// title: this.l("creationTime"), title: this.l("creationTime"),
// hide: true, hide: true,
// align: "left", align: "left",
// hide: true, hide: true,
// }, },
// { {
// key: "creatorUserId", key: "creatorUserId",
// title: this.l("creatorUserId"), title: this.l("creatorUserId"),
// hide: true, hide: true,
// align: "left", align: "left",
// hide: true, hide: true,
// type: "user", type: "user",
// }, },
// { // {
// key: "lastModificationTime", // key: "lastModificationTime",
// title: this.l("lastModificationTime"), // title: this.l("lastModificationTime"),
...@@ -253,14 +229,12 @@ export default { ...@@ -253,14 +229,12 @@ export default {
align: "center", align: "center",
render: (h, params) => { render: (h, params) => {
return h( return h(
"div", "div", {
{
class: "action", class: "action",
}, },
[ [
h( h(
"op", "op", {
{
attrs: { attrs: {
oprate: "detail", oprate: "detail",
}, },
...@@ -272,8 +246,7 @@ export default { ...@@ -272,8 +246,7 @@ export default {
), ),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'), //h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h( h(
"op", "op", {
{
attrs: { attrs: {
oprate: "edit", oprate: "edit",
}, },
...@@ -284,8 +257,7 @@ export default { ...@@ -284,8 +257,7 @@ export default {
this.headerStatus == 4 || this.headerStatus == 0 ? "编辑" : "" this.headerStatus == 4 || this.headerStatus == 0 ? "编辑" : ""
), ),
h( h(
"op", "op", {
{
attrs: { attrs: {
oprate: "delete", oprate: "delete",
}, },
...@@ -322,7 +294,10 @@ export default { ...@@ -322,7 +294,10 @@ export default {
this.getRoutingHeaderData(); this.getRoutingHeaderData();
this.search(); this.search();
}, },
async fetch({ store, params }) { async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { methods: {
...@@ -382,7 +357,7 @@ export default { ...@@ -382,7 +357,7 @@ export default {
this.ModalIm = false; this.ModalIm = false;
}, },
getData(val) { getData(val) {
let url = `${technologyUrl}productinfoimportservice/import`; let url = `${technologyUrl}routingsupportingimportservice/import`;
this.$refs.importExcel.deelData(url, this.cols, this.formatMethod(val)); this.$refs.importExcel.deelData(url, this.cols, this.formatMethod(val));
}, },
//根据页面二次处理数据 //根据页面二次处理数据
...@@ -393,12 +368,10 @@ export default { ...@@ -393,12 +368,10 @@ export default {
tempData.forEach((ele) => { tempData.forEach((ele) => {
let obj = { let obj = {
routingHeaderId: Number(this.headerid), routingHeaderId: Number(this.headerid),
routingDetailId: ele.routingDetailId routingDetailId: ele.routingDetailId ?
? Number(ele.routingDetailId) Number(ele.routingDetailId) : null,
: null, routingDetailNo: ele.routingDetailNo ?
routingDetailNo: ele.routingDetailNo Number(ele.routingDetailNo) : null,
? Number(ele.routingDetailNo)
: null,
routingDetailName: ele.routingDetailName ? ele.routingDetailName : "", routingDetailName: ele.routingDetailName ? ele.routingDetailName : "",
routingStepId: 0, routingStepId: 0,
quantity: ele.quantity ? Number(ele.quantity) : 0, quantity: ele.quantity ? Number(ele.quantity) : 0,
...@@ -410,14 +383,14 @@ export default { ...@@ -410,14 +383,14 @@ export default {
specifications: ele.specifications ? ele.specifications : "", specifications: ele.specifications ? ele.specifications : "",
xhgg: ele.xhgg ? ele.xhgg : "", xhgg: ele.xhgg ? ele.xhgg : "",
texture: ele.texture ? ele.texture : "", texture: ele.texture ? ele.texture : "",
procurementStandards: ele.procurementStandards procurementStandards: ele.procurementStandards ?
? ele.procurementStandards ele.procurementStandards : "",
: "",
qualityGrade: ele.qualityGrade ? ele.qualityGrade : "", qualityGrade: ele.qualityGrade ? ele.qualityGrade : "",
state: null, state: null,
extend: "", extend: "",
remark: "", remark: "",
drawNum: ele.drawNum ? ele.drawNum : "", drawNum: ele.drawNum ? ele.drawNum : "",
json: {}
}; };
if (ele.routingDetailId && ele.routingDetailId != null) { if (ele.routingDetailId && ele.routingDetailId != null) {
obj.ico = false; obj.ico = false;
......
<template> <template>
<div class="product-m"> <div class="product-m">
<DataGrid <DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch" :type="typeInfo" :high="false" :span="6" :lazy="true" exportTitle="产品管理">
:columns="columns"
ref="grid"
:action="action"
:conditions="easySearch"
:type="typeInfo"
:high="false"
:span="6"
:lazy="true"
>
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys"> <FormItem prop="keys">
...@@ -24,10 +15,9 @@ ...@@ -24,10 +15,9 @@
<Search /> <Search />
</template> </template>
<template slot="buttons"> <template slot="buttons">
<Button type="primary" @click="add">新增</Button>&nbsp; <Button type="primary" @click="add">新增</Button>
</template>
<template slot="buttons">
<Button :icon="iconInfo" shape="circle" :title="titleInfo" @click="changeShwo"></Button> <Button :icon="iconInfo" shape="circle" :title="titleInfo" @click="changeShwo"></Button>
<Button @click="openModalIm">导入</Button>
</template> </template>
<template slot="card" slot-scope="{row}"> <template slot="card" slot-scope="{row}">
<div class="body-card"> <div class="body-card">
...@@ -68,18 +58,13 @@ ...@@ -68,18 +58,13 @@
</div> </div>
</template> </template>
</DataGrid> </DataGrid>
<Modal <Modal v-model="modal" :title="title" width="1200" footer-hide :fullscreen="fullscreen" :mask-closable="false">
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" /> <component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" :parents="parent" />
</Modal> </Modal>
</div> <ImportExcel ref="importExcel" @on-get-data="getData" :modalTitle="temTitle" :columns="columns" :open="ModalIm" @on-cancel="ModalImCancel" @on-ok="ok" />
</div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
import Search from "./search"; import Search from "./search";
...@@ -106,17 +91,25 @@ export default { ...@@ -106,17 +91,25 @@ export default {
action: Api.index, action: Api.index,
fullscreen: false, fullscreen: false,
easySearch: { easySearch: {
keys: { op: "mmcode,name", value: null }, keys: {
levelId: { op: "In", value: this.id }, op: "mmcode,name",
upId: { op: "In", value: 0 }, value: null
},
levelId: {
op: "In",
value: this.id
},
upId: {
op: "In",
value: 0
},
}, },
modal: false, modal: false,
title: "新增", title: "新增",
detail: null, detail: null,
downUrl: fileUrlDown, downUrl: fileUrlDown,
curId: 0, curId: 0,
columns: [ columns: [{
{
key: "id", key: "id",
title: this.$t("id"), title: this.$t("id"),
hide: true, hide: true,
...@@ -138,25 +131,24 @@ export default { ...@@ -138,25 +131,24 @@ export default {
{ {
key: "productUrl", key: "productUrl",
title: this.l("productUrl"), title: this.l("productUrl"),
align: "left", align: "center",
high: true, high: true,
render: (h, params) => { render: (h, params) => {
return h("div", { class: "action" }, [ return h("div", {
class: "action"
}, [
h( h(
"a", params.row.productUrl.length > 0 ? "a" : "span", {
{
attrs: { attrs: {
oprate: "detail", oprate: "detail",
// href: this.fileUrlPath,
// target: "_blank"
}, },
on: { on: {
click: () => { 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 { ...@@ -167,6 +159,14 @@ export default {
align: "left", align: "left",
high: true, high: true,
}, },
{
key: "levelId",
title: this.l("levelId"),
align: "left",
high: true,
hide: true,
import: true,
},
{ {
key: "drawingNo", key: "drawingNo",
title: this.l("drawingNo"), title: this.l("drawingNo"),
...@@ -180,17 +180,47 @@ export default { ...@@ -180,17 +180,47 @@ export default {
width: 260, width: 260,
high: true, 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: "操作", title: "操作",
key: "action", key: "action",
width: 200, width: 200,
align: "center", align: "center",
render: (h, params) => { render: (h, params) => {
return h("div", { class: "action" }, [ return h("div", {
class: "action"
}, [
h( h(
"op", "op", {
{ attrs: {
attrs: { oprate: "edit" }, oprate: "edit"
},
on: { on: {
click: () => this.bom(params.row), click: () => this.bom(params.row),
}, },
...@@ -198,9 +228,10 @@ export default { ...@@ -198,9 +228,10 @@ export default {
"BOM" "BOM"
), ),
h( h(
"op", "op", {
{ attrs: {
attrs: { oprate: "edit" }, oprate: "edit"
},
on: { on: {
click: () => this.edit(params.row), click: () => this.edit(params.row),
}, },
...@@ -208,17 +239,21 @@ export default { ...@@ -208,17 +239,21 @@ export default {
"编辑" "编辑"
), ),
h( h(
"op", "op", {
{ attrs: {
attrs: { oprate: "delete" }, oprate: "delete"
on: { click: () => this.remove(params.row) }, },
on: {
click: () => this.remove(params.row)
},
}, },
"删除" "删除"
), ),
h( h(
"op", "op", {
{ attrs: {
attrs: { oprate: "view" }, oprate: "view"
},
on: { on: {
click: () => this.view(params.row), click: () => this.view(params.row),
}, },
...@@ -232,12 +267,17 @@ export default { ...@@ -232,12 +267,17 @@ export default {
typeInfo: "card", typeInfo: "card",
iconInfo: "md-apps", iconInfo: "md-apps",
titleInfo: "卡片模式", titleInfo: "卡片模式",
ModalIm: false,
temTitle: "产品管理",
}; };
}, },
mounted() { mounted() {
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch);
}, },
async fetch({ store, params }) { async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { methods: {
...@@ -331,13 +371,65 @@ export default { ...@@ -331,13 +371,65 @@ export default {
let vkey = "product_info" + "." + key; let vkey = "product_info" + "." + key;
return this.$t(vkey) || 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: { watch: {
"parent.id"(v) { "parent.id"(v) {
if (v) { if (v) {
let data = { let data = {
levelId: { op: "In", value: this.parent.ids }, levelId: {
upId: { op: "In", value: 0 }, op: "In",
value: this.parent.ids
},
upId: {
op: "In",
value: 0
},
}; };
this.$refs.grid.reload(data); this.$refs.grid.reload(data);
} }
...@@ -345,12 +437,14 @@ export default { ...@@ -345,12 +437,14 @@ export default {
}, },
}; };
</script> </script>
<style lang="less"> <style lang="less">
.product-m { .product-m {
.body-card { .body-card {
border: 1px solid rgba(38, 128, 235, 1); border: 1px solid rgba(38, 128, 235, 1);
margin: 10px; margin: 10px;
border-radius: 4px; border-radius: 4px;
.title-i { .title-i {
border-bottom: 1px solid #2680eb; border-bottom: 1px solid #2680eb;
padding: 0 10px; padding: 0 10px;
...@@ -358,26 +452,32 @@ export default { ...@@ -358,26 +452,32 @@ export default {
line-height: 35px; line-height: 35px;
background: rgba(38, 128, 235, 0.2); background: rgba(38, 128, 235, 0.2);
color: #2680eb; color: #2680eb;
.btn-click { .btn-click {
text-align: right; text-align: right;
} }
} }
.row-down { .row-down {
padding: 10px; padding: 10px;
.img-i { .img-i {
width: 90px; width: 90px;
background: #eee; background: #eee;
height: 90px; height: 90px;
margin-right: 15px; margin-right: 15px;
// overflow: hidden; // overflow: hidden;
img { img {
width: 90px; width: 90px;
height: 90px; height: 90px;
} }
} }
.c div { .c div {
margin-bottom: 8px; margin-bottom: 8px;
} }
.a-icon { .a-icon {
text-align: right; text-align: right;
margin-bottom: -5px; 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