Commit c81d02e5 authored by 仇晓婷's avatar 仇晓婷

合格证流程判断

parent 3dde29c5
...@@ -33,6 +33,6 @@ export default { ...@@ -33,6 +33,6 @@ export default {
return Api.post(`${workflowUrl}/instance/batchstart`, params); //送审 return Api.post(`${workflowUrl}/instance/batchstart`, params); //送审
}, },
getbyid(params) { getbyid(params) {
return Api.get(`${workflowUrl}/schema/getbyid`, params); //流程 return Api.get(`${workflowUrl}/schema/getbyid`, params); //流程判断启用禁用
}, },
} }
\ No newline at end of file
...@@ -34,6 +34,8 @@ export default { ...@@ -34,6 +34,8 @@ export default {
batchstart(params) { batchstart(params) {
return Api.post(`${workflowUrl}/instance/batchstart`, params); //合格证送审 return Api.post(`${workflowUrl}/instance/batchstart`, params); //合格证送审
}, },
getbyid(params) {
return Api.get(`${workflowUrl}/schema/getbyid`, params); //流程判断启用禁用
},
} }
\ No newline at end of file
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<Checkbox <Checkbox
v-model="index" v-model="index"
@change.native="changeBox(index,item.id)" @change.native="changeBox(index,item.id)"
v-if="item.status==1" v-if="item.status==1 && status==0"
> >
<state code="qms.certificate.status" :value="item.status" /> <state code="qms.certificate.status" :value="item.status" />
</Checkbox> </Checkbox>
...@@ -60,13 +60,13 @@ ...@@ -60,13 +60,13 @@
</template> </template>
<script> <script>
import Api from '../../certificate/api' import Api from "../../certificate/api";
import PdfDetail from './pdfDetail' import PdfDetail from "./pdfDetail";
import Edit from './edit' import Edit from "./edit";
import Examine from './examine' import Examine from "./examine";
export default { export default {
name: '', name: "",
components: { components: {
PdfDetail, PdfDetail,
Edit, Edit,
...@@ -77,6 +77,7 @@ export default { ...@@ -77,6 +77,7 @@ export default {
}, },
data() { data() {
return { return {
status: 0,
zanwushuju: false, zanwushuju: false,
index: false, index: false,
arrId: [], arrId: [],
...@@ -98,95 +99,101 @@ export default { ...@@ -98,95 +99,101 @@ export default {
checkboxList: [], checkboxList: [],
indeterminate: true, indeterminate: true,
checkAll: false checkAll: false
} };
},
created() {
Api.getbyid({
id: "207b59eb-4fca-4324-b5cd-46f48a5ff21d"
}).then(r => {
this.status = r.result.status; //status为0的话为启用,有送审,为1的话,流程是禁用的,没有送审按钮
});
}, },
methods: { methods: {
load(v) { load(v) {
Api.ordercertificate({ id: v }).then(r => {
Api.ordercertificate({ id: v }).then((r) => { this.checkboxList = r.result;
this.checkboxList = r.result
if (this.checkboxList) { if (this.checkboxList) {
this.zanwushuju = false this.zanwushuju = false;
} else { } else {
this.zanwushuju = true this.zanwushuju = true;
} }
}) });
}, },
handleExport(id) { handleExport(id) {
this.pdfModal = true this.pdfModal = true;
this.curId = id this.curId = id;
}, },
addOk() { addOk() {
this.editModal = false this.editModal = false;
this.curId = null this.curId = null;
this.$emit('on-ok') this.$emit("on-ok");
}, },
cancel() { cancel() {
this.editModal = false this.editModal = false;
this.examineModal = false this.examineModal = false;
}, },
edit(id) { edit(id) {
this.editModal = true this.editModal = true;
this.curId = id this.curId = id;
}, },
delet(id) { delet(id) {
this.$Modal.confirm({ this.$Modal.confirm({
title: '删除', title: "删除",
content: '<p>您确定要删除此合格证吗</p>', content: "<p>您确定要删除此合格证吗</p>",
onOk: () => { onOk: () => {
Api.certificatedelete({ id: id }).then((r) => { Api.certificatedelete({ id: id }).then(r => {
if (r.result) { if (r.result) {
this.$Message.info('删除成功') this.$Message.info("删除成功");
this.load(this.eid) this.load(this.eid);
} }
}) });
}, },
onCancel: () => { onCancel: () => {
this.$Message.info('已取消删除') this.$Message.info("已取消删除");
} }
}) });
}, },
canselFooter() {}, canselFooter() {},
upChange() { upChange() {
if (this.arr.length == 1) { if (this.arr.length == 1) {
this.$refs.examine.info = true this.$refs.examine.info = true;
this.$refs.examine.tableInfo = false this.$refs.examine.tableInfo = false;
} else { } else {
this.$refs.examine.info = false this.$refs.examine.info = false;
this.$refs.examine.tableInfo = true this.$refs.examine.tableInfo = true;
} }
this.arrId = this.arr this.arrId = this.arr;
this.examineModal = true this.examineModal = true;
}, },
changeBox(index, id) { changeBox(index, id) {
if (index == true) { if (index == true) {
this.arr.push(id) this.arr.push(id);
} else if (index == false) { } else if (index == false) {
for (var i = 0; i < this.arr.length; i++) { for (var i = 0; i < this.arr.length; i++) {
if (this.arr[i] == id) { if (this.arr[i] == id) {
this.arr.splice(i, 1) this.arr.splice(i, 1);
} }
} }
return this.arr return this.arr;
} }
} }
}, },
watch: { watch: {
eid(v) { eid(v) {
if (v != null) { if (v != null) {
this.checkboxList = [] this.checkboxList = [];
this.load(v) this.load(v);
} }
}, },
arr(v) { arr(v) {
if (this.arr.length >= 1) { if (this.arr.length >= 1) {
this.show = true this.show = true;
} else { } else {
this.show = false this.show = false;
} }
} }
} }
} };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
...@@ -240,6 +247,5 @@ a { ...@@ -240,6 +247,5 @@ a {
} }
.shuju { .shuju {
margin: 30px 0 30px 48%; margin: 30px 0 30px 48%;
} }
</style> </style>
\ No newline at end of file
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
<Checkbox v-model="submit" class="ml20">是否送审</Checkbox> <Checkbox v-model="submit" class="ml20" v-if="status==0">是否送审</Checkbox>
</FormItem> </FormItem>
</Form> </Form>
<Modal v-model="examineModal" title="合格证送审" footer-hide fullscreen :mask-closable="false"> <Modal v-model="examineModal" title="合格证送审" footer-hide fullscreen :mask-closable="false">
...@@ -130,10 +130,10 @@ ...@@ -130,10 +130,10 @@
</div> </div>
</template> </template>
<script> <script>
import Api from '../../certificate/api' import Api from "../../certificate/api";
import Examine from '../endIssued/examine' import Examine from "../endIssued/examine";
export default { export default {
name: 'Add', name: "Add",
props: { props: {
eid: Number eid: Number
}, },
...@@ -142,207 +142,221 @@ export default { ...@@ -142,207 +142,221 @@ export default {
}, },
data() { data() {
return { return {
isId: '', isId: "",
examineModal: false, examineModal: false,
submit: true, submit: true,
isDisabled: false, isDisabled: false,
codeDisabled: false, codeDisabled: false,
results: [], results: [],
status: 0,
parms: { parms: {
app: 'certificateUrl', //服务 app: "certificateUrl", //服务
eid: null, //记录id eid: null, //记录id
name: 'ProductCertificateExamItem', //表名(检验项表名) name: "ProductCertificateExamItem", //表名(检验项表名)
field: 'file' //字段名 field: "file" //字段名
}, },
disabled: false, disabled: false,
entity: { entity: {
id: 0 id: 0,
status: ""
}, },
rules: { rules: {
businessName: [{ required: true, message: '必填', trigger: 'blur' }], // userUnit: [{ required: true, message: "必填", trigger: "change" }],
businessCode: [{ required: true, message: '必填', trigger: 'blur' }] // productQuantity: [{ required: true, message: "必填", trigger: "change" }]
}, },
easySearch: { easySearch: {
keys: { op: 'mesCode', value: '' }, keys: { op: "mesCode", value: "" },
type: { op: 'Equal', value: 1 } type: { op: "Equal", value: 1 }
}, },
columns: [ columns: [
{ {
title: '序号', title: "序号",
type: 'index', type: "index",
width: 80, width: 80,
align: 'center' align: "center"
}, },
{ {
title: '检验项目', title: "检验项目",
key: 'name', key: "name",
align: 'center', align: "center",
slot: 'name' slot: "name"
}, },
{ {
title: '要求', title: "要求",
key: 'require', key: "require",
align: 'center', align: "center",
slot: 'require' slot: "require"
}, },
{ {
title: '预测结果', title: "预测结果",
key: 'result', key: "result",
align: 'center', align: "center",
slot: 'result' slot: "result"
}, },
{ {
key: 'file', key: "file",
title: '附件', title: "附件",
slot: 'pash', slot: "pash",
width: 400, width: 400,
align: 'center' align: "center"
}, },
{ {
title: '结论', title: "结论",
key: 'conclusion', key: "conclusion",
align: 'center', align: "center",
slot: 'conclusion' slot: "conclusion"
}, },
{ {
title: '备注', title: "备注",
align: 'center', align: "center",
key: 'remark', key: "remark",
slot: 'remark' slot: "remark"
}, },
{ {
title: '操作', title: "操作",
slot: 'action', slot: "action",
width: 100, width: 100,
align: 'center' align: "center"
} }
], ],
checkList: [] checkList: []
} };
}, },
created() { created() {
this.addNew() this.addNew();
this.isDisabled = true this.isDisabled = true;
Api.getbyid({
id: "207b59eb-4fca-4324-b5cd-46f48a5ff21d"
}).then(r => {
this.status = r.result.status; //status为0的话为启用,有送审,为1的话,流程是禁用的,没有送审按钮
if (this.status == 0) {
this.submit = true;
} else {
this.submit = false;
}
});
}, },
methods: { methods: {
change(e) { change(e) {
this.entity.productQuantity = e.length + '' this.entity.productQuantity = e.length + "";
}, },
getOrder(v) { getOrder(v) {
Api.testItems({ id: v }).then((r) => { Api.testItems({ id: v }).then(r => {
if (r.result !== null) { if (r.result !== null) {
this.checkList = r.result this.checkList = r.result;
} }
}) });
}, },
setRow(row, index) { setRow(row, index) {
this.$set(this.checkList, index, row) this.$set(this.checkList, index, row);
}, },
handleSubmit() { handleSubmit() {
this.entity.items = this.checkList this.entity.items = this.checkList;
this.entity.items.forEach(c => {
this.entity.items.forEach((c) => { return delete c.id;
return delete c.id });
}) this.$refs.form.validate(v => {
this.$refs.form.validate((v) => { this.arrId = [];
this.arrId = []
if (v) { if (v) {
this.disabled = true this.disabled = true;
this.entity.orderId = this.$refs.codes.orderId this.entity.orderId = this.$refs.codes.orderId;
this.entity.codeIds = this.$refs.codes.codeIds this.entity.codeIds = this.$refs.codes.codeIds;
this.entity.productSerialNumber = this.entity.productSerialNumber.join( this.entity.productSerialNumber = this.entity.productSerialNumber.join(
',' ","
) );
if (this.status == 1) {
this.entity.status = 4;
}
if (this.submit == true) { if (this.submit == true) {
//送审 //送审
Api.create(this.entity) Api.create(this.entity)
.then((r) => { .then(r => {
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.$emit('on-ok') this.$emit("on-ok");
this.entity = {} this.entity = {};
this.disabled = false this.disabled = false;
this.isId = r.result this.isId = r.result;
this.examineModal = true this.examineModal = true;
} else { } else {
this.$Message.error('保存失败') this.$Message.error("保存失败");
this.disabled = false this.disabled = false;
} }
}) })
.catch((err) => { .catch(err => {
this.disabled = false this.disabled = false;
this.$Message.error('保存失败') this.$Message.error("保存失败");
console.warn(err) console.warn(err);
}) });
} else { } else {
Api.create(this.entity) Api.create(this.entity)
.then((r) => { .then(r => {
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.$emit('on-ok') this.$emit("on-ok");
this.entity = {} this.entity = {};
this.disabled = false this.disabled = false;
} else { } else {
this.$Message.error('保存失败') this.$Message.error("保存失败");
this.disabled = false this.disabled = false;
} }
}) })
.catch((err) => { .catch(err => {
this.disabled = false this.disabled = false;
this.$Message.error('保存失败') this.$Message.error("保存失败");
console.warn(err) console.warn(err);
}) });
} }
} }
}) });
}, },
remove(index) { remove(index) {
this.checkList.splice(index, 1) this.checkList.splice(index, 1);
}, },
getParams(id) { getParams(id) {
return 'app=qms&name=ProductCertificateExamItem&field=file&eid=' + id return "app=qms&name=ProductCertificateExamItem&field=file&eid=" + id;
}, },
addNew() { addNew() {
if (this.checkList) { if (this.checkList) {
let obj = { let obj = {
file: '', file: "",
fileId: this.$u.guid() fileId: this.$u.guid()
} };
this.checkList.push(obj) this.checkList.push(obj);
} else { } else {
var arr = new Array() var arr = new Array();
this.checkList = arr this.checkList = arr;
let obj = { let obj = {
file: '', file: "",
fileId: this.$u.guid() fileId: this.$u.guid()
} };
this.checkList.push(obj) this.checkList.push(obj);
} }
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
close() { close() {
this.examineModal = false this.examineModal = false;
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'waitOpened' + '.' + key key = "waitOpened" + "." + key;
return this.$t(key) return this.$t(key);
} }
}, },
watch: { watch: {
v() { v() {
this.entity = this.$u.clone(this.v) this.entity = this.$u.clone(this.v);
}, },
eid(v) { eid(v) {
if (v != 0) { if (v != 0) {
this.checkList = [] this.checkList = [];
this.getOrder(v) this.getOrder(v);
} }
} }
} }
} };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.jy-boder { .jy-boder {
......
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