Commit 0beb6885 authored by 仇晓婷's avatar 仇晓婷

合格证

parent f12229c9
......@@ -23,7 +23,10 @@
</FormItem>
</Col>
<Col :span="6">
<FormItem :label="l('productSerialNumber')" prop="productSerialNumber">
<FormItem
:label="l('productSerialNumber')"
prop="productSerialNumber"
>
<ProductNumberSelect
v-model="entity.productSerialNumber"
:eid="eid"
......@@ -50,50 +53,92 @@
</FormItem>
</Col>
<Col :span="6">
<FormItem :label="l('materialSerialNumber')" prop="materialSerialNumber">
<FormItem
:label="l('materialSerialNumber')"
prop="materialSerialNumber"
>
<Input v-model="entity.materialSerialNumber"></Input>
</FormItem>
</Col>
<Col :span="6">
<FormItem :label="l('materialCertificationNumber')" prop="materialCertificationNumber">
<FormItem
:label="l('materialCertificationNumber')"
prop="materialCertificationNumber"
>
<Input v-model="entity.materialCertificationNumber"></Input>
</FormItem>
</Col>
<Col :span="6">
<FormItem :label="l('productQuantity')" prop="productQuantity">
<Input v-model="entity.productQuantity" :disabled="isDisabled"></Input>
<Input
v-model="entity.productQuantity"
:disabled="isDisabled"
></Input>
</FormItem>
</Col>
<Col :span="24" style="margin:20px 0;">
<div style="margin-left:10px;font-weight:bold">检验内容</div>
<Col :span="24" style="margin: 20px 0">
<div style="margin-left: 10px; font-weight: bold">检验内容</div>
<div class="jy-boder"></div>
</Col>
<Col :span="24" style="padding:20px 0 0px 10px;margin-bottom:10px;" class="table-solt">
<Table border :columns="columns" :data="checkList" class="tableCommon">
<Col
:span="24"
style="padding: 20px 0 0px 10px; margin-bottom: 10px"
class="table-solt"
>
<Table
border
:columns="columns"
:data="checkList"
class="tableCommon"
>
<template slot-scope="{ row, index }" slot="name">
<Input v-model="row.name" placeholder="请输入" @on-blur="setRow(row,index)" />
<Input
v-model="row.name"
placeholder="请输入"
@on-blur="setRow(row, index)"
/>
</template>
<template slot-scope="{ row, index }" slot="require">
<Input v-model="row.require" placeholder="请输入" @on-blur="setRow(row,index)" />
<Input
v-model="row.require"
placeholder="请输入"
@on-blur="setRow(row, index)"
/>
</template>
<template slot-scope="{ row, index }" slot="result">
<Input v-model="row.result" placeholder="请输入" @on-blur="setRow(row,index)" />
<Input
v-model="row.result"
placeholder="请输入"
@on-blur="setRow(row, index)"
/>
</template>
<template slot-scope="{ row, index }" slot="pash">
<inputFile v-model="row.file" :files="true" :parms="getParams(row.fileId)" />
<inputFile
v-model="row.file"
:files="true"
:parms="getParams(row.fileId)"
/>
</template>
<template slot-scope="{ row, index }" slot="conclusion" class="dd">
<Dictionary code="qms.certificate.conclusion" v-model="row.conclusion" type="select"></Dictionary>
<Dictionary
code="qms.certificate.conclusion"
v-model="row.conclusion"
type="select"
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="remark">
<Input v-model="row.remark" placeholder="请输入" @on-blur="setRow(row,index)" />
<Input
v-model="row.remark"
placeholder="请输入"
@on-blur="setRow(row, index)"
/>
</template>
<template slot-scope="{ row, index }" slot="action">
<a @click="remove(index)" style="color:#FF7A8B">删除</a>
<a @click="remove(index)" style="color: #ff7a8b">删除</a>
</template>
</Table>
</Col>
<Col :span="24" style="margin-bottom:20px;">
<Col :span="24" style="margin-bottom: 20px">
<Button type="primary" long @click="addNew" class="mt10">添加</Button>
</Col>
<Col :span="6">
......@@ -121,10 +166,18 @@
<FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
<Checkbox v-model="submit" class="ml20" v-if="status==0">是否送审</Checkbox>
<Checkbox v-model="submit" class="ml20" v-if="status == 0"
>是否送审</Checkbox
>
</FormItem>
</Form>
<Modal v-model="examineModal" title="合格证送审" footer-hide fullscreen :mask-closable="false">
<Modal
v-model="examineModal"
title="合格证送审"
footer-hide
fullscreen
:mask-closable="false"
>
<Examine :isId="isId" ref="examine" @on-close="close"></Examine>
</Modal>
</div>
......@@ -135,10 +188,10 @@ import Examine from "../endIssued/examine";
export default {
name: "Add",
props: {
eid: Number
eid: Number,
},
components: {
Examine
Examine,
},
data() {
return {
......@@ -153,12 +206,13 @@ export default {
app: "certificateUrl", //服务
eid: null, //记录id
name: "ProductCertificateExamItem", //表名(检验项表名)
field: "file" //字段名
field: "file", //字段名
},
disabled: false,
entity: {
id: 0,
status: ""
status: "",
items: [],
},
rules: {
// userUnit: [{ required: true, message: "必填", trigger: "change" }],
......@@ -166,68 +220,68 @@ export default {
},
easySearch: {
keys: { op: "mesCode", value: "" },
type: { op: "Equal", value: 1 }
type: { op: "Equal", value: 1 },
},
columns: [
{
title: "序号",
type: "index",
width: 80,
align: "center"
align: "center",
},
{
title: "检验项目",
key: "name",
align: "center",
slot: "name"
slot: "name",
},
{
title: "要求",
key: "require",
align: "center",
slot: "require"
slot: "require",
},
{
title: "预测结果",
key: "result",
align: "center",
slot: "result"
slot: "result",
},
{
key: "file",
title: "附件",
slot: "pash",
width: 400,
align: "center"
align: "center",
},
{
title: "结论",
key: "conclusion",
align: "center",
slot: "conclusion"
slot: "conclusion",
},
{
title: "备注",
align: "center",
key: "remark",
slot: "remark"
slot: "remark",
},
{
title: "操作",
slot: "action",
width: 100,
align: "center"
}
align: "center",
},
],
checkList: []
checkList: [],
};
},
created() {
this.addNew();
this.isDisabled = true;
Api.getbyid({
id: "207b59eb-4fca-4324-b5cd-46f48a5ff21d"
}).then(r => {
id: "207b59eb-4fca-4324-b5cd-46f48a5ff21d",
}).then((r) => {
this.status = r.result.status; //status为0的话为启用,有送审,为1的话,流程是禁用的,没有送审按钮
if (this.status == 0) {
this.submit = true;
......@@ -241,8 +295,8 @@ export default {
this.entity.productQuantity = e.length + "";
},
getOrder(v) {
Api.testItems({ id: v }).then(r => {
if (r.result !== null) {
Api.testItems({ id: v }).then((r) => {
if (r.result) {
this.checkList = r.result;
}
});
......@@ -251,11 +305,15 @@ export default {
this.$set(this.checkList, index, row);
},
handleSubmit() {
this.entity.items = this.checkList;
this.entity.items.forEach(c => {
let item = [];
item = this.checkList;
if (item) {
item.forEach((c) => {
return delete c.id;
});
this.$refs.form.validate(v => {
}
this.entity.items = item;
this.$refs.form.validate((v) => {
this.arrId = [];
if (v) {
this.disabled = true;
......@@ -270,7 +328,7 @@ export default {
if (this.submit == true) {
//送审
Api.create(this.entity)
.then(r => {
.then((r) => {
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
......@@ -283,14 +341,14 @@ export default {
this.disabled = false;
}
})
.catch(err => {
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
});
} else {
Api.create(this.entity)
.then(r => {
.then((r) => {
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
......@@ -301,7 +359,7 @@ export default {
this.disabled = false;
}
})
.catch(err => {
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
......@@ -320,7 +378,7 @@ export default {
if (this.checkList) {
let obj = {
file: "",
fileId: this.$u.guid()
fileId: this.$u.guid(),
};
this.checkList.push(obj);
} else {
......@@ -328,7 +386,7 @@ export default {
this.checkList = arr;
let obj = {
file: "",
fileId: this.$u.guid()
fileId: this.$u.guid(),
};
this.checkList.push(obj);
}
......@@ -343,7 +401,7 @@ export default {
l(key) {
key = "waitOpened" + "." + key;
return this.$t(key);
}
},
},
watch: {
v() {
......@@ -354,8 +412,8 @@ export default {
this.checkList = [];
this.getOrder(v);
}
}
}
},
},
};
</script>
<style lang="less" scoped>
......
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