Commit f54bf6d8 authored by renjintao's avatar renjintao

修改外协工时

parent 237513ab
...@@ -16,20 +16,33 @@ ...@@ -16,20 +16,33 @@
></DataGrid> ></DataGrid>
</Col> </Col>
</Row> </Row>
<Modal
v-model="setTimeModal"
title="修改外协时间"
width="680"
footer-hide
@on-cancel="cancel"
>
<EditDuration :rowData="row" ref="editDurationRef" @on-close="cancel" @on-ok="editInfo"></EditDuration>
</Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
import EditDuration from "./editDuration";
export default { export default {
components: {
EditDuration
},
data() { data() {
return { return {
add: null, editDuration: null,
tempModal: false, tempModal: false,
columnsDuration: [ columnsDuration: [
{ {
key: "projectNo", key: "projectNo",
title: this.l("projectNo"), title: this.l("projectNo"),
align: "left", align: "left"
}, },
{ {
key: "batchNum", key: "batchNum",
...@@ -81,13 +94,14 @@ export default { ...@@ -81,13 +94,14 @@ export default {
title: "修改外协工期", title: "修改外协工期",
oprate: "edit" oprate: "edit"
}, },
on: { click: () => this.edit(params.row.id) } on: { click: () => this.edit(params.row) }
}) })
]); ]);
} }
} }
], ],
data: [] data: [],
row: {}
}; };
}, },
created() {}, created() {},
...@@ -96,37 +110,36 @@ export default { ...@@ -96,37 +110,36 @@ export default {
}, },
methods: { methods: {
loadDuration() { loadDuration() {
Api.getoutsidetimelist().then(r => { this.data = [];
if (r.success) { Api.getoutsidetimelist()
this.data = r.result; .then(r => {
} if (r.success) {
}); this.data = r.result;
}, } else {
handleSubmit() { this.$Message.error("加载数据失败!");
this.$refs.form.validate(valid => { }
if (valid) { })
} .catch(err => {
}); this.$Message.error("数据异常!");
}, });
handleClose() {
this.$emit("on-close");
}, },
cancel() { cancel() {
this.add = null; this.row = {};
this.tempModal = false; this.setTimeModal = false;
}, },
cancelModal() { edit(rowData) {
this.$refs.tempRef.handleClose(); this.row = rowData;
this.tempModal = false; this.setTimeModal = true;
this.add = null;
}, },
edit(id) { editInfo(entity) {
if (this.add == null) { let tempData = this.data;
this.id = id; this.data = [];
this.tempTitle = "编辑模板"; tempData.forEach(data => {
this.tempModal = true; if (data.taskSeq == entity.taskSeq) {
this.add = () => import("./addTemp"); data.outSideTime = entity.outSideTime;
} }
this.data.push(data);
});
}, },
l(key) { l(key) {
let vkey = "mes_part_task_plan_simulate" + "." + key; let vkey = "mes_part_task_plan_simulate" + "." + key;
......
<template>
<div>
<Form ref="form" :model="entity" :rules="rules" :label-width="100">
<Row>
<Col span="12">
<FormItem :label="l('projectNo')">
<Input v-model="entity.projectNo" disabled></Input>
</FormItem>
</Col>
<Col span="12">
<FormItem :label="l('productName')">
<Input v-model="entity.productName" disabled></Input>
</FormItem>
</Col>
<Col span="12">
<FormItem :label="l('outSideTime')" prop="outSideTime">
<InputNumber v-model="entity.outSideTime" style="width:150px;" :min="0"></InputNumber>
</FormItem>
</Col>
</Row>
</Form>
<Row>
<Col span="24" style="text-align:right;height:60px;line-height:60px">
<Button type="primary" @click="handleSubmit">确定</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</Col>
</Row>
</div>
</template>
<script>
import Api from "./api";
export default {
data() {
return {
entity: {
},
rules: {
outSideTime: [
{ required: true, message: "必填", type: "number", trigger: "change" }
]
}
};
},
props: {
rowData: {
type: Object,
default: () => {
return null;
}
}
},
created() {},
mounted() {},
methods: {
handleSubmit() {
this.$refs.form.validate(valid => {
if (valid) {
let params = {
items: [
{
partTaskPk: this.entity.partTaskPk,
opTaskPk: this.entity.opTaskPk,
outSideTime: this.entity.outSideTime
}
]
};
Api.saveoutsidetime(params)
.then(res => {
if (res.success && res.result) {
this.$Message.success("修改外协时间成功");
this.$emit("on-ok", this.entity);
} else {
this.$Message.error("修改外协时间失败");
}
this.$emit("on-close");
})
.catch(e => {
this.$Message.error("数据异常!");
});
}
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
let vkey = "mes_part_task_plan_simulate" + "." + key;
return this.$t(vkey) || key;
}
},
computed: {},
watch: {
rowData(v) {
if (v != {}) {
this.entity = this.$u.clone(v);
}
}
}
};
</script>
<style lang="less">
</style>
\ No newline at end of file
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<Modal v-model="addModalTemp" title="自定义排序模板" footer-hide width="1000" class="tempModal"> <Modal v-model="addModalTemp" title="自定义排序模板" footer-hide width="1000" class="tempModal">
<Temp :data="listTemp" ref="tempRef"></Temp> <Temp :data="listTemp" ref="tempRef"></Temp>
</Modal> </Modal>
<Modal v-model="modalDuration" title="外协任务" footer-hide width="1000" class="tempModal"> <Modal v-model="modalDuration" title="外协任务" footer-hide width="1000" >
<Duration ref="durationRef"></Duration> <Duration ref="durationRef"></Duration>
</Modal> </Modal>
<Modal v-model="addModal" title="工序参数设置" footer-hide width="1000"> <Modal v-model="addModal" title="工序参数设置" footer-hide width="1000">
......
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