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

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

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