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) {
......
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