Commit 54aabd35 authored by 佟礼's avatar 佟礼

工单执行

parents b26f1992 3a549d53
...@@ -25,7 +25,15 @@ ...@@ -25,7 +25,15 @@
<Button type="primary" @click="save()" class="title_btn ml10">汇报</Button> <Button type="primary" @click="save()" class="title_btn ml10">汇报</Button>
</div> </div>
<div class="table01"> <div class="table01">
<Table stripe ref="table" border :columns="moviecolumn" :height="taHeight" :data="data1" class="tableCommon"> <Table
stripe
ref="table"
border
:columns="moviecolumn"
:height="taHeight"
:data="data1"
class="tableCommon"
>
<template slot-scope="{ row,index }" slot="hg"> <template slot-scope="{ row,index }" slot="hg">
<template v-if="row.status==0"> <template v-if="row.status==0">
<template v-if="row.productstatus1==0"> <template v-if="row.productstatus1==0">
...@@ -92,10 +100,10 @@ ...@@ -92,10 +100,10 @@
</div> </div>
</template> </template>
<script> <script>
import service from '@/plugins/request' import service from "@/plugins/request";
import QS from 'querystring' import QS from "querystring";
export default { export default {
name: 'productReport', name: "productReport",
components: {}, components: {},
data() { data() {
return { return {
...@@ -105,20 +113,20 @@ export default { ...@@ -105,20 +113,20 @@ export default {
datasearch: { datasearch: {
isMain: 0, isMain: 0,
entryID: 0, entryID: 0,
order_id: '', order_id: "",
product_code: '', product_code: "",
board_code: '', board_code: "",
productstatus: null, productstatus: null,
MaxResultCount: 10, MaxResultCount: 10,
SkipCount: 0 SkipCount: 0
}, },
taHeight:'', taHeight: "",
checked: true, checked: true,
newModel: false, newModel: false,
ids: [], ids: [],
isedit: false, isedit: false,
productobj: 0, productobj: 0,
product_ID: '', product_ID: "",
board_ID: 0, board_ID: 0,
product_List: [], product_List: [],
board_List: [], board_List: [],
...@@ -127,16 +135,16 @@ export default { ...@@ -127,16 +135,16 @@ export default {
record_id: 0, record_id: 0,
dispatch_id: 0, dispatch_id: 0,
execute_id: 0, execute_id: 0,
order_id: '', order_id: "",
qc_card_id: 0, qc_card_id: 0,
fill_in_user_type: 0, fill_in_user_type: 0,
data_type: 3, data_type: 3,
data_content1: '', data_content1: "",
data_content2: '', data_content2: "",
data_content3: '', data_content3: "",
data_content4: '', data_content4: "",
product_code: '', product_code: "",
board_code: '' board_code: ""
}, },
ishgCheckAll: false, ishgCheckAll: false,
isbfCheckAll: false, isbfCheckAll: false,
...@@ -147,390 +155,387 @@ export default { ...@@ -147,390 +155,387 @@ export default {
// { title: '序号', type: 'index', width: '100', align: 'center' }, // { title: '序号', type: 'index', width: '100', align: 'center' },
{ {
title: '产品号', title: "产品号",
width: '90', width: "90",
align: 'center', align: "center",
key: 'product_str' key: "product_str"
}, },
{ {
title: '板号', title: "板号",
width: '90', width: "90",
align: 'center', align: "center",
key: 'board_code' key: "board_code"
}, },
{ {
title: '检验结果', title: "检验结果",
width: '100', width: "100",
align: 'center', align: "center",
key: 'status', key: "status",
render: (h, params) => { render: (h, params) => {
let content = '' let content = "";
if (params.row.status == -1) { if (params.row.status == -1) {
content = '待自检' content = "待自检";
} else if (params.row.status == 2) { } else if (params.row.status == 2) {
content = '待互检' content = "待互检";
} else if (params.row.status == 3 || params.row.status == 4) { } else if (params.row.status == 3 || params.row.status == 4) {
content = '待检验' content = "待检验";
} else { } else {
content = '完成' content = "完成";
} }
return h('div', [ return h("div", [
h( h(
'span', "span",
{ {
props: { props: {
type: 'text', type: "text",
ghost: true ghost: true
} }
}, },
content content
) )
]) ]);
} }
}, },
{ {
title: '汇报结果', title: "汇报结果",
width: '100', width: "100",
align: 'center', align: "center",
key: 'productstatus', key: "productstatus",
render: (h, params) => { render: (h, params) => {
let content = '' let content = "";
if (params.row.productstatus1 == 1) { if (params.row.productstatus1 == 1) {
content = '合格' content = "合格";
} else if (params.row.productstatus1 == 2) { } else if (params.row.productstatus1 == 2) {
content = '报废' content = "报废";
} else if (params.row.productstatus1 == 3) { } else if (params.row.productstatus1 == 3) {
content = '让步' content = "让步";
} else { } else {
content = '待汇报' content = "待汇报";
} }
return h('div', [ return h("div", [
h( h(
'span', "span",
{ {
props: { props: {
type: 'text', type: "text",
ghost: true ghost: true
} }
}, },
content content
) )
]) ]);
} }
}, },
{ {
title: '合格', title: "合格",
key: 'productstatus', key: "productstatus",
width: '95', width: "95",
align: 'center', align: "center",
renderHeader: (h, params) => { renderHeader: (h, params) => {
return h('div', [ return h("div", [
h( h(
'Checkbox', "Checkbox",
{ {
props: { props: {
value: this.ishgCheckAll value: this.ishgCheckAll
}, },
on: { on: {
'on-change': () => { "on-change": () => {
this.handlehgCheckAll() //点击修改下面Checkbox的状态 this.handlehgCheckAll(); //点击修改下面Checkbox的状态
} }
} }
}, },
'合格' "合格"
) )
]) ]);
}, },
slot: 'hg' slot: "hg"
}, },
{ {
title: '报废', title: "报废",
key: 'productstatus', key: "productstatus",
width: '95', width: "95",
align: 'center', align: "center",
renderHeader: (h, params) => { renderHeader: (h, params) => {
return h('div', [ return h("div", [
h( h(
'Checkbox', "Checkbox",
{ {
props: { props: {
value: this.isbfCheckAll value: this.isbfCheckAll
}, },
on: { on: {
'on-change': () => { "on-change": () => {
this.handlebfCheckAll() //点击修改下面Checkbox的状态 this.handlebfCheckAll(); //点击修改下面Checkbox的状态
} }
} }
}, },
'报废' "报废"
) )
]) ]);
}, },
slot: 'bf' slot: "bf"
}, },
{ {
title: '让步', title: "让步",
key: 'productstatus', key: "productstatus",
width: '95', width: "95",
align: 'center', align: "center",
renderHeader: (h, params) => { renderHeader: (h, params) => {
return h('div', [ return h("div", [
h( h(
'Checkbox', "Checkbox",
{ {
props: { props: {
value: this.isrbCheckAll value: this.isrbCheckAll
}, },
on: { on: {
'on-change': () => { "on-change": () => {
this.handlerbCheckAll() //点击修改下面Checkbox的状态 this.handlerbCheckAll(); //点击修改下面Checkbox的状态
} }
} }
}, },
'让步' "让步"
) )
]) ]);
}, },
slot: 'rb' slot: "rb"
}, },
{ {
title: '审理单编号', title: "审理单编号",
key: 'docket_number', key: "docket_number",
slot: 'docket' slot: "docket"
}, },
{ {
title: '问题原因', title: "问题原因",
key: 'cause', key: "cause",
slot: 'cause' slot: "cause"
}, },
{ {
title: '汇报人', title: "汇报人",
key: 'report_user_name', key: "report_user_name",
width: '100', width: "100",
align: 'center' align: "center"
}, },
{ {
title: '汇报时间', title: "汇报时间",
key: 'report_time', key: "report_time",
width: '180', width: "180",
align: 'center', align: "center",
render: (h, params) => { render: (h, params) => {
let content = let content =
params.row.report_time.indexOf('0001') > -1 params.row.report_time.indexOf("0001") > -1
? '' ? ""
: params.row.report_time : params.row.report_time;
return h('div', [ return h("div", [
h( h(
'span', "span",
{ {
props: { props: {
type: 'text', type: "text",
ghost: true ghost: true
} }
}, },
content content
) )
]) ]);
} }
} }
] ]
} };
}, },
created() { created() {
this.taHeight = window.innerHeight - 375 this.taHeight = window.innerHeight - 375;
}, },
mounted() { mounted() {
window.onresize = () => { window.onresize = () => {
///浏览器窗口大小变化 ///浏览器窗口大小变化
return (() => { return (() => {
this.taHeight = window.innerHeight - 375 this.taHeight = window.innerHeight - 375;
})() })();
} };
}, },
methods: { methods: {
loadpage(dispatch_id, order_id, isMain) { loadpage(dispatch_id, order_id, isMain) {
this.datasearch.entryID = dispatch_id this.datasearch.entryID = dispatch_id;
this.datasearch.order_id = order_id this.datasearch.order_id = order_id;
this.datasearch.isMain = isMain this.datasearch.isMain = isMain;
this.loaddata() this.loaddata();
this.loadproduct() this.loadproduct();
}, },
onPageChanged(page_index) { onPageChanged(page_index) {
this.pageindex = page_index this.pageindex = page_index;
this.loaddata() this.loaddata();
}, },
onPagesizeChanged(page_size) { onPagesizeChanged(page_size) {
this.datasearch.MaxResultCount = page_size this.datasearch.MaxResultCount = page_size;
this.loaddata() this.loaddata();
}, },
loaddata() { loaddata() {
this.data1 = [] this.data1 = [];
this.datasearch.SkipCount = this.datasearch.SkipCount =
(this.pageindex - 1) * this.datasearch.MaxResultCount (this.pageindex - 1) * this.datasearch.MaxResultCount;
var url = var url =
`${PlanUrl}/orderexecutequalityrecord/getentryproductlist?` + `${PlanUrl}/orderexecutequalityrecord/getentryproductlist?` +
QS.stringify(this.datasearch) QS.stringify(this.datasearch);
service.get(`${url}`).then((response) => { service.get(`${url}`).then(response => {
if (response.result != null) { if (response.result != null) {
this.data1 = response.result.items this.data1 = response.result.items;
this.datatotal = response.result.totalCount this.datatotal = response.result.totalCount;
} }
}) });
}, },
loadproduct() { loadproduct() {
var url = var url =
`${PlanUrl}/orderexecutequalityrecord/getentryproductcode?entryID=` + `${PlanUrl}/orderexecutequalityrecord/getentryproductcode?entryID=` +
this.datasearch.entryID this.datasearch.entryID;
service.get(`${url}`).then((response) => { service.get(`${url}`).then(response => {
this.product_List = response.result this.product_List = response.result;
this.board_List = response.result this.board_List = response.result;
if (this.datasearch.isMain == 1) { if (this.datasearch.isMain == 1) {
this.product_List = [] this.product_List = [];
for (let i = 0; i < this.board_List.length; i++) { for (let i = 0; i < this.board_List.length; i++) {
let obj = this.board_List[i] let obj = this.board_List[i];
let productids = obj.productids.split(',') let productids = obj.productids.split(",");
let productcodes = obj.productcodes.split(',') let productcodes = obj.productcodes.split(",");
for (let j = 0; j < productids.length; j++) { for (let j = 0; j < productids.length; j++) {
let p = {} let p = {};
p.productids = productids[j] p.productids = productids[j];
p.productcodes = productcodes[j] p.productcodes = productcodes[j];
this.product_List.push(p) this.product_List.push(p);
} }
} }
} }
}) });
}, },
productonchange(e) { productonchange(e) {
this.datasearch.product_code = e this.datasearch.product_code = e;
this.loaddata() this.loaddata();
}, },
boardonchange(e) { boardonchange(e) {
for (let i = 0; i < this.board_List.length; i++) { for (let i = 0; i < this.board_List.length; i++) {
let obj = this.board_List[i] let obj = this.board_List[i];
if (obj.boardNumber == e) { if (obj.boardNumber == e) {
this.product_List = [] this.product_List = [];
let productids = obj.productids.split(',') let productids = obj.productids.split(",");
let productcodes = obj.productcodes.split(',') let productcodes = obj.productcodes.split(",");
for (let j = 0; j < productids.length; j++) { for (let j = 0; j < productids.length; j++) {
let p = {} let p = {};
p.productids = productids[j] p.productids = productids[j];
p.productcodes = productcodes[j] p.productcodes = productcodes[j];
this.product_List.push(p) this.product_List.push(p);
} }
} }
} }
this.datasearch.board_code = e this.datasearch.board_code = e;
this.loaddata() this.loaddata();
}, },
handlehgCheckAll() { handlehgCheckAll() {
this.ishgCheckAll = !this.ishgCheckAll this.ishgCheckAll = !this.ishgCheckAll;
for (let i = 0; i < this.data1.length; i++) { for (let i = 0; i < this.data1.length; i++) {
if (this.data1[i].productstatus1 == 0 && this.data1[i].status == 0) { if (this.data1[i].productstatus1 == 0 && this.data1[i].status == 0) {
this.data1[i].productstatus = this.ishgCheckAll ? 1 : 0 this.data1[i].productstatus = this.ishgCheckAll ? 1 : 0;
} }
} }
}, },
handlebfCheckAll() { handlebfCheckAll() {
this.isbfCheckAll = !this.isbfCheckAll this.isbfCheckAll = !this.isbfCheckAll;
for (let i = 0; i < this.data1.length; i++) { for (let i = 0; i < this.data1.length; i++) {
if (this.data1[i].productstatus1 == 0 && this.data1[i].status == 0) { if (this.data1[i].productstatus1 == 0 && this.data1[i].status == 0) {
this.data1[i].productstatus = this.isbfCheckAll ? 2 : 0 this.data1[i].productstatus = this.isbfCheckAll ? 2 : 0;
} }
} }
}, },
handlerbCheckAll() { handlerbCheckAll() {
this.isrbCheckAll = !this.isrbCheckAll this.isrbCheckAll = !this.isrbCheckAll;
for (let i = 0; i < this.data1.length; i++) { for (let i = 0; i < this.data1.length; i++) {
if (this.data1[i].productstatus1 == 0 && this.data1[i].status == 0) { if (this.data1[i].productstatus1 == 0 && this.data1[i].status == 0) {
this.data1[i].productstatus = this.isrbCheckAll ? 3 : 0 this.data1[i].productstatus = this.isrbCheckAll ? 3 : 0;
} }
} }
}, },
hgcheck(index, e) { hgcheck(index, e) {
this.data1[index].productstatus = e ? 1 : 0 this.data1[index].productstatus = e ? 1 : 0;
}, },
bfcheck(index, e) { bfcheck(index, e) {
this.data1[index].productstatus = e ? 2 : 0 this.data1[index].productstatus = e ? 2 : 0;
}, },
rbcheck(index, e) { rbcheck(index, e) {
this.data1[index].productstatus = e ? 3 : 0 this.data1[index].productstatus = e ? 3 : 0;
}, },
docketinput(index, e) { docketinput(index, e) {
this.data1[index].docket_number = e.target.value this.data1[index].docket_number = e.target.value;
}, },
causeinput(index, e) { causeinput(index, e) {
this.data1[index].cause = e.target.value this.data1[index].cause = e.target.value;
}, },
save() { save() {
// this.$parent.$parent.loadproduct() // this.$parent.$parent.loadproduct()
let datalist = [];
let userInfo = this.$store.state.admin.user.info;
let datalist = []
for (let i = 0; i < this.data1.length; i++) { for (let i = 0; i < this.data1.length; i++) {
let obj = this.data1[i] let obj = this.data1[i];
if (obj.productstatus1 == 0 && obj.productstatus != 0) { if (obj.productstatus1 == 0 && obj.productstatus != 0) {
obj.report_user_name = localStorage.getItem('userName') obj.report_user_name = userInfo.name;
datalist.push(obj) datalist.push(obj);
} }
} }
if (datalist.length == 0) { if (datalist.length == 0) {
this.$Message.success('请进行填报') this.$Message.success("请进行填报");
return return;
} }
console.log(datalist) console.log(datalist);
var url = `${PlanUrl}/orderexecutequalityrecord/saveentryproduct` var url = `${PlanUrl}/orderexecutequalityrecord/saveentryproduct`;
service service
.post( .post(`${url}`, {
`${url}`,
{
dispatch_id: this.datasearch.entryID, dispatch_id: this.datasearch.entryID,
order_id: this.datasearch.order_id, order_id: this.datasearch.order_id,
list: datalist list: datalist
} })
) .then(response => {
.then((response) => {
if (response.success) { if (response.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.loaddata() this.loaddata();
this.$parent.$parent.$parent.loadEntry(this.$parent.$parent.$parent.data.id); this.$parent.$parent.$parent.loadEntry(
this.$parent.$parent.$parent.data.id
);
} }
}) })
.catch((error) => { .catch(error => {
this.$Message.error('保存失败') this.$Message.error("保存失败");
}) });
}, },
updateentrystatus() { updateentrystatus() {
let stat = true let stat = true;
for (let i = 0; i < this.data1.length; i++) { for (let i = 0; i < this.data1.length; i++) {
let obj = this.data1[i] let obj = this.data1[i];
if (obj.productstatus == 0) { if (obj.productstatus == 0) {
stat = false stat = false;
break break;
} }
} }
if (stat) { if (stat) {
this.$parent.$parent.updateentrystatus(this.datasearch.dispatch_id, 0) this.$parent.$parent.updateentrystatus(this.datasearch.dispatch_id, 0);
} }
} }
} }
} };
</script> </script>
\ No newline at end of file
...@@ -227,9 +227,10 @@ export default { ...@@ -227,9 +227,10 @@ export default {
}, },
getCurrentUser(e) { getCurrentUser(e) {
if (e) { if (e) {
let userInfo = this.$store.admin.user.info; let userInfo = this.$store.state.admin.user.info;
this.user.cardno = userInfo.login_id this.user.cardno = userInfo.login_id
this.user.user_name =userInfo.userName this.user.user_name =userInfo.name
this.user.user_id = userInfo.userId this.user.user_id = userInfo.userId
} else { } else {
this.user.cardno = '' this.user.cardno = ''
......
...@@ -238,8 +238,8 @@ export default { ...@@ -238,8 +238,8 @@ export default {
}, },
getCurrentUser(e) { getCurrentUser(e) {
if (e) { if (e) {
let userInfo = this.$store.state.userInfo; let userInfo = this.$store.state.admin.user.info;
console.log(userInfo);
this.user.cardno = userInfo.login_id this.user.cardno = userInfo.login_id
this.user.user_name = userInfo.name this.user.user_name = userInfo.name
this.user.user_id = userInfo.userId this.user.user_id = userInfo.userId
......
...@@ -410,6 +410,7 @@ export default { ...@@ -410,6 +410,7 @@ export default {
file_template: '', file_template: '',
remarks: '', remarks: '',
extend: '', extend: '',
order_comb_id: 0, order_comb_id: 0,
orderids: '', orderids: '',
productingPreparationPeople:'', productingPreparationPeople:'',
......
...@@ -526,7 +526,7 @@ export default { ...@@ -526,7 +526,7 @@ export default {
{ {
title: '主工艺', title: '工艺规程',
key: 'mainRoutingID', key: 'mainRoutingID',
width: 120, width: 120,
render: (h, params) => { render: (h, params) => {
...@@ -610,7 +610,7 @@ export default { ...@@ -610,7 +610,7 @@ export default {
key: 'materialbillID', key: 'materialbillID',
width: 120, width: 120,
render: (h, params) => { render: (h, params) => {
if (this.tabstatus == '1') { if (params.row.mainRoutingID== 0) {
h('div', '') h('div', '')
} else { } else {
let id = params.row.id let id = params.row.id
...@@ -1615,6 +1615,8 @@ export default { ...@@ -1615,6 +1615,8 @@ export default {
this.modalliao = true this.modalliao = true
let ld = this.$refs.orderMaterial let ld = this.$refs.orderMaterial
params.row.mainRoutingID
if ( if (
params.row.materialbillStatus == 1 || params.row.materialbillStatus == 1 ||
params.row.materialbillStatus == 2 || params.row.materialbillStatus == 2 ||
......
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