Commit ef14324c authored by 周远喜's avatar 周远喜

okkk

parent 7642b12a
<template> <template>
<div class> <div class="vtr">
<div class="contentRight"> <div class="contentRight">
<div class="form_title"> <div class="form_title">
<Input v-model="value1" placeholder="请输入技术协调单编号" clearable style="width: 240px" /> <Input v-model="value1" placeholder="请输入技术协调单编号" clearable style="width: 240px" />
...@@ -36,7 +36,13 @@ ...@@ -36,7 +36,13 @@
<Form :model="formdata" :label-width="150" :rules="ruleValidate" inline> <Form :model="formdata" :label-width="150" :rules="ruleValidate" inline>
<Row> <Row>
<FormItem label="技术协调单编号"> <FormItem label="技术协调单编号">
<Input v-model="formdata.technical_coordination_code" placeholder size="large" style="width:240px" readonly></Input> <Input
v-model="formdata.technical_coordination_code"
placeholder
size="large"
style="width:240px"
readonly
></Input>
</FormItem> </FormItem>
<FormItem label="任务号"> <FormItem label="任务号">
<Input v-model="formdata.taskCode" placeholder="输入任务号" size="large" style="width:240px"></Input> <Input v-model="formdata.taskCode" placeholder="输入任务号" size="large" style="width:240px"></Input>
...@@ -55,7 +61,12 @@ ...@@ -55,7 +61,12 @@
<Input v-model="formdata.drawing" placeholder="输入图号" size="large" style="width:240px"></Input> <Input v-model="formdata.drawing" placeholder="输入图号" size="large" style="width:240px"></Input>
</FormItem> </FormItem>
<FormItem label="产品名称"> <FormItem label="产品名称">
<Input v-model="formdata.product_name" placeholder="输入产品名称" size="large" style="width:240px"></Input> <Input
v-model="formdata.product_name"
placeholder="输入产品名称"
size="large"
style="width:240px"
></Input>
</FormItem> </FormItem>
</Row> </Row>
<!-- <Row> <!-- <Row>
...@@ -67,23 +78,28 @@ ...@@ -67,23 +78,28 @@
<FormItem label="在制品处理意见"> <FormItem label="在制品处理意见">
<textarea v-model="formdata.handling_suggestion" style="width: 600px"></textarea> <textarea v-model="formdata.handling_suggestion" style="width: 600px"></textarea>
</FormItem> </FormItem>
</Row> --> </Row>-->
<Row> <Row>
<FormItem label="产品标识"> <FormItem label="产品标识">
<Input v-model="formdata.product_mark" placeholder="输入产品标识" size="large" style="width:240px"></Input> <Input
v-model="formdata.product_mark"
placeholder="输入产品标识"
size="large"
style="width:240px"
></Input>
</FormItem> </FormItem>
</Row> </Row>
<Row> <Row>
<FormItem label="协调内容"> <FormItem label="协调内容">
<textarea v-model="formdata.coordinate_content" style="width: 645px"></textarea> <textarea v-model="formdata.coordinate_content" style="width: 645px"></textarea>
</FormItem> </FormItem>
</Row> </Row>
<!-- <FormItem label="是否更改设计文件"> <!-- <FormItem label="是否更改设计文件">
<Select v-model="formdata.change_design_file" placeholder="请选择" style="width:225px;"> <Select v-model="formdata.change_design_file" placeholder="请选择" style="width:225px;">
<Option value="是"></Option> <Option value="是"></Option>
<Option value="否"></Option> <Option value="否"></Option>
</Select> </Select>
</FormItem> --> </FormItem>-->
<!-- <Row> <!-- <Row>
<FormItem label="是否更改工艺文件"> <FormItem label="是否更改工艺文件">
<Select v-model="formdata.change_process_file" placeholder="请选择" style="width:225px;"> <Select v-model="formdata.change_process_file" placeholder="请选择" style="width:225px;">
...@@ -101,10 +117,16 @@ ...@@ -101,10 +117,16 @@
<Option value="否"></Option> <Option value="否"></Option>
</Select> </Select>
</FormItem> </FormItem>
</Row> --> </Row>-->
<Row> <Row>
<FormItem label="检验员"> <FormItem label="检验员">
<Input v-model="formdata.inspection_person_name" placeholder size="large" style="width:240px" readonly></Input> <Input
v-model="formdata.inspection_person_name"
placeholder
size="large"
style="width:240px"
readonly
></Input>
</FormItem> </FormItem>
<FormItem label="检验日期"> <FormItem label="检验日期">
<DatePicker <DatePicker
...@@ -135,11 +157,11 @@ ...@@ -135,11 +157,11 @@
</div> </div>
</template> </template>
<script> <script>
import service from '@/plugins/request' import service from "@/plugins/request";
import Department from '@/components/modalTree/department.vue' import Department from "@/components/modalTree/department.vue";
import Process from '@/components/orderOperator/process' import Process from "@/components/orderOperator/process";
import techSendReview from './techSendReview.vue' import techSendReview from "./techSendReview.vue";
import coordinate from './coordinate.vue' import coordinate from "./coordinate.vue";
export default { export default {
components: { components: {
Department, Department,
...@@ -154,20 +176,20 @@ export default { ...@@ -154,20 +176,20 @@ export default {
modalInfo: false, //校验送审弹框 modalInfo: false, //校验送审弹框
formExamine: {}, formExamine: {},
rules: { rules: {
approveUser: [{ required: true, message: '必填', trigger: 'blur' }] approveUser: [{ required: true, message: "必填", trigger: "blur" }]
}, },
technical_coordination_code: '', technical_coordination_code: "",
total: 0, total: 0,
page: 1, page: 1,
pageSize: 10, pageSize: 10,
flag: 0, flag: 0,
id: '', id: "",
data1: [], data1: [],
value1: '', value1: "",
editId: '', editId: "",
up_id: '', up_id: "",
treeData: [], //下拉表格树数据 treeData: [], //下拉表格树数据
title: '新增设备类型', title: "新增设备类型",
show: false, show: false,
// show2: false, // show2: false,
upweb: false, upweb: false,
...@@ -175,120 +197,120 @@ export default { ...@@ -175,120 +197,120 @@ export default {
selectModel02: false, selectModel02: false,
isedit0: false, isedit0: false,
showDeptTree: false, showDeptTree: false,
tbHeight: '', tbHeight: "",
seleId: 0, seleId: 0,
cityList: [], cityList: [],
isShow: true, isShow: true,
seldata: [], //父权限菜单树 seldata: [], //父权限菜单树
parent_name: '', //父权限名 parent_name: "", //父权限名
ruleValidate: { ruleValidate: {
equip_type_id: [ equip_type_id: [
{ {
required: true, required: true,
message: '设备类型编号不能为空!', message: "设备类型编号不能为空!",
trigger: 'blur' trigger: "blur"
} }
] ]
}, },
formdata: { formdata: {
technical_coordination_code: '', technical_coordination_code: "",
id:0, id: 0,
taskCode: '', taskCode: "",
quantity: 0, quantity: 0,
phase: '', phase: "",
drawing: '', drawing: "",
product_name: '', product_name: "",
product_mark: '', product_mark: "",
coordinate_content: '', coordinate_content: "",
coordinate_results: '', coordinate_results: "",
handling_suggestion: '', handling_suggestion: "",
change_design_file: '', change_design_file: "",
change_process_file: '', change_process_file: "",
compilation_temporary_process: '', compilation_temporary_process: "",
inspection_date: '', inspection_date: "",
inspection_person_name: '', inspection_person_name: "",
status: 0, status: 0,
note: '', note: "",
dispatch_id: 0, dispatch_id: 0,
execute_id: 0, execute_id: 0,
order_id: '' order_id: ""
}, },
sysdata: [ sysdata: [
{ {
value: '1', value: "1",
label: '粉末' label: "粉末"
}, },
{ {
value: '2', value: "2",
label: '基板' label: "基板"
}, },
{ {
value: '3', value: "3",
label: '刮刀' label: "刮刀"
} }
], ],
column2: [ column2: [
{ {
type: 'index', type: "index",
title: '序号', title: "序号",
width: '65', width: "65",
align: 'center' align: "center"
}, },
{ {
title: '技术协调单编号', title: "技术协调单编号",
key: 'technical_coordination_code', key: "technical_coordination_code",
align: 'center', align: "center",
width: '200' width: "200"
}, },
{ {
title: '任务号', title: "任务号",
key: 'taskCode', key: "taskCode",
align: 'center', align: "center",
width: '200' width: "200"
}, },
{ {
title: '数量', title: "数量",
key: 'quantity', key: "quantity",
align: 'center', align: "center",
width: '200' width: "200"
}, },
{ {
title: '阶段', title: "阶段",
key: 'phase', key: "phase",
align: 'center', align: "center",
width: '110' width: "110"
}, },
{ {
title: '图号', title: "图号",
key: 'drawing', key: "drawing",
align: 'center', align: "center",
width: '110' width: "110"
}, },
{ {
title: '产品名称', title: "产品名称",
key: 'product_name', key: "product_name",
align: 'center', align: "center",
width: '110' width: "110"
}, },
{ {
title: '产品标识', title: "产品标识",
key: 'product_mark', key: "product_mark",
align: 'center', align: "center",
width: '110' width: "110"
}, },
{ {
title: '状态', title: "状态",
key: 'status', key: "status",
align: 'center', align: "center",
width: 110, width: 110,
render: (h,params) => { render: (h, params) => {
return h('state', { return h("state", {
props: { props: {
code: 'unProduct.repairstatus', code: "unProduct.repairstatus",
type: 'text', type: "text",
value: params.row.status + '' value: params.row.status + ""
} }
}) });
// let statuse = params.row.status // let statuse = params.row.status
// let text = statuse == 1 ? '待送审' : (statuse==2? '审核中':(statuse==3? '通过':(statuse==4? '驳回':(statuse==5? '终止':'')))) // let text = statuse == 1 ? '待送审' : (statuse==2? '审核中':(statuse==3? '通过':(statuse==4? '驳回':(statuse==5? '终止':''))))
// return h('span',{},text) // return h('span',{},text)
...@@ -337,81 +359,82 @@ export default { ...@@ -337,81 +359,82 @@ export default {
// width: '110' // width: '110'
// }, // },
{ {
title: '操作', title: "操作",
key: 'id', key: "id",
align: 'center', align: "center",
width: '280', width: "280",
render: (h, params) => { render: (h, params) => {
let actions = [] let actions = [];
if (params.row.status == 3) { if (params.row.status == 3) {
actions.push( actions.push(
h( h(
'op', "op",
{ {
attrs: { attrs: {
oprate: 'detail' oprate: "detail"
}, },
on: { on: {
click: () => { click: () => {
// e.stopPropagation() // e.stopPropagation()
this.editRow1(params) this.editRow1(params);
}
} }
}
},
'预览'
),
)}
if (params.row.status == 1 ||params.row.status == 4 ) {
actions.push(
h(
'op',
{
attrs: {
oprate: 'detail'
}, },
on: { "预览"
click: () => { )
// e.stopPropagation() );
this.editRow(params) }
if (params.row.status == 1 || params.row.status == 4) {
actions.push(
h(
"op",
{
attrs: {
oprate: "detail"
},
on: {
click: () => {
// e.stopPropagation()
this.editRow(params);
}
} }
} },
}, "编辑"
'编辑' )
), );
)} }
return h('div', { class: 'action' }, actions) return h("div", { class: "action" }, actions);
} }
} }
], ],
data2: [], data2: [],
data3: [], data3: [],
userlist: [] userlist: []
} };
}, },
created() { created() {
this.tbHeight = window.innerHeight - 175;
this.tbHeight = window.innerHeight - 175
}, },
methods: { methods: {
// 分页 // 分页
pageChange(num) { pageChange(num) {
//console.log(num); //console.log(num);
this.page = num this.page = num;
this.loadchangelist() this.loadchangelist();
}, },
pageSizeChange(limit) { pageSizeChange(limit) {
//console.log(limit) //console.log(limit)
this.pageSize = limit this.pageSize = limit;
this.loadchangelist() this.loadchangelist();
}, },
//查询 //查询
searchData() { searchData() {
this.page = 1 this.page = 1;
this.pageSize = 10 this.pageSize = 10;
this.loadchangelist() this.loadchangelist();
}, },
loadchangelist() { loadchangelist() {
let url = `${designUrl}/technicalcoordination/getpaged` let url = `${designUrl}/technicalcoordination/getpaged`;
service service
.get(`${url}`, { .get(`${url}`, {
...@@ -422,185 +445,190 @@ export default { ...@@ -422,185 +445,190 @@ export default {
pageSize: this.pageSize pageSize: this.pageSize
} }
}) })
.then((res) => { .then(res => {
this.data2 = res.data.result.items this.data2 = res.data.result.items;
this.total = res.data.result.totalCount this.total = res.data.result.totalCount;
}) });
}, },
//新增库位 //新增库位
addData() { addData() {
this.submitShow = true this.submitShow = true;
this.title = '生产过程技术协调单' this.title = "生产过程技术协调单";
this.show = true this.show = true;
if(this.formdata.dispatch_id==0) if (this.formdata.dispatch_id == 0) {
{ this.formdata.taskCode = "";
this.formdata.taskCode = '' this.formdata.drawing = "";
this.formdata.drawing = '' this.formdata.product_name = "";
this.formdata.product_name = '' }
} this.formdata.technical_coordination_code = "";
this.formdata.technical_coordination_code = '' this.formdata.id = "";
this.formdata.id=''; this.formdata.quantity = 0;
this.formdata.quantity = 0 this.formdata.phase = "";
this.formdata.phase = ''
this.formdata.product_mark = ''
this.formdata.coordinate_content = ''
this.formdata.coordinate_results = ''
this.formdata.handling_suggestion = ''
this.formdata.change_design_file = ''
this.formdata.change_process_file = ''
this.formdata.compilation_temporary_process = ''
this.formdata.inspection_date = ''
this.formdata.inspection_person_name = localStorage.getItem('userName')
this.formdata.status = 1
this.formdata.note = ''
var url1 = `${designUrl}/routingheader/GetCodeByType?code=JJXTD` this.formdata.product_mark = "";
service.get(`${url1}`).then((response) => { this.formdata.coordinate_content = "";
this.formdata.technical_coordination_code = response.data.result this.formdata.coordinate_results = "";
}) this.formdata.handling_suggestion = "";
this.formdata.change_design_file = "";
this.formdata.change_process_file = "";
this.formdata.compilation_temporary_process = "";
this.formdata.inspection_date = "";
this.formdata.inspection_person_name = localStorage.getItem("userName");
this.formdata.status = 1;
this.formdata.note = "";
var url1 = `${designUrl}/routingheader/GetCodeByType?code=JJXTD`;
service.get(`${url1}`).then(response => {
this.formdata.technical_coordination_code = response.data.result;
});
}, },
handleChange1(date) { handleChange1(date) {
this.formdata.inspection_date = date this.formdata.inspection_date = date;
}, },
// 添加/编辑 弹框的保存 // 添加/编辑 弹框的保存
saveOk() { saveOk() {
var url = `${designUrl}/technicalcoordination/createorupdate` var url = `${designUrl}/technicalcoordination/createorupdate`;
service service
.post(`${url}`, JSON.stringify({ technicalCoordination: this.formdata })) .post(
.then((res) => { `${url}`,
JSON.stringify({ technicalCoordination: this.formdata })
)
.then(res => {
if (res.data.success) { if (res.data.success) {
this.loadchangelist();
this.loadchangelist() this.$Message.success("保存成功");
this.$Message.success('保存成功') this.show = false;
this.show = false if (this.checked == true) {
if(this.checked == true){ let url = `${designUrl}/technicalcoordination/getpaged`;
let url = `${designUrl}/technicalcoordination/getpaged` service
service .get(`${url}`, {
.get(`${url}`, { params: {technical_coordination_code: this.formdata.technical_coordination_code, pageindex:1,pageSize:10 } }) params: {
.then((res) => { technical_coordination_code: this.formdata
console.log(res) .technical_coordination_code,
this.$refs.techSendReview.info.changeInfo = res.data.result.items[0]; pageindex: 1,
this.$refs.techSendReview.technical_coordination_code = this.formdata.technical_coordination_code; pageSize: 10
}) }
this.$refs.techSendReview.modalInfo = true })
} .then(res => {
console.log(res);
this.$refs.techSendReview.info.changeInfo =
res.data.result.items[0];
this.$refs.techSendReview.technical_coordination_code = this.formdata.technical_coordination_code;
});
this.$refs.techSendReview.modalInfo = true;
}
} }
}) });
}, },
changeOption(data) {}, changeOption(data) {},
selectDepart() { selectDepart() {
this.showDeptTree = true this.showDeptTree = true;
}, },
editRow(params) { editRow(params) {
this.title = '生产过程技术协调单' this.title = "生产过程技术协调单";
this.submitShow = true this.submitShow = true;
this.flag = 1 this.flag = 1;
var url2 = `${designUrl}/technicalcoordination/getforedit` var url2 = `${designUrl}/technicalcoordination/getforedit`;
service service
.get(`${url2}`, { params: { Id: params.row.id } }) .get(`${url2}`, { params: { Id: params.row.id } })
.then((response) => { .then(response => {
this.formdata = response.data.result.technicalCoordination this.formdata = response.data.result.technicalCoordination;
}) });
this.show = true this.show = true;
}, },
editRow1(params) { editRow1(params) {
this.$refs.coordinate.formdata=[]; this.$refs.coordinate.formdata = [];
this.$refs.coordinate.formcontextdata=[]; this.$refs.coordinate.formcontextdata = [];
this.$refs.coordinate.formcontextclosedata=[]; this.$refs.coordinate.formcontextclosedata = [];
this.$refs.coordinate.auditedTime=''; this.$refs.coordinate.auditedTime = "";
this.$refs.coordinate.hqauditedTime=''; this.$refs.coordinate.hqauditedTime = "";
this.$refs.coordinate.name=''; this.$refs.coordinate.name = "";
this.$refs.coordinate.name1=''; this.$refs.coordinate.name1 = "";
this.flag=1; this.flag = 1;
var url2 = `${designUrl}/technicalcoordination/getbyid` var url2 = `${designUrl}/technicalcoordination/getbyid`;
service service
.get(`${url2}`, { params: { Id: params.row.id } }) .get(`${url2}`, { params: { Id: params.row.id } })
.then((response) => { .then(response => {
this.$refs.coordinate.formdata = response.data.result this.$refs.coordinate.formdata = response.data.result;
}) });
var url3 = `${workflowUrl}/instance/getdetailbycode` var url3 = `${workflowUrl}/instance/getdetailbycode`;
service service
.get(`${url3}`, { params: { code: params.row.technical_coordination_code } }) .get(`${url3}`, {
.then((response) => { params: { code: params.row.technical_coordination_code }
console.log(response) })
for (var i = 0; i < response.data.result.nodes.length; i++) { .then(response => {
var id= response.data.result.nodes[i].id console.log(response);
var status= response.data.result.nodes[i].status for (var i = 0; i < response.data.result.nodes.length; i++) {
if(id==163&&status==2) var id = response.data.result.nodes[i].id;
{ var status = response.data.result.nodes[i].status;
var context=response.data.result.nodes[i].contextData if (id == 163 && status == 2) {
this.$refs.coordinate.formcontextdata=JSON.parse(context); var context = response.data.result.nodes[i].contextData;
} this.$refs.coordinate.formcontextdata = JSON.parse(context);
if(id==164&&status==2) }
{ if (id == 164 && status == 2) {
this.$refs.coordinate.hqauditedTime=response.data.result.nodes[i].auditedTime this.$refs.coordinate.hqauditedTime =
var nameid=response.data.result.nodes[i].defaultUsers.immutable[0] response.data.result.nodes[i].auditedTime;
var url5 = `${systemUrl}/user/getuser` var nameid =
service response.data.result.nodes[i].defaultUsers.immutable[0];
.get(`${url5}`, { params: { id: nameid} }) var url5 = `${systemUrl}/user/getuser`;
.then((response) => { service
var name=response.data.result.name .get(`${url5}`, { params: { id: nameid } })
console.log(name) .then(response => {
this.$refs.coordinate.name1=name var name = response.data.result.name;
}) console.log(name);
// console.log(this.$refs.coordinate.hqauditedTime) this.$refs.coordinate.name1 = name;
} });
if(id==165&&status==2) // console.log(this.$refs.coordinate.hqauditedTime)
{ }
var context=response.data.result.nodes[i].contextData if (id == 165 && status == 2) {
var nameid=response.data.result.nodes[i].defaultUsers.immutable[0] var context = response.data.result.nodes[i].contextData;
this.$refs.coordinate.formcontextclosedata=JSON.parse(context); var nameid =
this.$refs.coordinate.auditedTime=response.data.result.nodes[i].auditedTime response.data.result.nodes[i].defaultUsers.immutable[0];
var url4 = `${systemUrl}/user/getuser` this.$refs.coordinate.formcontextclosedata = JSON.parse(context);
service this.$refs.coordinate.auditedTime =
.get(`${url4}`, { params: { id: nameid} }) response.data.result.nodes[i].auditedTime;
.then((response) => { var url4 = `${systemUrl}/user/getuser`;
var name=response.data.result.name service
console.log(name) .get(`${url4}`, { params: { id: nameid } })
this.$refs.coordinate.name=name .then(response => {
}) var name = response.data.result.name;
} console.log(name);
this.$refs.coordinate.name = name;
});
}
} }
//this.$refs.coordinate.formdata = response.data.result //this.$refs.coordinate.formdata = response.data.result
}) });
this.$refs.coordinate.modelChange1 = true this.$refs.coordinate.modelChange1 = true;
}, }
}, },
mounted() { mounted() {
window.onresize = () => { window.onresize = () => {
///浏览器窗口大小变化 ///浏览器窗口大小变化
return (() => { return (() => {
window.screenHeight = window.innerHeight window.screenHeight = window.innerHeight;
this.tbHeight = window.screenHeight - 175 this.tbHeight = window.screenHeight - 175;
})() })();
} };
} }
} };
</script> </script>
<style scoped> <style lang="less">
/deep/.vertical-center-modal { .vtr {
display: flex; .vertical-center-modal {
align-items: center; display: flex;
justify-content: center; align-items: center;
} justify-content: center;
/deep/ .vertical-center-modal .ivu-modal { }
top: 0; .vertical-center-modal .ivu-modal {
} top: 0;
/deep/.fontcolor { }
color: #249e91; .fontcolor {
margin: 0 6px; color: #249e91;
} margin: 0 6px;
.fr { }
float: right;
}
.ml10 {
margin-left: 10px;
}
.mt10 {
margin-top: 10px;
} }
</style> </style>
<template> <template>
<div class> <div class="unq">
<div class="contentRight"> <div class="contentRight">
<div class="form_title"> <div class="form_title">
<Input v-model="value1" placeholder="请输入不合格审理单编号" clearable style="width: 240px" /> <Input v-model="value1" placeholder="请输入不合格审理单编号" clearable style="width: 240px" />
...@@ -11,15 +11,18 @@ ...@@ -11,15 +11,18 @@
</div> </div>
<div class="content_box mt10"> <div class="content_box mt10">
<Table <Table
ref="table" border ref="table"
:columns="column2" border
:data="data2" highlight-row :columns="column2"
:data="data2"
highlight-row
highlight-current-row highlight-current-row
:height="this.tbHeight" :height="this.tbHeight"
class="tableCommon"> class="tableCommon"
>
<!-- <template slot-scope="{ row,index }" slot="status"> @on-selection-change="selectFunction" <!-- <template slot-scope="{ row,index }" slot="status"> @on-selection-change="selectFunction"
<state code="unProduct.repairstatus" type="text" class="bold" :value="row.status"></state> <state code="unProduct.repairstatus" type="text" class="bold" :value="row.status"></state>
</template> --> </template>-->
</Table> </Table>
<Page <Page
:total="this.total" :total="this.total"
...@@ -38,26 +41,58 @@ ...@@ -38,26 +41,58 @@
<Form :model="formdata" :label-width="150" :rules="ruleValidate" inline> <Form :model="formdata" :label-width="150" :rules="ruleValidate" inline>
<Row> <Row>
<FormItem label="审理单编号"> <FormItem label="审理单编号">
<Input v-model="formdata.unqualified_order_code" placeholder size="large" style="width:240px" readonly></Input> <Input
v-model="formdata.unqualified_order_code"
placeholder
size="large"
style="width:240px"
readonly
></Input>
</FormItem> </FormItem>
<FormItem label="申请部门"> <FormItem label="申请部门">
<Input v-model="formdata.department_name" placeholder size="large" style="width:240px" readonly></Input> <Input
v-model="formdata.department_name"
placeholder
size="large"
style="width:240px"
readonly
></Input>
</FormItem> </FormItem>
</Row> </Row>
<Row> <Row>
<FormItem label="客户名称"> <FormItem label="客户名称">
<Input v-model="formdata.customer_name" placeholder="输入客户名称" size="large" style="width:240px"></Input> <Input
v-model="formdata.customer_name"
placeholder="输入客户名称"
size="large"
style="width:240px"
></Input>
</FormItem> </FormItem>
<FormItem label="外包供方名称"> <FormItem label="外包供方名称">
<Input v-model="formdata.outsourcing_name" placeholder="输入外包供方名称" size="large" style="width:240px"></Input> <Input
v-model="formdata.outsourcing_name"
placeholder="输入外包供方名称"
size="large"
style="width:240px"
></Input>
</FormItem> </FormItem>
</Row> </Row>
<Row> <Row>
<FormItem label="产品名称"> <FormItem label="产品名称">
<Input v-model="formdata.product_name" placeholder="输入产品名称" size="large" style="width:240px"></Input> <Input
v-model="formdata.product_name"
placeholder="输入产品名称"
size="large"
style="width:240px"
></Input>
</FormItem> </FormItem>
<FormItem label="材料牌号"> <FormItem label="材料牌号">
<Input v-model="formdata.material" placeholder="输入材料牌号" size="large" style="width:240px"></Input> <Input
v-model="formdata.material"
placeholder="输入材料牌号"
size="large"
style="width:240px"
></Input>
</FormItem> </FormItem>
</Row> </Row>
<Row> <Row>
...@@ -70,13 +105,25 @@ ...@@ -70,13 +105,25 @@
</Row> </Row>
<Row> <Row>
<FormItem label="问题描述"> <FormItem label="问题描述">
<Input type="textarea" :autosize="{minRows: 1,maxRows: 6}" v-model="formdata.problem_desc" size="large" style="width: 645px"/> <Input
type="textarea"
:autosize="{minRows: 1,maxRows: 6}"
v-model="formdata.problem_desc"
size="large"
style="width: 645px"
/>
<!-- <textarea v-model="formdata.problem_desc" style="width: 600px"></textarea> --> <!-- <textarea v-model="formdata.problem_desc" style="width: 600px"></textarea> -->
</FormItem> </FormItem>
</Row> </Row>
<Row> <Row>
<FormItem label="检验员"> <FormItem label="检验员">
<Input v-model="formdata.inspection_person_name" placeholder size="large" style="width:240px" readonly></Input> <Input
v-model="formdata.inspection_person_name"
placeholder
size="large"
style="width:240px"
readonly
></Input>
</FormItem> </FormItem>
<FormItem label="检验日期"> <FormItem label="检验日期">
<DatePicker <DatePicker
...@@ -89,13 +136,12 @@ ...@@ -89,13 +136,12 @@
></DatePicker> ></DatePicker>
</FormItem> </FormItem>
</Row> </Row>
</Form> </Form>
<div slot="footer"> <div slot="footer">
<Button @click="show=false">取消</Button> <Button @click="show=false">取消</Button>
<Button type="primary" @click="saveOk">保存</Button> <Button type="primary" @click="saveOk">保存</Button>
<Checkbox v-model="checked" class="ml10" label="送审">送审</Checkbox> <Checkbox v-model="checked" class="ml10" label="送审">送审</Checkbox>
<!-- v-show="submitShow" --> <!-- v-show="submitShow" -->
</div> </div>
</Modal> </Modal>
<Department <Department
...@@ -111,22 +157,23 @@ ...@@ -111,22 +157,23 @@
width="800" width="800"
:mask-closable="false" :mask-closable="false"
:scrollable="true" :scrollable="true"
fullscreen > fullscreen
>
<OrderSendReview ref="orderSendReview"></OrderSendReview> <OrderSendReview ref="orderSendReview"></OrderSendReview>
<div slot="footer"> <div slot="footer">
<Button @click="canCelFn">取消</Button> <Button @click="canCelFn">取消</Button>
<Button type="primary" @click="upSave">确定送审</Button> <Button type="primary" @click="upSave">确定送审</Button>
</div> </div>
</Modal> </Modal>
<trialOrder ref="trialOrder"></trialOrder> <trialOrder ref="trialOrder"></trialOrder>
</div> </div>
</template> </template>
<script> <script>
import service from '@/plugins/request' import service from "@/plugins/request";
import Department from '@/components/modalTree/department.vue' import Department from "@/components/modalTree/department.vue";
import Process from '@/components/orderOperator/process' import Process from "@/components/orderOperator/process";
import OrderSendReview from '../components/orderSendReview'//送审页面 import OrderSendReview from "../components/orderSendReview"; //送审页面
import trialOrder from './trialOrder' import trialOrder from "./trialOrder";
export default { export default {
components: { components: {
Department, Department,
...@@ -140,15 +187,15 @@ export default { ...@@ -140,15 +187,15 @@ export default {
total: 0, total: 0,
page: 1, page: 1,
pageSize: 10, pageSize: 10,
unqualified_order_code: '', unqualified_order_code: "",
id: '', id: "",
flag: 0, flag: 0,
data1: [], data1: [],
value1: '', value1: "",
editId: '', editId: "",
up_id: '', up_id: "",
treeData: [], //下拉表格树数据 treeData: [], //下拉表格树数据
title: '新增设备类型', title: "新增设备类型",
show: false, show: false,
// show2: false, // show2: false,
upweb: false, upweb: false,
...@@ -156,7 +203,7 @@ export default { ...@@ -156,7 +203,7 @@ export default {
selectModel02: false, selectModel02: false,
isedit0: false, isedit0: false,
showDeptTree: false, showDeptTree: false,
tbHeight: '', tbHeight: "",
seleId: 0, seleId: 0,
cityList: [], cityList: [],
isShow: true, isShow: true,
...@@ -164,57 +211,59 @@ export default { ...@@ -164,57 +211,59 @@ export default {
checked: true, //送审选择框 checked: true, //送审选择框
modalInfo: false, //校验送审弹框 modalInfo: false, //校验送审弹框
dataListRetrunNew: { dataListRetrunNew: {
schemaId: 'c2e09c9b-02a9-4188-97a6-cdb68d50a64a', //不合格品送审的schemaId schemaId: "c2e09c9b-02a9-4188-97a6-cdb68d50a64a", //不合格品送审的schemaId
idList: [], //不合格品id List idList: [], //不合格品id List
code: '', //不合格品编号List code: "", //不合格品编号List
operatorIdList: [] //操作员id operatorIdList: [] //操作员id
}, //确定保存后返回数据 }, //确定保存后返回数据
footerModel: false, footerModel: false,
formExamine: {}, formExamine: {},
rules: { rules: {
approveUser: [{ required: true, message: '必填', trigger: 'blur' }] approveUser: [{ required: true, message: "必填", trigger: "blur" }]
}, },
seldata: [], //父权限菜单树 seldata: [], //父权限菜单树
parent_name: '', //父权限名 parent_name: "", //父权限名
ruleValidate: { ruleValidate: {
equip_type_id: [ equip_type_id: [
{ {
required: true, required: true,
message: '设备类型编号不能为空!', message: "设备类型编号不能为空!",
trigger: 'blur' trigger: "blur"
} }
] ]
}, },
formdata: { formdata: {
unqualified_order_code: '', unqualified_order_code: "",
customer_name: '', customer_name: "",
outsourcing_name: '', outsourcing_name: "",
product_name: '', product_name: "",
material: '', material: "",
quantity: 0, quantity: 0,
code: '', code: "",
problem_desc: '', problem_desc: "",
inspection_person: 0, inspection_person: 0,
inspection_person_name: '', inspection_person_name: "",
inspection_date: '', inspection_date: "",
department_id: '', //部门ID department_id: "", //部门ID
department_name: '', //部门名称 department_name: "", //部门名称
status: 0, status: 0,
note: '', note: "",
dispatch_id: 0, dispatch_id: 0,
execute_id: 0, execute_id: 0,
order_id: '' order_id: ""
}, },
sysdata: [ sysdata: [
{ {
value: '1', value: "1",
label: '粉末' label: "粉末"
},{ },
value: '2', {
label: '基板' value: "2",
},{ label: "基板"
value: '3', },
label: '刮刀' {
value: "3",
label: "刮刀"
} }
], ],
column2: [ column2: [
...@@ -224,146 +273,157 @@ export default { ...@@ -224,146 +273,157 @@ export default {
// align: 'center', // align: 'center',
// }, // },
{ {
type: 'index', type: "index",
title: '序号', title: "序号",
width: '65', width: "65",
align: 'center' align: "center"
},{ },
title: '不合格审理单编号', {
key: 'unqualified_order_code', title: "不合格审理单编号",
align: 'center', key: "unqualified_order_code",
width: '200' align: "center",
},{ width: "200"
title: '发起人', },
key: 'inspection_person_name', {
align: 'center', title: "发起人",
width: '200' key: "inspection_person_name",
},{ align: "center",
title: '客户名称', width: "200"
key: 'customer_name', },
align: 'center', {
width: '200' title: "客户名称",
},{ key: "customer_name",
title: '外包供方名称', align: "center",
key: 'outsourcing_name', width: "200"
align: 'center', },
width: '200' {
},{ title: "外包供方名称",
title: '产品名称', key: "outsourcing_name",
key: 'product_name', align: "center",
align: 'center', width: "200"
width: '110' },
},{ {
title: '状态', title: "产品名称",
key: 'status', key: "product_name",
align: 'center', align: "center",
width: "110"
},
{
title: "状态",
key: "status",
align: "center",
width: 110, width: 110,
render: (h,params) => { render: (h, params) => {
return h('state', { return h("state", {
props: { props: {
code: 'unProduct.repairstatus', code: "unProduct.repairstatus",
type: 'text', type: "text",
value: params.row.status + '' value: params.row.status + ""
} }
}) });
// let statuse = params.row.status // let statuse = params.row.status
// let text = statuse == 1 ? '待送审' : (statuse==2? '审核中':(statuse==3? '通过':(statuse==4? '驳回':(statuse==5? '终止':'')))) // let text = statuse == 1 ? '待送审' : (statuse==2? '审核中':(statuse==3? '通过':(statuse==4? '驳回':(statuse==5? '终止':''))))
// return h('span',{},text) // return h('span',{},text)
} }
},{ },
title: '材料牌号', {
key: 'material', title: "材料牌号",
align: 'center', key: "material",
width: '110' align: "center",
},{ width: "110"
title: '数量', },
key: 'quantity', {
align: 'center', title: "数量",
width: '110' key: "quantity",
},{ align: "center",
title: '代号', width: "110"
key: 'code', },
align: 'center', {
width: '110' title: "代号",
},{ key: "code",
title: '操作', align: "center",
key: 'id', width: "110"
align: 'center', },
width: '230', {
title: "操作",
key: "id",
align: "center",
width: "230",
render: (h, params) => { render: (h, params) => {
let actions = [] let actions = [];
if (params.row.status == 3) { if (params.row.status == 3) {
actions.push( actions.push(
h( h(
'op', "op",
{ {
attrs: { attrs: {
oprate: 'detail' oprate: "detail"
}, },
on: { on: {
click: () => { click: () => {
// e.stopPropagation() // e.stopPropagation()
this.editRow1(params) this.editRow1(params);
}
} }
} },
}, "预览"
'预览' )
), );
)} }
if (params.row.status == 1 ||params.row.status == 4 ) { if (params.row.status == 1 || params.row.status == 4) {
actions.push( actions.push(
h( h(
'op', "op",
{ {
attrs: { attrs: {
oprate: 'detail' oprate: "detail"
}, },
on: { on: {
click: () => { click: () => {
// e.stopPropagation() // e.stopPropagation()
this.editRow(params) this.editRow(params);
}
} }
} },
}, "编辑"
'编辑' )
)) );
} }
return h('div', { class: 'action' }, actions) return h("div", { class: "action" }, actions);
} }
} }
], ],
data2: [], data2: [],
data3: [], data3: [],
userlist: [] userlist: []
} };
}, },
created() { created() {
this.tbHeight = window.innerHeight - 305 this.tbHeight = window.innerHeight - 305;
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { methods: {
// 分页 // 分页
pageChange(num) { pageChange(num) {
//console.log(num); //console.log(num);
this.page = num this.page = num;
this.loadchangelist() this.loadchangelist();
}, },
pageSizeChange(limit) { pageSizeChange(limit) {
//console.log(limit) //console.log(limit)
this.pageSize = limit this.pageSize = limit;
this.loadchangelist() this.loadchangelist();
}, },
//查询 //查询
searchData() { searchData() {
this.page = 1 this.page = 1;
this.pageSize = 10 this.pageSize = 10;
this.loadchangelist() this.loadchangelist();
}, },
loadchangelist() { loadchangelist() {
let url = `${designUrl}/unqualifiedorder/getpaged`;
let url = `${designUrl}/unqualifiedorder/getpaged`
service service
.get(`${url}`, { .get(`${url}`, {
params: { params: {
...@@ -373,225 +433,223 @@ export default { ...@@ -373,225 +433,223 @@ export default {
pageSize: this.pageSize pageSize: this.pageSize
} }
}) })
.then((res) => { .then(res => {
this.data2 = res.data.result.items this.data2 = res.data.result.items;
this.total = res.data.result.totalCount this.total = res.data.result.totalCount;
}) });
}, },
handleChange1(date) { handleChange1(date) {
this.formdata.inspection_date = date this.formdata.inspection_date = date;
}, },
//新增不合格审理单 //新增不合格审理单
addData() { addData() {
this.title = '不合格审理单' this.title = "不合格审理单";
this.show = true this.show = true;
// this.submitShow = true // this.submitShow = true
this.flag = 0 this.flag = 0;
this.formdata.unqualified_order_code = '' this.formdata.unqualified_order_code = "";
this.formdata.customer_name = '' this.formdata.customer_name = "";
this.formdata.outsourcing_name = '' this.formdata.outsourcing_name = "";
if (this.formdata.dispatch_id == 0) { if (this.formdata.dispatch_id == 0) {
this.formdata.product_name = '' this.formdata.product_name = "";
} }
this.formdata.material = '' this.formdata.material = "";
this.formdata.quantity = 0 this.formdata.quantity = 0;
this.formdata.code = '' this.formdata.code = "";
this.formdata.problem_desc = '' this.formdata.problem_desc = "";
this.formdata.inspection_person = 0 this.formdata.inspection_person = 0;
this.formdata.inspection_person_name = '' this.formdata.inspection_person_name = "";
this.formdata.inspection_date = '' this.formdata.inspection_date = "";
this.formdata.department_id = '' //部门ID this.formdata.department_id = ""; //部门ID
this.formdata.department_name = '' //部门名称departmentTitle this.formdata.department_name = ""; //部门名称departmentTitle
this.formdata.status = 1 this.formdata.status = 1;
this.formdata.note = '' this.formdata.note = "";
var userId = JSON.parse(sessionStorage.getItem('userInfo')).userId var userId = JSON.parse(sessionStorage.getItem("userInfo")).userId;
let parma = { let parma = {
Id: userId Id: userId
} };
this.$http.sysUser.getuserinfo(parma).then((res) => { this.$http.sysUser.getuserinfo(parma).then(res => {
// console.log(res) // console.log(res)
if (res.result) { if (res.result) {
this.formdata.department_name= res.result.departmentTitle; this.formdata.department_name = res.result.departmentTitle;
this.formdata.inspection_person_name= res.result.userName; this.formdata.inspection_person_name = res.result.userName;
} }
}) });
var url1 = `${designUrl}/routingheader/GetCodeByType?code=BHGSLD` var url1 = `${designUrl}/routingheader/GetCodeByType?code=BHGSLD`;
service.get(`${url1}`).then((response) => { service.get(`${url1}`).then(response => {
this.formdata.unqualified_order_code = response.data.result this.formdata.unqualified_order_code = response.data.result;
}) });
}, },
// 添加/编辑 弹框的保存 // 添加/编辑 弹框的保存
saveOk() { saveOk() {
var url = `${designUrl}/unqualifiedorder/createorupdate` var url = `${designUrl}/unqualifiedorder/createorupdate`;
service.post(`${url}`, JSON.stringify({ unqualifiedOrder: this.formdata })) service
.then((res) => { .post(`${url}`, JSON.stringify({ unqualifiedOrder: this.formdata }))
console.log(res) .then(res => {
console.log(res);
if (res.data.success) { if (res.data.success) {
let itemId = res.data.result.id let itemId = res.data.result.id;
this.dataListRetrunNew.idList.push(itemId); this.dataListRetrunNew.idList.push(itemId);
this.loadchangelist() this.loadchangelist();
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.show = false this.show = false;
} }
}) });
// 如果选择送审,则打开送审页面 // 如果选择送审,则打开送审页面
if (this.checked == true) { if (this.checked == true) {
this.$refs.orderSendReview.intData(this.formdata) this.$refs.orderSendReview.intData(this.formdata);
this.show = false this.show = false;
this.modalInfo = true this.modalInfo = true;
// return //暂时先屏蔽保存 // return //暂时先屏蔽保存
} }
}, },
upSave() { upSave() {
let operatorIdList = this.$refs.orderSendReview.returnDataList() let operatorIdList = this.$refs.orderSendReview.returnDataList();
let itemCode = this.formdata.unqualified_order_code let itemCode = this.formdata.unqualified_order_code;
this.dataListRetrunNew.code = itemCode this.dataListRetrunNew.code = itemCode;
this.dataListRetrunNew.operatorIdList = operatorIdList this.dataListRetrunNew.operatorIdList = operatorIdList;
this.$http.order.batchOrderStart(this.dataListRetrunNew) this.$http.order
.batchOrderStart(this.dataListRetrunNew)
.then(response => { .then(response => {
if(response.success){ if (response.success) {
this.loadchangelist() this.loadchangelist();
this.$Message.info("送审成功!") this.$Message.info("送审成功!");
this.dataListRetrunNew.idList = [] this.dataListRetrunNew.idList = [];
} else { } else {
this.$Message.error('送审失败!') this.$Message.error("送审失败!");
} }
this.modalInfo = false this.modalInfo = false;
}) });
}, },
//多选处理--表格选择项变化方法 //多选处理--表格选择项变化方法
canCelFn(){ canCelFn() {
modalInfo = false modalInfo = false;
this.dataListRetrunNew.idList = [] this.dataListRetrunNew.idList = [];
}, },
changeOption(data) { changeOption(data) {
console.log(data) console.log(data);
}, },
selectDepart() { selectDepart() {
this.showDeptTree = true this.showDeptTree = true;
}, },
editRow(params) { editRow(params) {
// this.submitShow = false // this.submitShow = false
this.title = '不合格审理单' this.title = "不合格审理单";
this.flag = 1 this.flag = 1;
var url2 = `${designUrl}/unqualifiedorder/getbyid` var url2 = `${designUrl}/unqualifiedorder/getbyid`;
service service
.get(`${url2}`, { params: { Id: params.row.id } }) .get(`${url2}`, { params: { Id: params.row.id } })
.then((response) => { .then(response => {
this.formdata = response.data.result this.formdata = response.data.result;
}) });
this.show = true this.show = true;
}, },
editRow1(params) { editRow1(params) {
this.$refs.trialOrder.formdata=[]; this.$refs.trialOrder.formdata = [];
this.$refs.trialOrder.formcontextdata=[]; this.$refs.trialOrder.formcontextdata = [];
this.$refs.trialOrder.formcontextclosedata=[]; this.$refs.trialOrder.formcontextclosedata = [];
this.$refs.trialOrder.gyauditedTime=''; this.$refs.trialOrder.gyauditedTime = "";
this.$refs.trialOrder.jyauditedTime=''; this.$refs.trialOrder.jyauditedTime = "";
this.$refs.trialOrder.hqauditedTime=''; this.$refs.trialOrder.hqauditedTime = "";
this.$refs.trialOrder.name1=''; this.$refs.trialOrder.name1 = "";
this.$refs.trialOrder.name2=''; this.$refs.trialOrder.name2 = "";
this.$refs.trialOrder.name3=''; this.$refs.trialOrder.name3 = "";
this.flag=1; this.flag = 1;
var url2 = `${designUrl}/unqualifiedorder/getbyid` var url2 = `${designUrl}/unqualifiedorder/getbyid`;
service service
.get(`${url2}`, { params: { Id: params.row.id } }) .get(`${url2}`, { params: { Id: params.row.id } })
.then((response) => { .then(response => {
this.$refs.trialOrder.formdata = response.data.result this.$refs.trialOrder.formdata = response.data.result;
}) });
var url3 = `${workflowUrl}/instance/getdetailbycode` var url3 = `${workflowUrl}/instance/getdetailbycode`;
service service
.get(`${url3}`, { params: { code: params.row.unqualified_order_code } }) .get(`${url3}`, { params: { code: params.row.unqualified_order_code } })
.then((response) => { .then(response => {
console.log(response) console.log(response);
for (var i = 0; i < response.data.result.nodes.length; i++) { for (var i = 0; i < response.data.result.nodes.length; i++) {
var id= response.data.result.nodes[i].id var id = response.data.result.nodes[i].id;
var status= response.data.result.nodes[i].status var status = response.data.result.nodes[i].status;
if(id==157&&status==2) if (id == 157 && status == 2) {
{ var context = response.data.result.nodes[i].contextData;
var context=response.data.result.nodes[i].contextData this.$refs.trialOrder.formcontextdata = JSON.parse(context);
this.$refs.trialOrder.formcontextdata=JSON.parse(context); this.$refs.trialOrder.gyauditedTime =
this.$refs.trialOrder.gyauditedTime=response.data.result.nodes[i].auditedTime response.data.result.nodes[i].auditedTime;
var nameid=response.data.result.nodes[i].defaultUsers.immutable[0] var nameid =
console.log(nameid) response.data.result.nodes[i].defaultUsers.immutable[0];
var url5 = `${systemUrl}/user/getuser` console.log(nameid);
service var url5 = `${systemUrl}/user/getuser`;
.get(`${url5}`, { params: { id: nameid} }) service
.then((response) => { .get(`${url5}`, { params: { id: nameid } })
var name=response.data.result.name .then(response => {
console.log(nameid) var name = response.data.result.name;
this.$refs.trialOrder.name3=name console.log(nameid);
}) this.$refs.trialOrder.name3 = name;
} });
if(id==158&&status==2) }
{ if (id == 158 && status == 2) {
this.$refs.trialOrder.hqauditedTime=response.data.result.nodes[i].auditedTime this.$refs.trialOrder.hqauditedTime =
var nameid=response.data.result.nodes[i].defaultUsers.immutable[0] response.data.result.nodes[i].auditedTime;
var url5 = `${systemUrl}/user/getuser` var nameid =
service response.data.result.nodes[i].defaultUsers.immutable[0];
.get(`${url5}`, { params: { id: nameid} }) var url5 = `${systemUrl}/user/getuser`;
.then((response) => { service
var name=response.data.result.name .get(`${url5}`, { params: { id: nameid } })
//console.log(name) .then(response => {
this.$refs.trialOrder.name2=name var name = response.data.result.name;
}) //console.log(name)
} this.$refs.trialOrder.name2 = name;
if(id==159&&status==2) });
{ }
var context=response.data.result.nodes[i].contextData if (id == 159 && status == 2) {
this.$refs.trialOrder.formcontextclosedata=JSON.parse(context); var context = response.data.result.nodes[i].contextData;
this.$refs.trialOrder.jyauditedTime=response.data.result.nodes[i].auditedTime this.$refs.trialOrder.formcontextclosedata = JSON.parse(context);
var nameid=response.data.result.nodes[i].defaultUsers.immutable[0] this.$refs.trialOrder.jyauditedTime =
var url5 = `${systemUrl}/user/getuser` response.data.result.nodes[i].auditedTime;
service var nameid =
.get(`${url5}`, { params: { id: nameid} }) response.data.result.nodes[i].defaultUsers.immutable[0];
.then((response) => { var url5 = `${systemUrl}/user/getuser`;
var name=response.data.result.name service
//console.log(name) .get(`${url5}`, { params: { id: nameid } })
this.$refs.trialOrder.name1=name .then(response => {
}) var name = response.data.result.name;
} //console.log(name)
this.$refs.trialOrder.name1 = name;
});
}
} }
//this.$refs.trialOrder.formdata = response.data.result //this.$refs.trialOrder.formdata = response.data.result
}) });
this.$refs.trialOrder.modelChange1 = true this.$refs.trialOrder.modelChange1 = true;
}, }
}, },
mounted() { mounted() {
window.onresize = () => { window.onresize = () => {
///浏览器窗口大小变化 ///浏览器窗口大小变化
return (() => { return (() => {
window.screenHeight = window.innerHeight window.screenHeight = window.innerHeight;
this.tbHeight = window.screenHeight - 175 this.tbHeight = window.screenHeight - 175;
})() })();
} };
} }
} };
</script> </script>
<style scoped> <style lang="less">
/deep/.vertical-center-modal { .unq {
display: flex; .vertical-center-modal {
align-items: center; display: flex;
justify-content: center; align-items: center;
} justify-content: center;
/deep/ .vertical-center-modal .ivu-modal { }
top: 0; .vertical-center-modal .ivu-modal {
} top: 0;
/deep/.fontcolor { }
color: #249e91; .fontcolor {
margin: 0 6px; color: #249e91;
} margin: 0 6px;
.fr { }
float: right;
}
.ml10 {
margin-left: 10px;
}
.mt10 {
margin-top: 10px;
} }
</style> </style>
<template> <template>
<div class=""> <div class="ctb">
<div class="contentRight"> <div class="contentRight">
<div class="form_title"> <div class="form_title">
<Input v-model="value1" placeholder="请输入设备类型名称" clearable style="width: 240px" /> <Input v-model="value1" placeholder="请输入设备类型名称" clearable style="width: 240px" />
<Button type="primary" class="" @click="searchData">查询</Button> <Button type="primary" class @click="searchData">查询</Button>
<div class="paddingbtn fr"> <div class="paddingbtn fr">
<Button type="primary" @click="addData">新增设备类型</Button> <Button type="primary" @click="addData">新增设备类型</Button>
</div> </div>
</div> </div>
<div class="content_box mt10"> <div class="content_box mt10">
<Table <Table
ref="table" ref="table"
:columns="columns" :columns="columns"
:data="data1" :data="data1"
...@@ -18,316 +18,324 @@ ...@@ -18,316 +18,324 @@
border border
class="tableCommon" class="tableCommon"
></Table> ></Table>
</div> </div>
</div>
<!-- 新增和编辑 /api/services/app/storeroomlocation/createorupdate -->
<Modal
v-model="show"
:title="title"
:width="500"
:mask-closable="false"
ok-text="保存" @on-ok="saveOk"
cancel-text="取消" >
<Form :model="formItem" :label-width="150" :rules="ruleValidate">
<Row>
<Col span="20">
<FormItem label="设备类型编号" prop='equip_type_id'>
<Input v-model="formItem.equip_type_id" placeholder="输入设备类型编号"></Input>
</FormItem>
</Col>
</Row>
<Row>
<Col span="20">
<FormItem label="设备类型名称">
<Input v-model="formItem.equip_type_name" placeholder="输入设备类型名称"></Input>
</FormItem>
</Col>
</Row>
<Row>
<Col span="20">
<FormItem label="备注">
<Input v-model="formItem.notes" placeholder="输入备注"></Input>
</FormItem>
</Col>
</Row>
</Form>
</Modal>
<Department
:show.sync="showDeptTree"
:value.sync="formItem.depart_Id"
:text.sync="formItem.department"
:isAdd="false"
/>
</div> </div>
<!-- 新增和编辑 /api/services/app/storeroomlocation/createorupdate -->
<Modal
v-model="show"
:title="title"
:width="500"
:mask-closable="false"
ok-text="保存"
@on-ok="saveOk"
cancel-text="取消"
>
<Form :model="formItem" :label-width="150" :rules="ruleValidate">
<Row>
<Col span="20">
<FormItem label="设备类型编号" prop="equip_type_id">
<Input v-model="formItem.equip_type_id" placeholder="输入设备类型编号"></Input>
</FormItem>
</Col>
</Row>
<Row>
<Col span="20">
<FormItem label="设备类型名称">
<Input v-model="formItem.equip_type_name" placeholder="输入设备类型名称"></Input>
</FormItem>
</Col>
</Row>
<Row>
<Col span="20">
<FormItem label="备注">
<Input v-model="formItem.notes" placeholder="输入备注"></Input>
</FormItem>
</Col>
</Row>
</Form>
</Modal>
<Department
:show.sync="showDeptTree"
:value.sync="formItem.depart_Id"
:text.sync="formItem.department"
:isAdd="false"
/>
</div>
</template> </template>
<script> <script>
import treeGrid from './components/treeGrid' import treeGrid from "./components/treeGrid";
import service from '@/plugins/request' import service from "@/plugins/request";
import Department from '@/components/modalTree/department.vue' import Department from "@/components/modalTree/department.vue";
export default { export default {
components: { components: {
treeGrid, Department, treeGrid,
}, Department
data() { },
return { data() {
data1: [], return {
value1:"", data1: [],
editId:'', value1: "",
up_id:'', editId: "",
treeData:[],//下拉表格树数据 up_id: "",
title:"新增设备类型", treeData: [], //下拉表格树数据
show: false, title: "新增设备类型",
// show2: false, show: false,
upweb: false, // show2: false,
selectModel: true, upweb: false,
selectModel02: false, selectModel: true,
isedit0:false, selectModel02: false,
showDeptTree: false, isedit0: false,
tbHeight: '', showDeptTree: false,
seleId: 0, tbHeight: "",
cityList:[], seleId: 0,
isShow:true, cityList: [],
seldata: [],//父权限菜单树 isShow: true,
parent_name: '',//父权限名 seldata: [], //父权限菜单树
ruleValidate: { parent_name: "", //父权限名
equip_type_id: [ ruleValidate: {
{ equip_type_id: [
required: true, {
message: '设备类型编号不能为空!', required: true,
trigger: 'blur' message: "设备类型编号不能为空!",
} trigger: "blur"
] }
}, ]
formItem:{ },
equip_type_id: '',//设备类型编号 formItem: {
equip_type_name:'',//设备类型名称 equip_type_id: "", //设备类型编号
notes: '',//备注 equip_type_name: "", //设备类型名称
}, notes: "" //备注
sysdata: [ },
sysdata: [
{
value: "1",
label: "粉末"
},
{
value: "2",
label: "基板"
},
{
value: "3",
label: "刮刀"
}
],
columns: [
{
title: "设备类型编号",
key: "equip_type_id"
},
{
title: "设备类型名称",
key: "equip_type_name",
align: "left"
},
{
title: "备注",
key: "notes",
align: "left"
},
{
title: "操作",
key: "action",
align: "center",
width: 400,
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{ {
value: '1', attrs: {
label: '粉末' oprate: "detail",
},{ class: "edit"
value: '2', },
label: '基板' on: {
},{ click: () => {
value: '3', this.edit(params);
label: '刮刀' }
} }
], },
columns: [ "编辑"
),
h(
"op",
{ {
title: '设备类型编号', attrs: {
key: 'equip_type_id', oprate: "delete"
},{ },
title: '设备类型名称', style: {
key: 'equip_type_name', color: "red"
align:"left", },
},{ on: {
title: '备注', click: () => {
key: 'notes', this.del(params);
align:"left", }
}, { }
title: '操作', },
key: 'action', "删除"
align: 'center', )
width:400, ]);
render: (h, params) => { }
return h('div',{ class: 'action' }, [
h(
'op',
{
attrs:{
oprate:'detail',
class:'edit'
} ,
on: {
click: () => {
this.edit(params)
}
}
},
'编辑'
),
h(
'op',
{
attrs:{
oprate:'delete'
},
style: {
color: 'red',
},
on: {
click: () => {
this.del(params)
}
}
},
'删除'
)
])
}
},
],
} }
]
};
},
created() {
this.laodaction();
this.tbHeight = window.innerHeight - 175;
},
methods: {
//查询
searchData() {
var name = this.value1;
this.laodaction(name);
}, },
created(){ laodaction(name) {
this.laodaction(); let url = `${systemUrl}/equiptype/getpaged`;
this.tbHeight = window.innerHeight - 175 service.get(`${url}`, { params: { equip_type_name: name } }).then(res => {
// console.log(res)
this.data1 = res.data.result.items;
});
}, },
methods:{
//查询 //新增库位
searchData(){ addData() {
var name = this.value1; this.title = "新增设备类型";
this.laodaction(name) this.show = true;
}, this.upweb = false;
laodaction(name){ this.selectModel = false;
let url = `${systemUrl}/equiptype/getpaged`; this.selectModel02 = true;
service.get(`${url}`, { params:{ equip_type_name:name }}).then(res => { this.editId = "";
// console.log(res) this.formItem = {
this.data1 = res.data.result.items equip_type_id: "", //设备类型编号
}); equip_type_name: "", //设备类型名称
}, notes: "" //备注
};
//新增库位 },
addData(){ // 添加/编辑 弹框的保存
this.title = '新增设备类型'; saveOk() {
this.show = true; if (!this.formItem.equip_type_id) {
this.upweb = false; this.$Message.error("设备类型编号不能为空!");
this.selectModel = false; return;
this.selectModel02 = true; }
this.editId=''; let saveId = this.editId,
this.formItem = { url = `${systemUrl}/equiptype/createorupdate`;
equip_type_id: '',//设备类型编号 if (!saveId) {
equip_type_name:'',//设备类型名称 saveId == "";
notes: '',//备注 }
}; if (this.title == "编辑设备类型") {
}, // if(this.formItem.selectName){
// 添加/编辑 弹框的保存 var ar1 = this.data1.find(val => {
saveOk(){ if (val.id != saveId)
if (!this.formItem.equip_type_id) { return val.equip_type_id == this.formItem.equip_type_id;
this.$Message.error('设备类型编号不能为空!') });
return if (ar1) {
} this.$Message.error("设备类型编号已存在!");
let saveId = this.editId, return;
url = `${systemUrl}/equiptype/createorupdate`; }
if(!saveId){ saveId == "" } let paramsdata = {
if(this.title == '编辑设备类型'){ id: saveId,
// if(this.formItem.selectName){ equip_type_id: this.formItem.equip_type_id,
var ar1 = this.data1.find((val) => { equip_type_name: this.formItem.equip_type_name,
if(val.id!=saveId) notes: this.formItem.notes
return val.equip_type_id == this.formItem.equip_type_id };
}) service
if (ar1) { .post(`${url}`, JSON.stringify({ equipType: paramsdata }))
this.$Message.error('设备类型编号已存在!'); .then(res => {
return if (res.data.success) {
} this.laodaction();
let paramsdata = { this.$Message.success("编辑成功");
"id": saveId,
"equip_type_id": this.formItem.equip_type_id,
"equip_type_name": this.formItem.equip_type_name,
"notes": this.formItem.notes,
};
service.post(`${url}`, JSON.stringify({equipType: paramsdata})).then(res=>{
if(res.data.success) {
this.laodaction();
this.$Message.success('编辑成功')
}
});
// }
} }
if(this.title == '新增设备类型'){ });
// console.log('第一个:' + saveId + '第二个:' + this.formItem.selectName) // }
var ar = this.data1.find((val) => { }
return val.equip_type_id == this.formItem.equip_type_id if (this.title == "新增设备类型") {
}) // console.log('第一个:' + saveId + '第二个:' + this.formItem.selectName)
if (ar) { var ar = this.data1.find(val => {
this.$Message.error('设备类型编号已存在!'); return val.equip_type_id == this.formItem.equip_type_id;
return });
} if (ar) {
let paramsdata = { this.$Message.error("设备类型编号已存在!");
"id": saveId, return;
"equip_type_id": this.formItem.equip_type_id, }
"equip_type_name": this.formItem.equip_type_name, let paramsdata = {
"notes": this.formItem.notes, id: saveId,
}; equip_type_id: this.formItem.equip_type_id,
service.post(`${url}`, JSON.stringify({equipType: paramsdata})).then(res=>{ equip_type_name: this.formItem.equip_type_name,
if(res.data.success) { notes: this.formItem.notes
this.laodaction(); };
this.$Message.success('新增成功') service
} .post(`${url}`, JSON.stringify({ equipType: paramsdata }))
}); .then(res => {
if (res.data.success) {
this.laodaction();
this.$Message.success("新增成功");
} }
else{ return } });
}, } else {
changeOption(data){ return;
console.log(data) }
}, },
selectDepart() { changeOption(data) {
this.showDeptTree = true console.log(data);
},
edit(data){
this.title = '编辑设备类型';
//console.log(data)
this.isedit0 = true;
this.show = true;
this.upweb = true;
this.formItem = {
equip_type_id: data.row.equip_type_id,//设备类型编号
equip_type_name:data.row.equip_type_name,//设备类型名称
notes: data.row.notes,//备注
};
this.editId = data.row.id;
}, },
selectDepart() {
this.showDeptTree = true;
del(data){
this.seleId = data.row.id;
let url = `${systemUrl}/equiptype/delete`,
uId = this.seleId;
service.delete(`${systemUrl}/equiptype/delete?id=${uId}`).then(res=>{
console.log(res)
if(res.data.result==1) {
this.laodaction();
this.$Message.success('删除成功')
}
else{
this.$Message.error('该类型有设备使用,不可删除。')
}
});
},
}, },
mounted() { edit(data) {
window.onresize = () => { this.title = "编辑设备类型";
///浏览器窗口大小变化 //console.log(data)
return (() => { this.isedit0 = true;
window.screenHeight = window.innerHeight this.show = true;
this.tbHeight = window.screenHeight - 175 this.upweb = true;
})() this.formItem = {
equip_type_id: data.row.equip_type_id, //设备类型编号
equip_type_name: data.row.equip_type_name, //设备类型名称
notes: data.row.notes //备注
};
this.editId = data.row.id;
},
del(data) {
this.seleId = data.row.id;
let url = `${systemUrl}/equiptype/delete`,
uId = this.seleId;
service.delete(`${systemUrl}/equiptype/delete?id=${uId}`).then(res => {
console.log(res);
if (res.data.result == 1) {
this.laodaction();
this.$Message.success("删除成功");
} else {
this.$Message.error("该类型有设备使用,不可删除。");
} }
});
} }
} },
mounted() {
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.tbHeight = window.screenHeight - 175;
})();
};
}
};
</script> </script>
<style scoped> <style lang="less">
.ctb {
/deep/.vertical-center-modal{ .vertical-center-modal {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
/deep/ .vertical-center-modal .ivu-modal{ .vertical-center-modal .ivu-modal {
top: 0; top: 0;
} }
/deep/.fontcolor { color:#249e91;margin: 0 6px} .fontcolor {
.fr{ color: #249e91;
float: right; margin: 0 6px;
} }
.ml10{ }
margin-left: 10px;
}
.mt10{
margin-top: 10px;
}
</style> </style>
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