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

合格证流程判断

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