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

工单执行

parent 44161d59
......@@ -43,7 +43,6 @@ export default {
},
methods: {
change(event) {
this.$emit("on-change", event);
this.codeIds = [];
for (let index = 0; index < event.length; index++) {
this.data.forEach(e => {
......@@ -52,6 +51,7 @@ export default {
}
});
}
this.$emit("on-change", event);
},
getCodes(e) {
let url = `${PlanUrl}/orderproductcode/getbyorderid`;
......
......@@ -7,4 +7,9 @@ export default {
getCardList(params) {
return Api.post(`${PlanUrl}/orderexecutenew/list`, params);
},
//过程质量填报表
getentryqcrecordlist_new(params) {
return Api.get(`${PlanUrl}orderexecutequalityrecord/getentryqcrecordlist_new`, params);
},
}
......@@ -76,7 +76,7 @@ export default {
},
methods: {
gnFunto(number, type) {
alert("a"+this.orderId)
// alert("a"+this.orderId)
this.gnFlag = number;
this.$emit("changeTitle", number, type, this.orderId);
}
......
<template>
<div class="new_box">
<div >
<Button v-if="isedit" style=" margin-left:10px" type="primary" @click="handleAdd">添加</Button>
<Table class="tableCommon" stripe ref="table" border :columns="moviecolumn" :data="moviedata">
<template slot-scope="{ row, index }" slot="data_content1">
<Input type="text" v-model="data_content1" v-if="editIndex === index" />
<span v-else>{{ row.data_content1 }}</span>
</template>
<template slot-scope="{ row, index }" slot="data_content2">
<Input type="text" v-model="data_content2" v-if="editIndex === index" />
<span v-else>{{ row.data_content2 }}</span>
</template>
<template slot-scope="{ row, index }" slot="data_content3">
<Input type="text" v-model="data_content3" v-if="editIndex === index" />
<span v-else>{{ row.data_content3 }}</span>
</template>
<template slot-scope="{ row, index }" slot="action">
<div v-if="editIndex === index">
<Button @click="handleSave(index)">保存</Button>
<Button @click="handlecancel(row, index)">取消</Button>
</div>
<div v-else>
<template v-if="isedit">
<Button class="pl10" @click="handleEdit(row, index)">编辑</Button>
<Button @click="handledel(row, index)">删除</Button>
</template>
</div>
</template>
</Table>
</div>
</div>
</template>
<script>
import service from '@/plugins/request'
import QS from 'querystring'
export default {
name: 'entryrecorddata',
components: {},
data() {
return {
datasearch: {
ids: 0,
MaxResultCount: 10,
SkipCount: 0
},
isedit: true,
editIndex: -1,
isadd: false,
newModel: false,
ids: [],
data_content1: '',
data_content2: '',
data_content3: '',
datafrom: {
id: 0,
record_id: 0,
dispatch_id: 0,
execute_id: 0,
order_id: '',
qc_card_id: 0,
fill_in_user_type: 0,
data_type: 4,
data_content1: '',
data_content2: '',
data_content3: '',
data_content4: '',
product_code: '',
board_code: ''
},
moviedata: [],
moviecolumn: [
// { title: '', key: 'organizType1', type: 'expand',width:'60'},
{ title: '序号', type: 'index', width: '100', align: 'center' },
{
title: '名称',
slot: 'data_content1',
key: 'data_content1'
},
{
title: '值',
slot: 'data_content2',
key: 'data_content2'
},
{
title: '备注',
slot: 'data_content3',
key: 'data_content3'
},
{
title: '操作',
slot: 'action',
align: 'center',
width: '201'
}
]
}
},
mounted() {},
watch: {},
methods: {
loadpage(params, fill_in_user_type, product_code, board_code, isedit) {
this.isedit = isedit;
(this.datafrom.dispatch_id = params.dispatch_id),
(this.datafrom.execute_id = params.execute_id),
(this.datafrom.order_id = params.order_id),
(this.datafrom.qc_card_id = params.qc_card_id),
(this.datafrom.fill_in_user_type = fill_in_user_type),
(this.datafrom.data_type = 4)
this.ids = []
if (
fill_in_user_type == 1 &&
params.selfchecklist != null &&
params.selfchecklist.fill_in_content != null &&
params.selfchecklist.fill_in_content != ''
) {
this.ids = params.selfchecklist.fill_in_content.split(',')
this.datafrom.record_id =
params.selfchecklist.record_id == null
? 0
: params.selfchecklist.record_id
} else if (
fill_in_user_type == 2 &&
params.mutualchecklist != null &&
params.mutualchecklist.fill_in_content != null &&
params.mutualchecklist.fill_in_content != ''
) {
this.ids = params.mutualchecklist.fill_in_content.split(',')
this.datafrom.record_id =
params.mutualchecklist.record_id == null
? 0
: params.mutualchecklist.record_id
} else if (
fill_in_user_type == 3 &&
params.seizurechecklist != null &&
params.seizurechecklist.fill_in_content != null &&
params.seizurechecklist.fill_in_content != ''
) {
this.ids = params.seizurechecklist.fill_in_content.split(',')
this.datafrom.record_id =
params.seizurechecklist.record_id == null
? 0
: params.seizurechecklist.record_id
}
this.datafrom.product_code = product_code
this.datafrom.board_code = board_code
this.loaddata()
},
loaddata() {
this.moviedata = []
this.datasearch.ids = this.ids.join(',')
var url =
`${PlanUrl}/orderexecutequalitydata/getlist?` +
QS.stringify(this.datasearch)
service.get(`${url}`).then((response) => {
if (response.result != null) {
this.moviedata = response.result
}
})
},
handlecancel(row, index) {
this.editIndex = -1
this.isadd = false
if (row.isnewadd) {
this.data01.splice(index, 1)
}
},
handleAdd() {
if (this.isadd == false) {
let row = {
id: 0,
record_id: 0,
dispatch_id: 0,
execute_id: 0,
order_id: '',
qc_card_id: 0,
fill_in_user_type: 0,
data_type: 0,
data_content1: '',
data_content2: '',
data_content3: '',
data_content4: '',
product_code: '',
board_code: '',
isnewadd: true
}
;(this.data_content1 = ''),
(this.data_content2 = ''),
(this.data_content3 = ''),
(this.isadd = true)
this.moviedata.push(row)
this.editIndex = this.moviedata.length - 1
} else {
let lastindex = this.moviedata.length - 1
this.data_content1 = this.moviedata[lastindex].data_content1
this.data_content2 = this.moviedata[lastindex].data_content2
this.data_content3 = this.moviedata[lastindex].data_content3
this.editIndex = lastindex
}
},
handleEdit(row, index) {
this.data_content1 = row.data_content1
this.data_content2 = row.data_content2
this.data_content3 = row.data_content3
this.editIndex = index
},
handleSave(index) {
this.datafrom.data_content1 = this.data_content1
this.datafrom.data_content2 = this.data_content2
this.datafrom.data_content3 = this.data_content3
this.datafrom.id = this.moviedata[index].id
this.ok(index)
if (this.editIndex == this.moviedata.length - 1) {
this.isadd = false
this.moviedata[index].isnewadd = false
}
this.editIndex = -1
},
ok(index) {
var url = `${PlanUrl}/orderexecutequalitydata/createorupdate`
service
.post(
`${url}`,
{
OrderExecuteQualityData: this.datafrom
}
)
.then((response) => {
if (response.success) {
this.$Message.success('保存成功')
this.ids.push(response.result.id)
this.moviedata.splice(index, 1)
this.moviedata.push(response.result)
this.cleardata()
this.$emit(
'binddataid',
this.datafrom.qc_card_id,
this.datafrom.fill_in_user_type,
this.ids.join(','),
true
)
//this.loaddata()
}
})
.catch((error) => {
this.$Message.error('保存失败')
})
},
cancel() {
this.cleardata()
},
cleardata() {
this.datafrom.id = 0
this.datafrom.data_content1 = ''
this.datafrom.data_content2 = ''
this.datafrom.data_content3 = ''
},
handledel(row, index) {
let id = row.id
if (id == 0) {
this.moviedata.splice(index, 1)
} else {
this.$Modal.confirm({
title: '提示',
content: '确定要删除当前行?',
onOk: () => {
var url =
`${PlanUrl}/orderexecutequalitydata/delete?id=` +
row.id +
'&record_id=' +
row.record_id
service
.delete(`${url}`)
.then((response) => {
if (response.success) {
this.$Message.success('删除成功')
this.ids.splice(index, 1)
this.moviedata.splice(index, 1)
// this.loaddata()
this.$emit(
'binddataid',
this.datafrom.qc_card_id,
this.datafrom.fill_in_user_type,
this.ids.join(',')
)
} else {
this.$Message.error('删除失败')
}
})
.catch((error) => {
this.$Message.error('删除失败')
})
},
onCancel: () => {}
})
}
}
}
}
</script>
\ No newline at end of file
This diff is collapsed.
......@@ -29,9 +29,9 @@
>
<Option
v-for="item in product_List"
:value="item.productids"
:value="item.value"
:key="item.index"
>{{ item.productcodes }}</Option>
>{{ item.label }}</Option>
</Select>
</Col>
</Row>
......@@ -49,58 +49,56 @@
</Form>
</template>
<script>
import service from '@/plugins/request'
import service from "@/plugins/request";
export default {
name: 'usercard',
name: "usercard",
components: {},
data() {
const validateCarNo = (rule, value, callback) => {
if (!value) {
return callback(new Error('员工编号不能为空'))
return callback(new Error("员工编号不能为空"));
}
var params = {
conditions: [
{
fieldName: 'cardNo',
fieldName: "cardNo",
fieldValue: value,
conditionalType: 'Equal'
conditionalType: "Equal"
}
],
pageSize: 3
}
};
service
.post(`${systemUrl}/user/list`, params)
.then((response) => {
service.post(`${systemUrl}/user/list`, params).then(response => {
if (response.result.length > 0) {
this.user.user_name = response.result[0].userName
this.user.user_id = response.result[0].id
callback()
this.user.user_name = response.result[0].userName;
this.user.user_id = response.result[0].id;
callback();
} else {
this.user.cardno = ''
return callback(new Error('员工编号不存在'))
}
})
this.user.cardno = "";
return callback(new Error("员工编号不存在"));
}
});
};
return {
disabled: false,
productdisabled: false,
isCurrentUser: false,
isall: false,
width1: '400',
width1: "400",
user: {
dispatch_id: 0,
execute_id: 0,
order_id: '',
order_id: "",
routingHeaderId: 0,
routingDetailId: 0,
product_code: [],
board_code: [],
cardno: '',
user_id: '',
user_name: '',
remarks: '',
cardno: "",
user_id: "",
user_name: "",
remarks: "",
fill_in_user_type: 0,
reportdate: null,
isreplace: 0
......@@ -114,124 +112,124 @@ export default {
board_List: [],
rules: {
cardno: [
{ required: true, message: '必填', trigger: 'blur' },
{ validator: validateCarNo, trigger: 'blur' }
{ required: true, message: "必填", trigger: "blur" },
{ validator: validateCarNo, trigger: "blur" }
]
}
}
};
},
mounted() {},
watch: {},
methods: {
handleSubmit() {
let state = true
let state = true;
if (this.product_ID.length == 0) {
state = false
this.$Message.error('请选择要送检的产品')
return
state = false;
this.$Message.error("请选择要送检的产品");
return;
}
this.user.product_code = this.product_ID.join(',')
this.user.board_code = this.board_ID.join(',')
this.user.product_code = this.product_ID.join(",");
this.user.board_code = this.board_ID.join(",");
if (state) {
this.$refs.form.validate((v) => {
this.$refs.form.validate(v => {
if (v) {
var url = `${PlanUrl}/orderexecutequalityrecord/qccardchecker`
var url = `${PlanUrl}/orderexecutequalityrecord/qccardchecker`;
service
.post(
`${url}`,
{
.post(`${url}`, {
user: this.user,
card: this.recordList
}
)
.then((response) => {
})
.then(response => {
if (response.success) {
this.$Message.success('保存成功')
this.$parent.$parent.loadproduct()
this.$parent.$parent.usercardModal = false
this.$Message.success("保存成功");
this.$parent.$parent.loadproduct();
this.$parent.$parent.usercardModal = false;
}
})
.catch((error) => {
this.$Message.error('保存失败')
})
.catch(error => {
this.$Message.error("保存失败");
});
}
})
});
}
},
handleClose() {},
loadentry(entryModel, fillModel, recordList) {
this.user.dispatch_id = entryModel.id
this.user.execute_id = entryModel.executeId
this.user.order_id = entryModel.order_id
this.user.routingHeaderId = entryModel.routingHeaderId
this.user.routingDetailId = entryModel.routingDetailId
this.user.fill_in_user_type = fillModel.fill_in_user_type
this.user.cardno = ''
this.user.user_id = ''
this.user.user_name = ''
this.product_code = ''
this.board_code = ''
this.isCurrentUser = false
this.isMain = entryModel.isMain
this.product_ID = []
this.board_ID = []
this.productisabled = fillModel.productisabled
alert(9)
this.user.dispatch_id = entryModel.id;
this.user.execute_id = entryModel.executeId;
this.user.order_id = entryModel.order_id;
this.user.routingHeaderId = entryModel.routingHeaderId;
this.user.routingDetailId = entryModel.routingDetailId;
this.user.fill_in_user_type = fillModel.fill_in_user_type;
this.user.cardno = "";
this.user.user_id = "";
this.user.user_name = "";
this.product_code = "";
this.board_code = "";
this.isCurrentUser = false;
this.isMain = entryModel.isMain;
this.product_ID = [];
this.board_ID = [];
this.productisabled = fillModel.productisabled;
this.product_List = fillModel.product_List;
console.log( this.product_List)
if (this.isMain == 1) {
this.productdisabled = false
this.productdisabled = false;
} else {
this.productdisabled = true
this.productdisabled = true;
}
this.product_ID.push(fillModel.product_ID)
this.product_ID.push(fillModel.product_ID);
this.board_ID.push(fillModel.board_ID)
this.board_ID.push(fillModel.board_ID);
if (
fillModel.fill_in_user_type == 1 ||
fillModel.fill_in_user_type == 3
) {
this.product_List = fillModel.product_List
this.board_List = fillModel.board_List
this.board_List = fillModel.board_List;
} else {
this.board_List = []
this.product_List = []
this.board_List = [];
this.product_List = [];
for (let i = 0; i < fillModel.product_List.length; i++) {
let obj = fillModel.product_List[i]
let obj = fillModel.product_List[i];
if (obj.productstatus == 2 || obj.productstatus == 4) {
this.board_List.push(obj)
this.product_List.push(obj)
this.board_List.push(obj);
this.product_List.push(obj);
}
}
}
this.recordList = recordList
this.recordList = recordList;
},
peoductAllOnchange(e) {
if (e) {
if (!this.isMain) {
for (let i = 0; i < this.board_List.length; i++) {
let obj = this.board_List[i]
this.board_ID.push(obj.boardNumber)
let obj = this.board_List[i];
this.board_ID.push(obj.boardNumber);
}
}
for (let i = 0; i < this.product_List.length; i++) {
let obj = this.product_List[i]
this.product_ID.push(obj.productids)
let obj = this.product_List[i];
this.product_ID.push(obj.productids);
}
} else {
this.product_ID = []
this.board_ID = []
this.product_ID = [];
this.board_ID = [];
}
},
productonchange(e) {},
productonchange(e) {
},
boardonchange(e) {
this.product_ID = []
this.product_ID = [];
for (let i = 0; i < this.board_List.length; i++) {
let obj = this.board_List[i]
let obj = this.board_List[i];
for (let j = 0; j < e.length; j++) {
if (obj.boardNumber == e[j]) {
this.product_ID.push(obj.productids)
this.product_ID.push(obj.productids);
}
}
}
......@@ -241,13 +239,13 @@ export default {
console.log(this.$store.state.admin.user.info);
let userInfo = this.$store.state.admin.user.info;
this.user.cardno = userInfo.cardNo
this.user.user_name = userInfo.name
this.user.user_id = userInfo.id
this.user.cardno = userInfo.cardNo;
this.user.user_name = userInfo.name;
this.user.user_id = userInfo.id;
} else {
this.user.cardno = ''
this.user.cardno = "";
}
}
}
}
};
</script>
\ No newline at end of file
......@@ -7,7 +7,7 @@
<span class="fl">{{orderTitle}}</span>
<div>工单编号: 12001011</div>
</div>
<component :is="detail" :gdid="gdId" :orderId="orderId"/>
<component :is="detail" :gdid="gdId" :row="row"/>
<a class="gd_list" @click="orderlistMode = true">工单列表</a>
<a class="gn_area" @click="functionalMode = true">功能区</a>
<!-- 工单列表 -->
......@@ -81,6 +81,7 @@ export default {
detail: null,
odermodel: -9,
orderId: null,
row:{},
oderList: [
{
value: -9,
......@@ -121,7 +122,8 @@ export default {
};
},
created() {
this.orderId = this.$route.query.orderId;
// this.orderId = this.$route.query.orderId;
this.row = this.$route.query.row;
this.detail = () => import("./starOrder/index");
},
......
......@@ -29,7 +29,7 @@
<Button :icon="iconInfo" shape="circle" :title="titleInfo" @click="changeShwo"></Button>
</template>
<template slot="card" slot-scope="{row}">
<div class="body" @click="toExecute(row.id,row.orderId)">
<div class="body" @click="toExecute(row.id,row.orderId,row)">
<Row class="title-i">
<Col :span="10" class="order-code">{{row.productName}}</Col>
<Col :span="10" class="order-code">{{row.mesCode}}</Col>
......@@ -176,7 +176,7 @@ export default {
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.toExecute(params.row.id) }
on: { click: () => this.toExecute(params.row.id,row) }
},
"查看"
)
......@@ -209,11 +209,11 @@ export default {
search() {
this.$refs.grid.reload(this.easySearch);
},
toExecute(id, orderId) {
toExecute(id, orderId,row) {
//跳转到对应操作页面 获取id:this.$route.query.id
this.$router.push({
path: "/produce/execute",
query: { id: id, orderId: orderId }
query: { id: id, orderId: orderId,row }
});
},
tdStyle(val) {
......
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