Commit cecdd148 authored by renjintao's avatar renjintao

Merge branch 'product' of git.mes123.com:zhouyx/mes-ui into product-rjt

parents cf1d1d01 e86694d7
......@@ -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 {
......
<template>
<div class="wait-opened">
<DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch" :high="false" :height="tdHeight" ></DataGrid>
<DataGrid
:columns="columns"
ref="grid"
:action="action"
:conditions="easySearch"
:high="false"
:height="tdHeight"
></DataGrid>
<Modal v-model="addModal" title="开合格证" fullscreen footer-hide :mask-closable="false">
<Add @on-close="cancel" @on-ok="addOk" :eid="curId" ref="addFile" />
</Modal>
......@@ -8,10 +15,10 @@
</template>
<script>
import Api from '../api'
import Add from './add'
import Api from "../api";
import Add from "./add";
export default {
name: 'index',
name: "index",
components: {
Add
},
......@@ -21,144 +28,144 @@ export default {
checkLists: [],
addModal: false,
curId: null,
tdHeight:'',
tdHeight: "",
columns: [
{ key: 'id', title: this.l('id'), hide: true, align: 'left' },
{ key: "id", title: this.l("id"), hide: true, align: "left" },
{
key: 'mesCode',
title: this.l('mesCode'),
align: 'left',
key: "mesCode",
title: this.l("mesCode"),
align: "left",
easy: true,
high: true
},
{
key: 'productName',
title: this.l('productName'),
align: 'left',
key: "productName",
title: this.l("productName"),
align: "left",
easy: true,
high: true
},
{
key: 'drawnNumber',
title: this.l('drawnNumber'),
align: 'left',
key: "drawnNumber",
title: this.l("drawnNumber"),
align: "left",
easy: true,
high: true
},
{
key: 'quantity',
title: this.l('quantity'),
align: 'left',
key: "quantity",
title: this.l("quantity"),
align: "left",
easy: true,
high: true
},
{
key: 'qualifiedQuantity',
title: this.l('qualifiedQuantity'),
align: 'left',
key: "qualifiedQuantity",
title: this.l("qualifiedQuantity"),
align: "left",
easy: true,
high: true
},
{
key: 'uncertificateQuantity',
title: this.l('uncertificateQuantity'),
align: 'left',
key: "uncertificateQuantity",
title: this.l("uncertificateQuantity"),
align: "left",
easy: true,
high: true
},
{
key: 'actualFinishDate',
title: this.l('actualFinishDate'),
align: 'left',
key: "actualFinishDate",
title: this.l("actualFinishDate"),
align: "left",
easy: true,
high: true,
width: 180,
render: (h, params) => {
return h(
'span',
params.row.actualFinishDate == '0001-01-01 00:00:00'
? ''
"span",
params.row.actualFinishDate == "0001-01-01 00:00:00"
? ""
: params.row.actualFinishDate
)
);
}
},
{
key: 'productingPreparationPeople',
title: this.l('productingPreparationPeople'),
align: 'left',
key: "productingPreparationPeople",
title: this.l("productingPreparationPeople"),
align: "left",
easy: true,
high: true
},
{
key: 'status',
title: this.l('status'),
align: 'left',
key: "status",
title: this.l("status"),
align: "left",
easy: true,
high: true,
code: 'plan.order.status'
code: "plan.order.status"
},
{
title: '操作',
key: 'id',
title: "操作",
key: "id",
// width: 250,
align: 'center',
align: "center",
render: (h, params) => {
return h('div', { class: 'action' }, [
return h("div", { class: "action" }, [
h(
'op',
"op",
{
attrs: {
oprate: 'add'
oprate: "add"
},
on: { click: () => this.add(params.row) }
},
'开合格证'
"开合格证"
)
])
]);
}
}
],
easySearch: {
keys: { op: 'mesCode', value: null, default: true },
type: { op: 'Equal', value: 1 }
keys: { op: "mesCode", value: null, default: true },
type: { op: "Equal", value: 1 }
}
}
};
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
await store.dispatch("loadDictionary"); // 加载数据字典
},
mounted() {},
created() {
this.tdHeight = window.innerHeight - 200
this.tdHeight = window.innerHeight - 200;
},
methods: {
addOk() {
// this.$refs.grid.load()
this.addModal = false
this.curId = 0
this.$refs.grid.load();
this.addModal = false;
this.curId = 0;
},
cancel() {
this.curId = 0
this.addModal = false
this.curId = 0;
this.addModal = false;
},
reload() {
this.$refs.grid.load()
this.$refs.grid.load();
},
add(row) {
this.addModal = true
this.curId = row.id
this.$refs.addFile.entity.productName = row.productName
this.$refs.addFile.entity.productStatus = row.status
this.$refs.addFile.entity.productCode = row.drawnNumber
this.addModal = true;
this.curId = row.id;
this.$refs.addFile.entity.productName = row.productName;
this.$refs.addFile.entity.productStatus = row.status;
this.$refs.addFile.entity.productCode = row.drawnNumber;
},
// 列表title
l(key) {
let vkey = 'waitOpened' + '.' + key
return this.$t(vkey) || key
let vkey = "waitOpened" + "." + key;
return this.$t(vkey) || key;
}
}
}
};
</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