Commit 2da1ad55 authored by 周远喜's avatar 周远喜

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

parents 4548e6a5 4e70dd41
<template>
<div>
<div>
<RadioGroup
v-if="type === 'radio'"
ref="dicradio"
......@@ -12,10 +12,11 @@
:disabled="item.disabled"
:label="item.value"
:key="index"
:border="border"
>
<span :title="item.value">{{ item.label }}</span>
</Radio
> </RadioGroup>
</Radio>
</RadioGroup>
<Select
v-else
:placeholder="placeholder"
......@@ -33,30 +34,32 @@
:key="item.value"
:label="item.label"
>
<span :title="item.value">
{{item.label}}
</span>
<span :title="item.value">{{item.label}}</span>
</Option>
</Select>
</div>
</div>
</template>
<script>
export default {
model: {
prop: 'value',
event: 'on-change'
prop: "value",
event: "on-change"
},
props: {
code: String,
value: [String, Number, Array],
placeholder: {
type: String,
default: '请选择'
default: "请选择"
},
type: {
// 显示形式: select 或者radio
type: String,
default: 'Select'
default: "Select"
},
border: {//radio可以选择border属性
type: Boolean,
default: false
},
multiple: {
//是否多选
......@@ -76,18 +79,17 @@ export default {
limit: {
//限制只在此值范围内进行选择,其它值禁用选择。
type: String,
default: ''
default: ""
}
},
data() {
return {
name: this.value,
data: []
}
};
},
created() {
this.data = this.$store.getters.dictionaryByKey(this.code)
this.data = this.$store.getters.dictionaryByKey(this.code);
},
mounted() {
// if(this.value==undefined||this.value==''||this.value==null)
......@@ -105,46 +107,46 @@ export default {
methods: {
change(event) {
this.$emit('on-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
let result = [];
let limit = this.limit.split(",");
this.data.forEach(u => {
let v = u.code;
let s = u.status;
try {
v = parseInt(u.code)
v = parseInt(u.code);
} catch (err) {
console.warn('数据字典值请设置为int')
console.warn("数据字典值请设置为int");
}
var disabled = this.disabled //false
var disabled = this.disabled; //false
if (!this.disabled && !this.$u.isNull(this.limit)) {
disabled = limit.indexOf(v + '') == -1
disabled = limit.indexOf(v + "") == -1;
}
if (!this.disabled) {
disabled = s == 1 ? true : false
disabled = s == 1 ? true : false;
}
result.push({
label: u.name,
value: v,
disabled: disabled
})
})
return result
});
});
return result;
}
},
watch: {
value: {
handler(v, o) {
this.name = v
this.name = v;
},
deep: true
}
}
}
};
</script>
<style lang="less">
.w200 {
......
......@@ -82,14 +82,8 @@
<Modal v-model="scheduleModal" title="移入排产" width="800">
<p>&nbsp;</p>
<h4>请选择排产模型:</h4>
<RadioGroup v-model="scheduleType" class="radioList" @on-change="onchangeScheduleType">
<Radio label="1" border>APS排产</Radio>
<Radio label="4" border>智能排产</Radio>
<Radio label="2" border>整机排产</Radio>
<Radio label="3" border>流水排产</Radio>
</RadioGroup>
<p class="pl30 pt10" v-show="scheduleType!=''">
<Dictionary code="aps.plan.scheduleType" v-model="scheduleType" class="radioList" border="true" type="radio" @on-change="onchangeScheduleType"></Dictionary>
<p class="pl30 pt10" v-show="scheduleType!=null">
确定将订单
<span class="fwBold">{{resultsOrderList}}</span> 移入
<span class="red fwBold">{{scheduleTypeName}}</span>
......@@ -370,7 +364,7 @@ export default {
dispatchStatus: 0, //派发标识
scheduleStatus: 0, //排产标识
resultsOrderList: "",
scheduleType: "",
scheduleType: null,
scheduleTypeName: ""
};
},
......@@ -456,7 +450,7 @@ export default {
},
modalSchedule() {
//移入排产
this.scheduleType = "";
this.scheduleType = null;
this.scheduleTypeName = "";
this.listBatchIds = this.listBatchIds1;
if (this.scheduleStatus == 1) {
......@@ -470,7 +464,7 @@ export default {
this.canselFooter();
this.resultsOrderList = value.mesCode;
this.listBatchIds = [value.id];
this.scheduleType = "";
this.scheduleType = null;
this.scheduleTypeName = "";
if (value.mainRoutingSetStatus == 0) {
//this.dispatchStatus = 1
......@@ -487,12 +481,12 @@ export default {
this.$refs.orderSupport.loaddata(value.id);
},
scheduleOk() {
if (this.scheduleType == "") {
if (this.scheduleType == null) {
this.$Message.error("请选择排产模型");
} else {
let params = {
ids: this.listBatchIds,
poolType: Number(this.scheduleType)
poolType: this.scheduleType
};
Api.moveinbatch(params)
.then(r => {
......@@ -614,13 +608,13 @@ export default {
//移入排产前选择排产模型
onchangeScheduleType(val) {
switch (val) {
case "4":
case 4:
this.scheduleTypeName = "智能排产";
break;
case "2":
case 2:
this.scheduleTypeName = "整机排产";
break;
case "3":
case 3:
this.scheduleTypeName = "流水排产";
break;
default:
......@@ -630,13 +624,13 @@ export default {
//移入排产成功后给标题增加数量
changeCountOut(type, count) {
switch (type) {
case "4": //智能排产池排产订单数量
case 4: //智能排产池排产订单数量
this.$store.commit("setCountAi", this.$store.state.countAi + count);
break;
case "2": //整机排产池排产订单数量
case 2: //整机排产池排产订单数量
this.$store.commit("setCountAll", this.$store.state.countAll + count);
break;
case "3": //流水排产池排产订单数量
case 3: //流水排产池排产订单数量
this.$store.commit("setCountRun", this.$store.state.countRun + count);
break;
default:
......
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