Commit f6cc4acd authored by 张海景's avatar 张海景

update:修改质量首检查看编辑加上新增按钮

parent d4cefe65
......@@ -19,6 +19,8 @@ const install = (Vue, vm) => {
vm.$u.get(config.adminPath + '/system/user/list', params),
getUserPrintInfo: () =>
vm.$u.get(config.adminPath + '/system/print/printer'),
getQcIndexList: (params) =>
vm.$u.get(config.adminPath + '/mes/qc/qcindex/list', params),
getPrintDown: (params) =>
vm.$u.postJson(config.adminPath + '/common/printDown', params),
login: (params = {}) =>
......
......@@ -66,9 +66,13 @@ export default {
handleClick() {
if (this.tableParams.userName) {
this.params.userName = this.tableParams.userName;
} else {
delete this.params.userName
}
if (this.tableParams.nickName) {
this.params.nickName = this.tableParams.nickName;
} else {
delete this.params.nickName
}
this.params.pageNum = 1;
this.getList();
......
......@@ -79,9 +79,13 @@ export default {
handleClick() {
if (this.tableParams.userName) {
this.params.userName = this.tableParams.userName;
} else {
delete this.params.userName
}
if (this.tableParams.nickName) {
this.params.nickName = this.tableParams.nickName;
} else {
delete this.params.nickName
}
this.params.pageNum = 1;
this.getList();
......
<template>
<view class="dmodel-table">
<view class="search">
<u-form :model="tableParams" labelAlign="right" class="tableForm">
<u-form-item label="检测项编号" label-width="100px" name="indexCode">
<uni-easyinput type="text" v-model="tableParams.indexCode" placeholder="请输入编号" />
</u-form-item>
<u-form-item label="检测项名称" label-width="100px" name="indexName">
<uni-easyinput type="text" v-model="tableParams.indexName" placeholder="请输入名称" />
</u-form-item>
<u-form-item>
<u-button class="btn" @click="handleClick" type="primary" size="medium">搜索</u-button>
</u-form-item>
</u-form>
</view>
<view>
<zb-table ref="zbTable" rowKey="indexCode" :columns="tableColumn" :data="tableData" :stripe="true" @toggleRowSelection="toggleRowSelection"></zb-table>
</view>
<view class="uni-pagination-box"><uni-pagination show-icon :page-size="params.pageSize" :current="params.pageNum" :total="total" @change="change" /></view>
</view>
</template>
<script>
export default {
name: 'User',
data() {
return {
params: {
pageNum: 1,
pageSize: 10
},
total: 0,
tableParams: {
indexCode: '',
indexName: ''
},
tableData: [],
tableSelectData: [],
tableColumn: [
{
type: 'radio',
width: 40
},
{
name: 'indexCode',
label: '检测项编码',
width: 160
},
{
name: 'indexName',
label: '检测项名称',
width: 200
}
]
};
},
mounted() {
this.getList();
},
methods: {
handleClick() {
if (this.tableParams.indexName) {
this.params.indexName = this.tableParams.indexName;
} else {
delete this.params.indexName
}
if (this.tableParams.indexCode) {
this.params.indexCode = this.tableParams.indexCode;
} else {
delete this.params.indexCode
}
this.params.pageNum = 1;
this.getList();
},
async getList() {
const res = await this.$u.api.getQcIndexList(this.params);
console.log(res, 'res');
if (res.code == 200) {
this.tableData = res.rows;
this.total = res.total;
}
},
// 分页触发
change(e) {
this.params.pageNum = e.current;
this.getList();
},
toggleRowSelection(checked, arr) {
this.tableSelectData = arr;
}
}
};
</script>
<style lang="scss" scoped>
.dmodel-table {
height: 1200rpx;
margin-top: 20rpx;
padding: 0 20rpx;
position: relative;
}
.tableForm {
display: flex;
margin-bottom: 20rpx;
}
.btn {
margin-left: 10px;
}
.uni-pagination-box {
position: absolute;
right: 20rpx;
bottom: 40rpx;
}
</style>
......@@ -55,15 +55,14 @@
size="mini"
type="primary"
v-if="curQcType === 'FIRST' && scope.row.ipqcType === 'FIRST' && scope.row.status === 'CONFIRMED'"
@click="qcLineClick(scope.row, false)"
@click="qcLineClick(scope.row, false, 'firstView')"
>
查看
</button>
<!-- 首检按钮判断FIRST结束 -->
<!-- 首检确认按钮判断SJQR开始 -->
<button class="uni-button" size="mini" type="primary" v-if="curQcType === 'SJQR'" @click="qcLineClick(scope.row, true, 'sjqrFinish')">查看确认</button>
<!-- <button class="uni-button" size="mini" type="primary" v-if="scope.row.ipqcType === 'SJQR'" @click="firstCONFIRMED(scope.row)">
确认
</button> -->
<!-- 首检确认按钮判断SJQR结束 -->
</view>
</template>
</zb-table>
......@@ -115,13 +114,16 @@
<u-form-item label="检测人员" prop="inspectorNickName">
<!-- <u-input v-model="qcForm.inspector"></u-input>-->
<!-- <zxz-uni-data-select v-model="qcForm.inspector" filterable multiple dataKey="label" dataValue="value" :localdata="qcUserList" @change="change"></zxz-uni-data-select> -->
<u-input readonly v-model="qcForm.inspectorNickName"></u-input>
<u-input disabled v-model="qcForm.inspectorNickName"></u-input>
<u-button @tap="userTempVisible = true" type="success" size="mini">选择人员</u-button>
</u-form-item>
</u-col>
</u-row>
</u-form>
<scroll-view scroll-y="true" scroll-x="true" class="line-list">
<!-- <scroll-view scroll-y="true" scroll-x="true" class="line-list"> -->
<view class="btnbox">
<u-button v-if="btnType === 'firstEdit'" type="success" size="medium" @click="handleAddFirstEdit">新增</u-button>
</view>
<view class="line-content-item">
<uni-table ref="qcLineTable" class="line-table" border stripe :loading="loading" emptyText="未查询到数据">
<uni-tr>
......@@ -138,9 +140,21 @@
<uni-easyinput v-else v-model="line.qualityCheckResults"></uni-easyinput>
</uni-td>
</uni-tr>
<uni-tr v-for="(line, index) in qcAddList" :key="index + 'add'">
<uni-td align="center">
<view style="display:flex;">
<u-input disabled v-model="line.indexName" placeholder="选择质检项目"></u-input>
<u-button @tap="zjVisible = true, qcAddIndex = index" type="success" size="mini">选择质检项目</u-button>
</view>
</uni-td>
<uni-td align="center"></uni-td>
<uni-td width="150px" align="center">
<uni-easyinput v-model="line.qualityCheckResults"></uni-easyinput>
</uni-td>
</uni-tr>
</uni-table>
</view>
</scroll-view>
<!-- </scroll-view> -->
</u-modal>
<u-modal
title="选择人员"
......@@ -154,6 +168,18 @@
<user ref="userRef" v-if="userTempVisible" />
</view>
</u-modal>
<u-modal
title="选择质检项目"
@confirm="handleSubmitZj"
show-cancel-button
:title-style="{ 'background-color': '#1E3770', color: '#FFFFFF', 'line-height': '37px', 'padding-top': '0px' }"
v-model="zjVisible"
width="1300rpx"
>
<view class="feedback-card">
<zjList ref="zjListRef" v-if="zjVisible" />
</view>
</u-modal>
<u-modal width="80%" v-model="qcMsgVisible" :showConfirmButton="false" :showCancelButton="true" title="检验通知" content="操作内容">
<scroll-view scroll-y="true" scroll-x="true" class="line-list">
......@@ -299,6 +325,7 @@ import SearchInput from '@/components/ScanInput/index.vue';
import UButton from '../../../uview-ui/components/u-button/u-button.vue';
import UniEasyinput from '../../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue';
import User from '@/components/User/User.vue';
import zjList from './components/zjList.vue';
export default {
name: 'QcContent',
......@@ -306,7 +333,8 @@ export default {
SearchInput,
UButton,
UniEasyinput,
User
User,
zjList
},
dicts: ['mes_ipqc_type', 'mes_qc_result', 'mes_order_status', 'mes_defect_level'],
computed: {
......@@ -320,6 +348,10 @@ export default {
},
data() {
return {
btnType:'',
qcAddIndex: null,
zjVisible: false,
qcAddList: [],
tableSjColumn: [
{
name: 'ipqcCode',
......@@ -516,6 +548,29 @@ export default {
this.getIpqcList();
}
},
handleAddFirstEdit() {
this.qcAddList.push({
indexName: '',
qualityCheckResults: ''
})
},
handleSubmitZj() {
if (!this.$refs.zjListRef.tableSelectData[0]?.indexName) {
this.zjVisible = true
this.$u.toast('请选择质检项目')
return false
}
// 必传 qcTemplateIndexId inputType:1 ipqcId indexId indexCode indexName indexType qcTool
console.log(this.$refs.zjListRef.tableSelectData, 'this.$refs.zjListRef.tableSelectData');
this.$set(this.qcAddList[this.qcAddIndex], 'inputType', 1)
this.$set(this.qcAddList[this.qcAddIndex], 'ipqcId', this.qcForm.ipqcId)
this.$set(this.qcAddList[this.qcAddIndex], 'indexId', this.$refs.zjListRef.tableSelectData[0]?.indexId)
this.$set(this.qcAddList[this.qcAddIndex], 'indexCode', this.$refs.zjListRef.tableSelectData[0]?.indexCode)
this.$set(this.qcAddList[this.qcAddIndex], 'indexName', this.$refs.zjListRef.tableSelectData[0]?.indexName)
this.$set(this.qcAddList[this.qcAddIndex], 'indexType', this.$refs.zjListRef.tableSelectData[0]?.indexType)
this.$set(this.qcAddList[this.qcAddIndex], 'qcTool', this.$refs.zjListRef.tableSelectData[0]?.qcTool)
console.log(this.qcAddList)
},
userDetermine() {
console.log(this.$refs.userRef.tableSelectData, 'this.$refs.userRef.tableSelectData');
this.qcForm.inspectorNickName = this.$refs.userRef.tableSelectData[0]?.nickName;
......@@ -550,7 +605,7 @@ export default {
},
async submitIpqc(status = 'PREPARE') {
if (this.curQcType == 'SJQR') {
if (this.btnType === 'sjqrFinish') {
this.firstCONFIRMED(this.qcForm);
return;
}
......@@ -558,7 +613,7 @@ export default {
this.$u.toast('请输入任务单号!');
return;
}
const qcIpqclineList = this.qcLines.map((item) => {
let qcIpqclineList = this.qcLines.map((item) => {
let selectValues = item.selectValues;
let qualityCheckResults = item.qualityCheckResults;
if (item.inputType == 2) {
......@@ -576,6 +631,9 @@ export default {
qualityCheckResults
};
});
if (this.btnType === 'firstEdit') {
qcIpqclineList = qcIpqclineList.concat(this.qcAddList)
}
const ipqcCode = await this.$u.api.getIpqcCode();
const param = {
ipqcId: this.qcForm.ipqcId,
......@@ -713,6 +771,8 @@ export default {
// }
},
qcLineClick(item, flag, btnType) {
this.qcAddList = []
this.btnType = btnType
this.qcModalFlag = true;
this.qcForm = Object.assign({}, item);
console.log(item, ' itme33344');
......
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