Commit 71e80862 authored by 仇晓婷's avatar 仇晓婷

工单执行

parent b4b5b791
......@@ -9,7 +9,6 @@
ref="codes"
class="select-produt-name"
/>
<Button type="primary" @click="QcCardChecker(1)" class="title_btn ml10">自检</Button>
<Button type="primary" :disabled="ishavhj" @click="QcCardChecker(2)" class="title_btn ml10">互检</Button>
<Button type="primary" @click="SendCheck()" class="title_btn ml10">送检</Button>
......@@ -22,6 +21,13 @@
placeholder="请输入..."
@on-blur="selfchecklistinput(index,$event)"
></Input>
<!-- <op
class="view"
@click="showrecordData(row,1,true)"
v-if="row.selfchecklist.fill_in_content==''"
v-text="row.fillintype_str"
></op>
<op class="view" @click="showrecordData(row,1,true)" v-else v-text="look"></op>-->
</template>
<template slot-scope="{ row,index }" slot="mutualfillin">
<Button type="primary" size="small" style="margin-right: 5px" @click="show(index)">View</Button>
......@@ -32,12 +38,36 @@
</template>
</Table>
</div>
<Modal
v-model="usercardModal"
title="刷卡汇报"
width="1340"
:footer-hide="true"
:mask-closable="false"
>
<usercard ref="usercard"></usercard>
</Modal>
<Modal
v-model="sendCheckModal"
title="产品送检"
width="1340"
:footer-hide="true"
:mask-closable="false"
>
<sendCheck ref="sendCheck"></sendCheck>
</Modal>
</div>
</template>
<script>
import usercard from "./usercard.vue";
import sendCheck from "./sendCheck.vue";
export default {
name: "starOrder",
props: ["orderId"],
components: {
usercard,
sendCheck
},
data() {
return {
product_ID: "",
......@@ -45,6 +75,8 @@ export default {
ishavhj: false,
ishavzj: true,
productSerialNumber: "",
usercardModal: false,
sendCheckModal: false,
columns12: [
{ title: "序号", type: "index", width: "70", align: "center" },
{
......@@ -175,8 +207,72 @@ export default {
// change(e) {
// this.entity.productQuantity = e.length + ''
// },
QcCardChecker() {},
SendCheck() {},
QcCardChecker(fill_in_user_type) {
let fillModel = {
fill_in_user_type: fill_in_user_type,
productisabled: this.productisabled,
product_ID: this.product_ID,
board_ID: this.board_ID,
product_List: this.product_List,
board_List: this.board_List
};
let recordList = [];
for (let i = 0; i < this.recorddata.length; i++) {
let obj = this.recorddata[i];
if (fill_in_user_type == 1) {
if (
(obj.selfchecklist.fillinstatus == "0" &&
obj.selfchecklist != null &&
obj.selfchecklist.fill_in_content != null &&
obj.selfchecklist.fill_in_content != "") ||
this.productobj.productstatus == 4
) {
let qc = {
qc_card_id: obj.qc_card_id,
movieid: obj.movieid,
Fillintype: obj.fillintype,
fill_in_content: obj.selfchecklist.fill_in_content,
fillinstatus: "1"
};
recordList.push(qc);
}
} else if (fill_in_user_type == 2) {
if (obj.check_type == 2 || obj.check_type == 4) {
if (
(obj.mutualchecklist.fillinstatus == "0" &&
obj.mutualchecklist != null &&
obj.mutualchecklist.fill_in_content != null &&
obj.mutualchecklist.fill_in_content != "") ||
this.productobj.productstatus == 4
) {
let qc = {
qc_card_id: obj.qc_card_id,
movieid: obj.movieid,
Fillintype: obj.fillintype,
fill_in_content: obj.mutualchecklist.fill_in_content,
fillinstatus: "1"
};
recordList.push(qc);
}
}
} else if (fill_in_user_type == 3) {
}
}
if (recordList.length == 0) {
this.$Message.success("填报项为空,请进行填报");
return;
}
this.usercardModal = true;
this.$refs.usercard.loadentry(this.entryModel, fillModel, recordList);
},
SendCheck() {
this.sendCheckModal = true;
this.$refs.sendCheck.loadentry(this.entryModel);
},
selfchecklistinput() {}
}
};
......
<template>
<Form ref="form" :model="user" :label-width="100">
<Row class="rowTitle100">
<Col :span="12">
<Checkbox v-model="isall" @on-change="peoductAllOnchange"></Checkbox>
<template v-if="isMain!=1">
<span class="ml20">汇报板次</span>
<Select @on-change="boardonchange" multiple v-model="board_ID" class="w200">
<Option
v-for="item in board_List"
:value="item.boardNumber"
:key="item.index"
>{{ item.boardNumber }}</Option>
</Select>
</template>
<span class="ml20">产品号</span>
<Select
:disabled="disabled"
multiple
@on-change="productonchange"
v-model="product_ID"
class="w200"
>
<Option
v-for="item in product_List"
:value="item.productids"
:key="item.index"
>{{ item.productcodes }}</Option>
</Select>
</Col>
</Row>
<Row class="rowTitle100">
<Col :span="12">
<FormItem label="检验员">
<CheckboxGroup v-model="checker" class="radio_option">
<Checkbox v-for="(item,index) in checkerlist" :label="item.id" :key="index">
<span>{{item.userName}}</span>
</Checkbox>
</CheckboxGroup>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit">确定</Button>
</FormItem>
</Form>
</template>
<script>
import service from '@/plugins/request'
import QS from 'querystring'
export default {
name: 'sendCheck',
components: {},
data() {
return {
disabled: false,
isCurrentUser: false,
checkerlist: [],
checker: [],
user: {
id: 0,
dispatch_id: 0,
execute_id: 0,
order_id: '',
routingHeaderId: 0,
routingDetailId: 0,
product_code: '',
board_code: '',
checkerIds: '',
checkerNames: '',
check_Status: 0,
check_Result: '',
checker: 0,
check_time: null
},
isall:[],
isMain: 1,
productisabled: false,
product_ID: [],
board_ID: [],
product_List: [],
board_List: []
}
},
mounted() {},
watch: {},
methods: {
handleSubmit() {
let state = true
if (this.product_ID.length == 0) {
state = false
this.$Message.error('请选择要送检的产品')
return
}
this.user.product_code = this.product_ID.join(',')
this.user.board_code = this.board_ID.join(',')
if (this.checker.length == 0) {
state = false
this.$Message.error('请选择检验员')
return
} else {
let checkername = []
for (let i = 0; i < this.checker.length; i++) {
for (let j = 0; j < this.checkerlist.length; j++) {
if (this.checkerlist[j].id == this.checker[i]) {
checkername.push(this.checkerlist[j].userName)
}
}
}
this.user.checkerIds = this.checker.join(',')
this.user.checkerNames = checkername.join(',')
}
if (state) {
var url = `${PlanUrl}/ordercheckresult/sendcheck`
service
.post(`${url}`, this.user)
.then((response) => {
if (response.success) {
this.$Message.success('保存成功')
this.$parent.$parent.loadproduct()
this.$parent.$parent.sendCheckModal = false
}
})
.catch((error) => {
this.$Message.error('保存失败')
})
}
},
handleClose() {},
loadentry(entryModel) {
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.isMain = entryModel.isMain
if (this.isMain == 1) {
this.disabled = false
} else {
this.disabled = true
}
this.checker = []
;(this.product_ID = []), (this.board_ID = []), this.loadproduct()
this.loaduser()
},
loadproduct() {
var url =
`${PlanUrl}/ordercheck/sendcheckproductcode?entryID=` +
this.user.dispatch_id
service.post(`${url}`).then((response) => {
this.product_List = response.result
this.board_List = response.result
})
},
loaduser() {
let params = {
role_type: 1,
name: '检验',
isSelect: 1,
pageSize: 10,
page: 1
}
var url = systemUrl + '/MyRole/GetRolesAsync?' + QS.stringify(params)
service.get(`${url}`).then((response) => {
let roles = response.result.items
let roleids = []
for (let i = 0; i < roles.length; i++) {
roleids.push(roles[i].id)
}
// let userInfo = this.$store.admin.user.info;
// var url =
// `${systemUrl}/myuserrole/GetUsersByRoleAndorgan?ids=` +
// roleids.join(',') +
// '&&organId=0&userid=' +
// userInfo.userId
var url =
`${systemUrl}/myuserrole/GetUsersByRole?ids=` + roleids.join(',')
service.get(`${url}`).then((response) => {
for (let j = 0; j < response.result.length; j++) {
let user = response.result[j]
var index = this.checkerlist.filter(function(item) {
return item.id === user.id
})
if (index.length == 0) {
this.checkerlist.push(user)
}
}
})
})
},
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)
}
}
for (let i = 0; i < this.product_List.length; i++) {
let obj = this.product_List[i]
this.product_ID.push(obj.productids)
}
} else {
this.product_ID = []
this.board_ID = []
}
},
productonchange(e) {},
boardonchange(e) {
this.product_ID = []
for (let i = 0; i < this.board_List.length; 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)
}
}
}
}
}
}
</script>
\ No newline at end of file
<template>
<Form ref="form" :model="user" :rules="rules" :label-width="100">
<Row class="rowTitle100">
<Col :span="12">
<Checkbox v-model="isall" @on-change="peoductAllOnchange"></Checkbox>
<template v-if="isMain!=1">
<span class="ml20">汇报板次</span>
<Select
:width="width1"
@on-change="boardonchange"
multiple
v-model="board_ID"
class="w200"
>
<Option
v-for="item in board_List"
:value="item.boardNumber"
:key="item.index"
>{{ item.boardNumber }}</Option>
</Select>
</template>
<span class="ml20">产品号</span>
<Select
:disabled="productdisabled"
multiple
@on-change="productonchange"
v-model="product_ID"
class="w200"
>
<Option
v-for="item in product_List"
:value="item.productids"
:key="item.index"
>{{ item.productcodes }}</Option>
</Select>
</Col>
</Row>
<Row class="rowTitle100">
<Col :span="12">
<FormItem label="员工编号" prop="cardno">
<Input v-model="user.cardno"></Input>
<Checkbox v-model="isCurrentUser" @on-change="getCurrentUser">当前用户</Checkbox>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">确定</Button>
</FormItem>
</Form>
</template>
<script>
import service from '@/plugins/request'
export default {
name: 'usercard',
components: {},
data() {
const validateCarNo = (rule, value, callback) => {
if (!value) {
return callback(new Error('员工编号不能为空'))
}
var params = {
conditions: [
{
fieldName: 'cardNo',
fieldValue: value,
conditionalType: 'Equal'
}
],
pageSize: 3
}
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()
} else {
this.user.cardno = ''
return callback(new Error('员工编号不存在'))
}
})
}
return {
disabled: false,
productdisabled: false,
isCurrentUser: false,
isall: false,
width1: '400',
user: {
dispatch_id: 0,
execute_id: 0,
order_id: '',
routingHeaderId: 0,
routingDetailId: 0,
product_code: [],
board_code: [],
cardno: '',
user_id: '',
user_name: '',
remarks: '',
fill_in_user_type: 0,
reportdate: null,
isreplace: 0
},
recordList: [],
isMain: 1,
productisabled: false,
product_ID: [],
board_ID: [],
product_List: [],
board_List: [],
rules: {
cardno: [
{ required: true, message: '必填', trigger: 'blur' },
{ validator: validateCarNo, trigger: 'blur' }
]
}
}
},
mounted() {},
watch: {},
methods: {
handleSubmit() {
let state = true
if (this.product_ID.length == 0) {
state = false
this.$Message.error('请选择要送检的产品')
return
}
this.user.product_code = this.product_ID.join(',')
this.user.board_code = this.board_ID.join(',')
if (state) {
this.$refs.form.validate((v) => {
if (v) {
var url = `${PlanUrl}/orderexecutequalityrecord/qccardchecker`
service
.post(
`${url}`,
{
user: this.user,
card: this.recordList
}
)
.then((response) => {
if (response.success) {
this.$Message.success('保存成功')
this.$parent.$parent.loadproduct()
this.$parent.$parent.usercardModal = false
}
})
.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
if (this.isMain == 1) {
this.productdisabled = false
} else {
this.productdisabled = true
}
this.product_ID.push(fillModel.product_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
} else {
this.board_List = []
this.product_List = []
for (let i = 0; i < fillModel.product_List.length; 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.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)
}
}
for (let i = 0; i < this.product_List.length; i++) {
let obj = this.product_List[i]
this.product_ID.push(obj.productids)
}
} else {
this.product_ID = []
this.board_ID = []
}
},
productonchange(e) {},
boardonchange(e) {
this.product_ID = []
for (let i = 0; i < this.board_List.length; 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)
}
}
}
},
getCurrentUser(e) {
if (e) {
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
} else {
this.user.cardno = ''
}
}
}
}
</script>
\ No newline at end of file
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