fix:coding#412,弹窗标题和检验人员列表筛选
This commit is contained in:
parent
ca0282595b
commit
a777e06d4b
|
@ -366,9 +366,11 @@ export default {
|
|||
//获取员工
|
||||
getUserList() {
|
||||
let that = this;
|
||||
this.$API.system.user.list.req({ page: 0 }).then((res) => {
|
||||
that.userList = res;
|
||||
});
|
||||
this.$API.system.user.list
|
||||
.req({ page: 0, belong_dept__name: "检验管理部" })
|
||||
.then((res) => {
|
||||
that.userList = res;
|
||||
});
|
||||
},
|
||||
//表格数据
|
||||
getCheckList(ftestwork) {
|
||||
|
|
|
@ -1,152 +1,174 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
title="首件检验任务"
|
||||
v-model="visible"
|
||||
:size="1000"
|
||||
destroy-on-close
|
||||
@closed="$emit('closed')"
|
||||
>
|
||||
<el-container v-loading="loading">
|
||||
<el-main style="padding: 0 20px 20px 20px">
|
||||
<el-form
|
||||
ref="dialogForm"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="物料批次" prop="batch">
|
||||
<el-select
|
||||
v-model="form.batch"
|
||||
placeholder="物料批次"
|
||||
clearable style="width:100%"
|
||||
@change="handleChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.batch"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="总数">
|
||||
<el-input v-model="form.count" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="检验日期" prop="test_date">
|
||||
<el-date-picker
|
||||
v-model="form.test_date"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width:100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-main>
|
||||
<el-footer>
|
||||
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
title="成品检验任务"
|
||||
v-model="visible"
|
||||
:size="1000"
|
||||
destroy-on-close
|
||||
@closed="$emit('closed')"
|
||||
>
|
||||
<el-container v-loading="loading">
|
||||
<el-main style="padding: 0 20px 20px 20px">
|
||||
<el-form
|
||||
ref="dialogForm"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="物料批次" prop="batch">
|
||||
<el-select
|
||||
v-model="form.batch"
|
||||
placeholder="物料批次"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
@change="handleChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.batch"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="总数">
|
||||
<el-input
|
||||
v-model="form.count"
|
||||
disabled
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="检验日期" prop="test_date">
|
||||
<el-date-picker
|
||||
v-model="form.test_date"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-main>
|
||||
<el-footer>
|
||||
<el-button type="primary" :loading="isSaveing" @click="submit"
|
||||
>保存</el-button
|
||||
>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
emits: ["success", "closed"],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
form: {
|
||||
},
|
||||
rules: {
|
||||
test_date: [{required: true, message: "请选择检验日期", trigger: "blur"}],
|
||||
batch: [{required: true, message: "请选择物料批次", trigger: "blur"}]
|
||||
},
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
options: [],
|
||||
selectionFilters: [],
|
||||
setFiltersVisible: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getMaterialBatch();
|
||||
},
|
||||
methods: {
|
||||
//显示
|
||||
open(mode = "add") {
|
||||
this.mode = mode;
|
||||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
//获取物料批次
|
||||
getMaterialBatch(){
|
||||
let that = this;
|
||||
this.$API.inm.warehouse.batch.req({page:0,material__type:10,count__gte:0}).then(res=>{
|
||||
that.options = res;
|
||||
});
|
||||
},
|
||||
handleChange(val){
|
||||
let that = this;
|
||||
console.log(val)
|
||||
that.options.forEach(item => {
|
||||
if(item.id==val){
|
||||
that.form.count = item.count;
|
||||
that.form.batch = item.batch;
|
||||
that.form.material = item.material;
|
||||
}
|
||||
});
|
||||
},
|
||||
//提交
|
||||
submit() {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
try {
|
||||
if (this.mode == "add") {
|
||||
this.$API.qm.ftestwork.create.req(this.form).then(res => {
|
||||
this.isSaveing = false;
|
||||
this.visible = false;
|
||||
this.$emit("success");
|
||||
this.$message.success("操作成功");
|
||||
});
|
||||
} else if (this.mode == "edit") {
|
||||
this.$API.qm.ftestwork.update.req(this.form.id,this.form).then(res => {
|
||||
this.isSaveing = false;
|
||||
this.visible = false;
|
||||
this.$emit("success");
|
||||
this.$message.success("操作成功");
|
||||
});
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
//可以处理校验错误
|
||||
this.isSaveing = false;
|
||||
return err;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//表单注入数据
|
||||
setData(data) {
|
||||
Object.assign(this.form, data);
|
||||
this.form.test_group = this.form.split(',')
|
||||
},
|
||||
//设置过滤项
|
||||
setFilters(filters) {
|
||||
this.selectionFilters = filters;
|
||||
this.setFiltersVisible = true;
|
||||
},
|
||||
},
|
||||
emits: ["success", "closed"],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
form: {},
|
||||
rules: {
|
||||
test_date: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择检验日期",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
batch: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择物料批次",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
},
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
options: [],
|
||||
selectionFilters: [],
|
||||
setFiltersVisible: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getMaterialBatch();
|
||||
},
|
||||
methods: {
|
||||
//显示
|
||||
open(mode = "add") {
|
||||
this.mode = mode;
|
||||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
//获取物料批次
|
||||
getMaterialBatch() {
|
||||
let that = this;
|
||||
this.$API.inm.warehouse.batch
|
||||
.req({ page: 0, material__type: 10, count__gte: 0 })
|
||||
.then((res) => {
|
||||
that.options = res;
|
||||
});
|
||||
},
|
||||
handleChange(val) {
|
||||
let that = this;
|
||||
console.log(val);
|
||||
that.options.forEach((item) => {
|
||||
if (item.id == val) {
|
||||
that.form.count = item.count;
|
||||
that.form.batch = item.batch;
|
||||
that.form.material = item.material;
|
||||
}
|
||||
});
|
||||
},
|
||||
//提交
|
||||
submit() {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
try {
|
||||
if (this.mode == "add") {
|
||||
this.$API.qm.ftestwork.create
|
||||
.req(this.form)
|
||||
.then((res) => {
|
||||
this.isSaveing = false;
|
||||
this.visible = false;
|
||||
this.$emit("success");
|
||||
this.$message.success("操作成功");
|
||||
});
|
||||
} else if (this.mode == "edit") {
|
||||
this.$API.qm.ftestwork.update
|
||||
.req(this.form.id, this.form)
|
||||
.then((res) => {
|
||||
this.isSaveing = false;
|
||||
this.visible = false;
|
||||
this.$emit("success");
|
||||
this.$message.success("操作成功");
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
//可以处理校验错误
|
||||
this.isSaveing = false;
|
||||
return err;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//表单注入数据
|
||||
setData(data) {
|
||||
Object.assign(this.form, data);
|
||||
this.form.test_group = this.form.split(",");
|
||||
},
|
||||
//设置过滤项
|
||||
setFilters(filters) {
|
||||
this.selectionFilters = filters;
|
||||
this.setFiltersVisible = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
<style></style>
|
||||
|
|
Loading…
Reference in New Issue