Commit df50b8df authored by renjintao's avatar renjintao

dictionary/plan

parent 3c69319e
<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,13 +82,7 @@ ...@@ -82,13 +82,7 @@
<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>
<Radio label="4" border>智能排产</Radio>
<Radio label="2" border>整机排产</Radio>
<Radio label="3" border>流水排产</Radio>
</RadioGroup>
<p class="pl30 pt10" v-show="scheduleType!=''"> <p class="pl30 pt10" v-show="scheduleType!=''">
确定将订单 确定将订单
<span class="fwBold">{{resultsOrderList}}</span> 移入 <span class="fwBold">{{resultsOrderList}}</span> 移入
......
...@@ -6,65 +6,23 @@ ...@@ -6,65 +6,23 @@
<div v-show="!load"> <div v-show="!load">
<DataGrid :columns="columns" :data="result" border :tool="false" :height="820" :page="false"></DataGrid> <DataGrid :columns="columns" :data="result" border :tool="false" :height="820" :page="false"></DataGrid>
</div> </div>
<Modal v-model="modalSplit" title="订单分卡" width="650" footer-hide> <Modal v-model="modalSplit" title="订单分卡" width="800">
<div slot="close"> <Form model="entity" label-width="100">
<Icon type="ios-close" size="31" color="gray" @click="handleClose" /> <Row >
</div> <Col span="24">
<Form :model="entity" ref="form" :label-width="110" :rules="rules"> <FormItem label="选择序列号"></FormItem>
<Row> </Col>
<Col span="24"> <Col span="24">
<FormItem label="选择序列号" prop="num"> <FormItem label="选择分卡原因"></FormItem>
<Select v-model="entity.num" multiple> </Col>
<Option <Col span="24">
v-for="(item,index) in numList" <FormItem label="备注说明"></FormItem>
:value="item.value" </Col>
:key="index" <Col span="24">
>{{ item.label }}</Option> <FormItem label="选择序列号"></FormItem>
</Select> </Col>
</FormItem> </Row>
</Col> </Form>
<Col span="24">
<FormItem label="选择分卡原因" prop="reason">
<Select v-model="entity.reason" style="width:260px">
<Option
v-for="(item,index) in reasonList"
:value="item.value"
:key="index"
>{{ item.label }}</Option>
</Select>
</FormItem>
</Col>
<Col span="24">
<FormItem label="备注说明">
<Input v-model="entity.remark" placeholder type="textarea" :rows="3" />
</FormItem>
</Col>
<Col span="14">
<FormItem label prop="action">
<RadioGroup v-model="entity.action" @on-change="onchangeAction">
<Radio :label="1">暂停</Radio>
<Radio :label="2">继续</Radio>
<Radio :label="3">移入排产</Radio>
</RadioGroup>
</FormItem>
</Col>
<Col span="10" v-if="entity.action===3">
<FormItem label prop="scheduleType">
<Dictionary
code="aps.plan.scheduleType"
v-model="entity.scheduleType"
class="scheduleTypeSelect"
></Dictionary>
</FormItem>
</Col>
</Row>
</Form>
<Row>
<Col span="24" style="text-align:right;height:60px;line-height:60px">
<Button type="primary" @click="splitOk">确定</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</Col>
</Row>
</Modal> </Modal>
</div> </div>
</template> </template>
...@@ -76,14 +34,8 @@ export default { ...@@ -76,14 +34,8 @@ export default {
data() { data() {
return { return {
modalSplit: false, modalSplit:false,
entity: { entity:{},
num: [], //序列号组合
reason: null, //分卡原因
remark: "", //备注信息
action: null, //操作
scheduleType: null //排产类型
},
columns: [ columns: [
{ {
key: "detailId", key: "detailId",
...@@ -202,35 +154,27 @@ export default { ...@@ -202,35 +154,27 @@ export default {
h( h(
"op", "op",
{ {
props: { props: { oprate: "delete",title:"操作信息",msg:"确定暂停工序:"+params.row.detailName+"?" },
oprate: "delete",
title: "暂停",
msg: "确定暂停工序:" + params.row.detailName + "?"
},
style: params.row.status == 14 ? "" : "display:none", style: params.row.status == 14 ? "" : "display:none",
on: { click: () => this.pause(params.row) } on: { click: () => this.pause(params.row) },
}, },
"暂停" "暂停"
), ),
h( h(
"op", "op",
{ {
props: { oprate: "edit", title: "分卡" }, attrs: { oprate: "edit" },
style: params.row.status == 12 ? "" : "display:none", style: params.row.status == 12 ? "" : "display:none",
on: { click: () => this.split(params.row) } on: { click: () => this.split(params.row) },
}, },
"分卡" "分卡"
), ),
h( h(
"op", "op",
{ {
props: { props: { oprate: "delete",msg:"确定继续执行工序:"+params.row.detailName+"?" },
oprate: "delete", style: params.row.status == 5 ? "" : "display:none",
title: "继续", on: { click: () => this.continue(params.row) },
msg: "确定继续执行工序:" + params.row.detailName + "?"
},
style: params.row.status == 5 ? "" : "display:none",
on: { click: () => this.continue(params.row) }
}, },
"继续" "继续"
) )
...@@ -239,139 +183,26 @@ export default { ...@@ -239,139 +183,26 @@ export default {
} }
], ],
listTask: [], listTask: [],
numList: [
{
value: 1,
label: "SKJC-001"
},
{
value: 2,
label: "SKJC-002"
},
{
value: 3,
label: "SKJC-003"
},
{
value: 4,
label: "SKJC-004"
},
{
value: 5,
label: "SKJC-005"
},
{
value: 6,
label: "SKJC-006"
}
],
reasonList: [
{
value: 1,
label: "分卡原因1"
},
{
value: 2,
label: "分卡原因2"
},
{
value: 3,
label: "分卡原因3"
}
],
rules: {
num: [
{
required: true,
message: "请选择分卡原因",
trigger: "change",
type: "array"
}
],
reason: [
{
required: true,
message: "请选择分卡原因",
trigger: "change",
type: "number"
}
],
action: [
{
required: true,
message: "请选择操作",
trigger: "change",
type: "number"
}
],
scheduleType: [
{
required: true,
message: "请选择排产类型",
trigger: "change",
type: "number"
}
]
}
}; };
}, },
props: { props: {
result: Array, result: Array,
load: Boolean load:Boolean,
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
created() {}, created() {},
methods: { methods: {
split(row) { split(row){//工单分卡
//工单分卡 alert(JSON.stringify(row))
this.modalSplit = true; this.modalSplit=true
}, },
onchangeAction(val) { pause(row){//暂停工单
if (val != 3) { alert(JSON.stringify(row))
this.entity.scheduleType = null;
}
},
splitOk() {
//确定分卡
this.$refs.form.validate(valid => {
if (valid) {
let params = {
num: this.entity.num,
reason: this.entity.reason,
remark: this.entity.remark,
action: this.entity.action,
scheduleType: this.entity.scheduleType
};
alert(JSON.stringify(params));
this.handleClose();
} else {
this.modalSplit = true;
}
});
}, },
handleClose() { continue(row){//继续工单
//取消分卡 alert(JSON.stringify(row))
this.entityReset();
this.modalSplit = false;
},
entityReset() {
this.entity = {
num: [],
reason: null,
remark: "",
action: null,
scheduleType: null
};
},
pause(row) {
//暂停工单
alert(JSON.stringify(row));
},
continue(row) {
//继续工单
alert(JSON.stringify(row));
}, },
//截取字符串 //截取字符串
sliceStr(str, lenS, lenE) { sliceStr(str, lenS, lenE) {
...@@ -403,13 +234,5 @@ export default { ...@@ -403,13 +234,5 @@ export default {
} }
}; };
</script> </script>
<style lang='less' scope> <style lang='less'>
.scheduleTypeSelect {
display: inline;
width: 180px;
margin-left: -110px;
.ivu-select {
width: 180px;
}
}
</style> </style>
\ No newline at end of file
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