Commit 01e40f49 authored by 周远喜's avatar 周远喜

ok

parent c5779eec
...@@ -17,6 +17,23 @@ ...@@ -17,6 +17,23 @@
<span :title="item.value">{{ item.label }}</span> <span :title="item.value">{{ item.label }}</span>
</Radio> </Radio>
</RadioGroup> </RadioGroup>
<CheckboxGroup
v-else-if="type === 'checkbox'"
ref="dicradio"
v-model="name"
@on-change="change"
:vertical="vertical"
>
<Checkbox
v-for="(item, index) in dic"
:disabled="item.disabled"
:label="item.value"
:key="index"
:border="border"
>
<span :title="item.value">{{ item.label }}</span>
</Checkbox>
</CheckboxGroup>
<Select <Select
v-else v-else
:placeholder="placeholder" :placeholder="placeholder"
......
...@@ -1329,12 +1329,12 @@ export default { ...@@ -1329,12 +1329,12 @@ export default {
routingHeaderId: '工艺ID', routingHeaderId: '工艺ID',
routingHeaderName: '工艺', routingHeaderName: '工艺',
routingDetailId: '工序ID', routingDetailId: '工序ID',
routingDetailName: '工序名称', routingDetailName: '工序',
routingDetailNo: '工序号', routingDetailNo: '工序号',
routingStepId: '工步ID', routingStepId: '工步ID',
checkContent: '检测内容', checkContent: '检测内容',
checkType: '检测类型', checkType: '检测类型',
checkParams: '检测要求', checkParams: '检测参数',
measurementUnit: '测量单位', measurementUnit: '测量单位',
fillintype: '填报类型', fillintype: '填报类型',
isphotograph: '是否拍照', isphotograph: '是否拍照',
......
...@@ -70,6 +70,11 @@ ...@@ -70,6 +70,11 @@
</Select> </Select>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12">
<FormItem :label="l('checkType')" prop="checkType">
<Dictionary code="QC.checktype" v-model="entity.checkType" type="checkbox"></Dictionary>
</FormItem>
</Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('checkParams')" prop="checkParams"> <FormItem :label="l('checkParams')" prop="checkParams">
<Input v-model="entity.checkParams"></Input> <Input v-model="entity.checkParams"></Input>
...@@ -80,24 +85,15 @@ ...@@ -80,24 +85,15 @@
<Input v-model="entity.standard"></Input> <Input v-model="entity.standard"></Input>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('checkType')" prop="checkType">
<Dictionary
code="QC.checktype"
v-model="entity.checkType"
@on-change="checkChange"
type="radio"
></Dictionary>
</FormItem>
</Col>
<Col :span="12" v-if="raidoDis">
<FormItem :label="l('isphotograph')" prop="isphotograph"> <FormItem :label="l('isphotograph')" prop="isphotograph">
<Dictionary code="Process.state" v-model="entity.isphotograph" type="radio"></Dictionary> <Dictionary code="Process.state" v-model="entity.isphotograph" type="radio"></Dictionary>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('fillintype')" prop="fillintype"> <FormItem :label="l('fillintype')" prop="fillintype">
<Dictionary code="QC.fillintype" v-model="entity.fillintype"></Dictionary> <Dictionary code="QC.fillintype" v-model="entity.fillintype" type="radio"></Dictionary>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
...@@ -111,11 +107,16 @@ ...@@ -111,11 +107,16 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
<FormItem :label="l('qualityTemplateName')" prop="qualityTemplateName"> <FormItem :label="l('qualityTemplate')" prop="qualityTemplate">
<!-- <files ref="refFile" :parms="parms" files singleFile /> --> <InputFile v-model="entity.qualityTemplate" :parms="parms" />
<InputFile v-model="entity.qualityTemplateName"/>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="QC.status" v-model="entity.status" type="radio"></Dictionary>
</FormItem>
</Col>
<!-- <!--
<files ref="refFile" :parms="parms" files singleFile /> <files ref="refFile" :parms="parms" files singleFile />
<Col :span="12"> <Col :span="12">
...@@ -155,11 +156,7 @@ ...@@ -155,11 +156,7 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="8">
<FormItem :label="l('status')" prop="status">
<Dictionary code="Process.Status" v-model="entity.status" type="radio"></Dictionary>
</FormItem>
</Col>
<Col :span="24"> <Col :span="24">
...@@ -189,13 +186,13 @@ export default { ...@@ -189,13 +186,13 @@ export default {
routingDetailId: null, routingDetailId: null,
routingStepId: 0, routingStepId: 0,
checkContent: "", checkContent: "",
checkType: null, checkType: [1],
checkParams: "", checkParams: "",
measurementUnit: "", measurementUnit: "",
fillintype: null, fillintype: 2,
qualityTemplate: "", qualityTemplate: "",
isphotograph: null, isphotograph: 0,
status: null, status: 1,
extend: "", extend: "",
remark: "", remark: "",
productionRequirement: "", productionRequirement: "",
...@@ -211,12 +208,21 @@ export default { ...@@ -211,12 +208,21 @@ export default {
tempFile: "", tempFile: "",
rules: { rules: {
routingDetailId: [ routingDetailId: [
{ required: true, message: "请选择工序名称", type: "number" } { required: true, message: "请选择工序", type: "number" }
], ],
checkContent: [{ required: true, message: "必填", trigger: "blur" }] checkContent: [{ required: true, message: "必填", trigger: "blur" }],
checkType: [
{
required: true,
message: "检测类型至少选择一项",
type: "array",
min: 1,
trigger: "change"
}
]
}, },
routingDetailList: [], routingDetailList: [],
parms: "app=qccard&eid=" + this.$u.guid() + "&name=''" parms: "app=qccard&eid=" + this.$u.guid() + "&name=qualityTemplateName"
// parms: { // parms: {
// app: "qccard", // app: "qccard",
// eid: null, // eid: null,
...@@ -232,8 +238,6 @@ export default { ...@@ -232,8 +238,6 @@ export default {
}, },
mounted() { mounted() {
this.loadDetails(); this.loadDetails();
this.parms.eid = this.$u.guid();
this.$refs.refFile.intFiles();
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
...@@ -248,23 +252,7 @@ export default { ...@@ -248,23 +252,7 @@ export default {
this.entity.qualityTemplateName = ""; this.entity.qualityTemplateName = "";
this.entity.qualityTemplate = ""; this.entity.qualityTemplate = "";
} }
// if (this.$refs.refFile.nameList.length > 0) {
// let nameList = this.$refs.refFile.nameList;
// let names = [];
// let url = [];
// nameList.forEach(e => {
// names.push(e.fileName);
// url.push(e.filePath);
// });
// this.entity.qualityTemplateName = JSON.stringify(names)
// .replace("[", "")
// .replace("]", "")
// .replace(/\"/g, ""); //附件本地库暂存文件名称
// this.entity.qualityTemplate = JSON.stringify(url)
// .replace("[", "")
// .replace("]", "")
// .replace(/\"/g, "");
// }
this.entity.routingHeaderId = this.headid; this.entity.routingHeaderId = this.headid;
Api.create(this.entity) Api.create(this.entity)
...@@ -273,8 +261,6 @@ export default { ...@@ -273,8 +261,6 @@ export default {
if (r.success) { if (r.success) {
this.$Message.success("保存成功"); this.$Message.success("保存成功");
this.$emit("on-ok"); this.$emit("on-ok");
//let newId = r.result
//this.updateEid(newId) //更新服务器上的id
} else { } else {
this.$Message.error("保存失败"); this.$Message.error("保存失败");
} }
...@@ -307,41 +293,13 @@ export default { ...@@ -307,41 +293,13 @@ export default {
tempDetails.forEach(data => { tempDetails.forEach(data => {
let tempObj = {}; let tempObj = {};
tempObj.value = data.id; tempObj.value = data.id;
tempObj.label = data.name; tempObj.label = data.taskSeq + " " + data.name;
tempD.push(tempObj); tempD.push(tempObj);
}); });
this.routingDetailList = tempD; this.routingDetailList = tempD;
}); });
}, },
//新增时将uid转为eid
updateEid(newId) {
let parms = {
eid: this.parms.eid,
id: newId + ""
};
this.$http.sysUser.updateEid(parms).then(res => {
if (res.status) {
// this.$Message.success('修改成功!')
} else {
//this.$Message.error('修改失败!')
}
});
},
checkChange(v) {
if (v == 1 || v == 2) {
this.raidoDis = false;
this.entity.isphotograph = null;
} else {
this.raidoDis = true;
if (this.entity.isphotograph == null) {
this.entity.isphotograph = 1;
}
}
},
clearCheck() {
this.raidoDis = false;
this.entity.isphotograph = null;
},
l(key) { l(key) {
key = "routing_qc_card" + "." + key; key = "routing_qc_card" + "." + key;
return this.$t(key); return this.$t(key);
......
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="100"> <Form ref="form" :model="entity" :rules="rules" :label-width="100">
<Row> <Row>
<!--
<Col :span="12">
<FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('creatorUserId')" prop="creatorUserId">
<InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModificationTime')" prop="lastModificationTime">
<DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isDeleted')" prop="isDeleted">
<Input v-model="entity.isDeleted"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deleterUserId')" prop="deleterUserId">
<InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deletionTime')" prop="deletionTime">
<DatePicker type="date" v-model="entity.deletionTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('extend')" prop="extend">
<Input v-model="entity.extend"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('routingStepId')" prop="routingStepId">
<InputNumber v-model="entity.routingStepId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('routingHeaderName')" prop="routingHeaderId">
<InputNumber v-model="entity.routingHeaderId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('qualityTemplate')" prop="qualityTemplate">
<Input v-model="entity.qualityTemplate" type="textarea" :rows="2"></Input>
</FormItem>
</Col>
-->
<Col :span="12"> <Col :span="12">
<FormItem :label="l('routingDetailName')" prop="routingDetailId"> <FormItem :label="l('routingDetailName')" prop="routingDetailId">
<Select v-model="entity.routingDetailId"> <Select v-model="entity.routingDetailId">
...@@ -12,6 +70,11 @@ ...@@ -12,6 +70,11 @@
</Select> </Select>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12">
<FormItem :label="l('checkType')" prop="checkType">
<Dictionary code="QC.checktype" v-model="entity.checkType" type="checkbox"></Dictionary>
</FormItem>
</Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('checkParams')" prop="checkParams"> <FormItem :label="l('checkParams')" prop="checkParams">
<Input v-model="entity.checkParams"></Input> <Input v-model="entity.checkParams"></Input>
...@@ -22,24 +85,15 @@ ...@@ -22,24 +85,15 @@
<Input v-model="entity.standard"></Input> <Input v-model="entity.standard"></Input>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('checkType')" prop="checkType">
<Dictionary
code="QC.checktype"
v-model="entity.checkType"
@on-change="checkChange"
type="radio"
></Dictionary>
</FormItem>
</Col>
<Col :span="12" v-if="raidoDis">
<FormItem :label="l('isphotograph')" prop="isphotograph"> <FormItem :label="l('isphotograph')" prop="isphotograph">
<Dictionary code="Process.state" v-model="entity.isphotograph" type="radio"></Dictionary> <Dictionary code="Process.state" v-model="entity.isphotograph" type="radio"></Dictionary>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('fillintype')" prop="fillintype"> <FormItem :label="l('fillintype')" prop="fillintype">
<Dictionary code="QC.fillintype" v-model="entity.fillintype"></Dictionary> <Dictionary code="QC.fillintype" v-model="entity.fillintype" type="radio"></Dictionary>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
...@@ -53,18 +107,64 @@ ...@@ -53,18 +107,64 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
<FormItem :label="l('qualityTemplateName')" prop="qualityTemplateName"> <FormItem :label="l('qualityTemplate')" prop="qualityTemplate">
<inputFile ref="inputfile" v-model="tempFile" :parms="parms" /> <InputFile v-model="entity.qualityTemplate" :parms="parms" />
<!-- </FormItem>
<files ref="refFile" :parms="parms" files singleFile /> </Col>
<a <Col :span="12">
:href="fileUrlPath" <FormItem :label="l('status')" prop="status">
@click="downFile(entity.qualityTemplate)" <Dictionary code="QC.status" v-model="entity.status" type="radio"></Dictionary>
target="_blank" </FormItem>
>{{entity.qualityTemplateName}}</a> </Col>
-->
<!--
<files ref="refFile" :parms="parms" files singleFile />
<Col :span="12">
<FormItem :label="l('isImportant')" prop="isImportant">
<Dictionary code="Process.state" v-model="entity.isImportant" type="radio"></Dictionary>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12">
<FormItem :label="l('firstCheck')" prop="firstCheck">
<Dictionary code="Process.state" v-model="entity.firstCheck" type="radio"></Dictionary>
</FormItem>
</Col>
<Col :span="6">
<FormItem :label="l('inspection')" prop="inspection">
<Dictionary code="Process.state" v-model="entity.inspection" type="radio"></Dictionary>
</FormItem>
</Col>
<Col :span="6">
<FormItem :label="l('inspectionTime')" prop="inspectionTime">
<InputNumber v-model="entity.inspectionTime"></InputNumber>
</FormItem>
</Col>
<Col :span="6">
<FormItem :label="l('sampling')" prop="sampling">
<Dictionary code="Process.state" v-model="entity.sampling" type="radio"></Dictionary>
</FormItem>
</Col>
<Col :span="6">
<FormItem :label="l('samplingBatch')" prop="samplingBatch">
<Input v-model="entity.samplingBatch"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('measurementUnit')" prop="measurementUnit">
<Input v-model="entity.measurementUnit"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('remark')" prop="remark">
<Input v-model="entity.remark" type="textarea" :rows="2"></Input>
</FormItem>
</Col>
-->
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
...@@ -86,16 +186,22 @@ export default { ...@@ -86,16 +186,22 @@ export default {
tempFile: "", tempFile: "",
tempFileName: "", tempFileName: "",
tempFilePath: "", tempFilePath: "",
entity: { entity: {},
qualityTemplateName: "",
qualityTemplate: ""
},
rules: { rules: {
routingDetailId: [ routingDetailId: [
{ required: true, message: "请选择工序名称", type: "number" } { required: true, message: "请选择工序", type: "number" }
], ],
checkContent: [{ required: true, message: "必填", trigger: "blur" }] checkContent: [{ required: true, message: "必填", trigger: "blur" }],
checkType: [
{
required: true,
message: "检测类型至少选择一项",
type: "array",
min: 1,
trigger: "change"
}
]
}, },
routingDetailList: [], routingDetailList: [],
parms: "app=qccard&eid=" + this.$u.guid() + "&name=''" parms: "app=qccard&eid=" + this.$u.guid() + "&name=''"
...@@ -120,16 +226,8 @@ export default { ...@@ -120,16 +226,8 @@ export default {
}, },
methods: { methods: {
load(v) { load(v) {
Api.get({ id: v }).then(r => { Api.get({ id: v }).then(r => {
this.entity = r.result; this.entity = r.result;
this.$refs.inputfile.newName = this.entity.qualityTemplateName;
this.$refs.inputfile.newPath = this.entity.qualityTemplate;
if (r.result.checkType == 1 || r.result.checkType == 2) {
this.raidoDis = false;
this.entity.isphotograph = null;
} else {
this.raidoDis = true;
}
}); });
}, },
downFile(path) { downFile(path) {
...@@ -139,11 +237,6 @@ export default { ...@@ -139,11 +237,6 @@ export default {
this.$refs.form.validate(v => { this.$refs.form.validate(v => {
if (v) { if (v) {
this.disabled = true; this.disabled = true;
if (this.tempFile != "") {
let tempName = JSON.parse(this.$u.clone(this.tempFile));
this.entity.qualityTemplateName = tempName[0].fileName;
this.entity.qualityTemplate = tempName[0].filePath;
}
Api.update(this.entity) Api.update(this.entity)
.then(r => { .then(r => {
this.disabled = false; this.disabled = false;
...@@ -176,23 +269,12 @@ export default { ...@@ -176,23 +269,12 @@ export default {
tempDetails.forEach(data => { tempDetails.forEach(data => {
let tempObj = {}; let tempObj = {};
tempObj.value = data.id; tempObj.value = data.id;
tempObj.label = data.name; tempObj.label = data.taskSeq + " " + data.name;
tempD.push(tempObj); tempD.push(tempObj);
}); });
this.routingDetailList = tempD; this.routingDetailList = tempD;
}); });
}, },
checkChange(v) {
if (v == 1 || v == 2) {
this.raidoDis = false;
this.entity.isphotograph = null;
} else {
this.raidoDis = true;
if (this.entity.isphotograph == null) {
this.entity.isphotograph = 1;
}
}
},
l(key) { l(key) {
key = "routing_qc_card" + "." + key; key = "routing_qc_card" + "." + key;
return this.$t(key); return this.$t(key);
......
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