初始化仓库
This commit is contained in:
326
pages/qc/fqc.vue
Normal file
326
pages/qc/fqc.vue
Normal file
@@ -0,0 +1,326 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-collapse-item title="生产入库检单" :open="true">
|
||||
<uni-forms-item label="来源单" :labelWidth='90' name="sourceCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar1" @confirm="scanBarSourceCode"
|
||||
v-model="formData.sourceCode" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检单" :labelWidth='90' name="qualityCode">
|
||||
<uni-combox-re labelKey="qualityCode" valueKey="id" :candidates="qualityCodeList" emptyTips="无"
|
||||
@input="scanBarCode" v-model="formData.qualityCode"></uni-combox-re>
|
||||
<!-- <uni-easyinput suffixIcon="scan" @iconClick="scanBar" @confirm="scanBarCode"
|
||||
v-model="formData.qualityCode" type="text" /> -->
|
||||
</uni-forms-item>
|
||||
|
||||
<uni-forms-item label="仓库编码" :labelWidth='90' name="warehouseCode">
|
||||
<uni-easyinput type="text" v-model="formData.warehouseCode" />
|
||||
</uni-forms-item>
|
||||
</uni-collapse-item>
|
||||
<uni-collapse-item title="生产入库检单明细" :open="true">
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item :rightOptions="rightOptions" :key="index"
|
||||
v-for="(item, index) in formData.qcQualityBillDetailList"
|
||||
@click="(data) => clickDetail(index,data)" @change="swipChange">
|
||||
<view>
|
||||
<uni-badge :text="index+1" class="uni-badge-left-margin" type="primary"></uni-badge>
|
||||
<button @click="open(index)" size="mini" type="primary">编辑</button>
|
||||
</view>
|
||||
<uni-forms-item label="物料编码" :labelWidth='80'
|
||||
:name="'qcQualityBillDetailList.'+ index +'.materialCode'">
|
||||
<uni-easyinput type="text" disabled v-model="item.materialCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="制程编码" :labelWidth='80'
|
||||
:name="'qcQualityBillDetailList.'+ index +'.opCode'">
|
||||
<uni-easyinput type="text" disabled v-model="item.opCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料批号" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.materialBatchNo'">
|
||||
<uni-easyinput disabled type="text" v-model="item.materialBatchNo" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料箱号" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.materialLotNo'">
|
||||
<uni-easyinput disabled type="text" v-model="item.materialLotNo" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检员" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'qualityBy'">
|
||||
<uni-easyinput disabled type="text" v-model="item.qualityBy" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检方案编码" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.qualityTypeCode'">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar3"
|
||||
v-model="item.qualityTypeCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检标准编码" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.qualityStandardCode'">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar4(index)"
|
||||
v-model="item.qualityStandardCode" />
|
||||
</uni-forms-item>
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="计划质检数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.planNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.planNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="实收数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.actualNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.actualNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.number'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.number"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检合格数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.passNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.passNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-forms-item label="质检不通过原因" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.failReason'">
|
||||
<uni-easyinput type="textarea" v-model="item.failReason" />
|
||||
</uni-forms-item>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listQualityBill,
|
||||
addQualityBill,
|
||||
getQualityBill,
|
||||
updateQualityBill,
|
||||
listQualityBillByBatchNo,
|
||||
getStandardList,
|
||||
listStandardList
|
||||
} from "@/api/qc/qc.js";
|
||||
import {
|
||||
listPwoJob
|
||||
} from "@/api/mes/jobReport.js"
|
||||
import uniComboxRe from "../../uni_modules/uni-combox/components/uni-combox/uni-combox-re.vue"
|
||||
export default {
|
||||
mounted() {
|
||||
listStandardList().then(async res => {
|
||||
this.StandardList = res.rows;
|
||||
})
|
||||
},
|
||||
components: {
|
||||
uniComboxRe
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
sourceCode: null,
|
||||
qualityCode: null,
|
||||
warehouseCode: null,
|
||||
qcQualityBillDetailList: [],
|
||||
},
|
||||
qualityCodeList: [],
|
||||
StandardList: null,
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
rules: {
|
||||
sourceCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入来源单!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
otherFun(object) {
|
||||
console.log(object)
|
||||
this.formData.qcQualityBillDetailList.find(item => item.id == object.did).number = object.number;
|
||||
this.formData.qcQualityBillDetailList.find(item => item.id == object.did).passNumber = object.passNumber;
|
||||
},
|
||||
open(index) {
|
||||
let qscid = null;
|
||||
if (this.formData.qcQualityBillDetailList[index].qualityStandardCode && this.formData
|
||||
.qcQualityBillDetailList[index].qualityStandardCode != "") {
|
||||
const result = this.StandardList.find(item => item.qualityStandardCode == this.formData
|
||||
.qcQualityBillDetailList[index].qualityStandardCode);
|
||||
if (result !== undefined) {
|
||||
// 找到了匹配项,进行后续逻辑
|
||||
qscid = result.id
|
||||
let did = this.formData.qcQualityBillDetailList[index].id;
|
||||
let mbn = this.formData.qcQualityBillDetailList[index].materialBatchNo;
|
||||
let mc = this.formData.qcQualityBillDetailList[index].materialCode;
|
||||
|
||||
console.log(qscid + ' ' + mbn + ' ' + mc);
|
||||
uni.navigateTo({
|
||||
url: '/pages/qc/updateStandardList?qscid=' + qscid +
|
||||
'&materialBatchNo=' + mbn +
|
||||
'&materialCode=' + mc +
|
||||
'&did=' + did
|
||||
});
|
||||
} else {
|
||||
console.log(result)
|
||||
this.$modal.msg("未检索到该质检标准编码相关信息!");
|
||||
}
|
||||
} else {
|
||||
this.$modal.msg("请输入质检标准编码!");
|
||||
}
|
||||
},
|
||||
test() {},
|
||||
change(e) {
|
||||
console.log('当前模式:' + e.type + ',状态:' + e.show);
|
||||
},
|
||||
scanBarCode(e) {
|
||||
if (e) {
|
||||
//查询质检单明细
|
||||
getQualityBill(e).then(async response => {
|
||||
this.formData = response.data;
|
||||
this.formData.qcQualityBillDetailList =
|
||||
response.data.qcQualityBillDetailList.map((item) => {
|
||||
item.qualityStandardCode = this.StandardList.find(i =>
|
||||
i.id == item.qualityStandardCode)
|
||||
.qualityStandardCode
|
||||
item.qualityTypeCode = Number(item.qualityTypeCode);
|
||||
return item;
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
scanBarSourceCode() {
|
||||
if (this.formData.sourceCode && this.formData.sourceCode != "") {
|
||||
let q = {
|
||||
sourceCode: this.formData.sourceCode
|
||||
}
|
||||
listQualityBill(q).then(async res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.qualityCodeList = res.rows;
|
||||
console.log(this.qualityCodeList)
|
||||
} else {
|
||||
this.$modal.msg("未检索到该来源单相关信息!");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
//质检单
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qualityCode = res.result;
|
||||
_this.scanBarCode(_this.formData.qualityCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//来源单
|
||||
scanBar1() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.sourceCode = res.result;
|
||||
_this.scanBarSourceCode(_this.formData.sourceCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//仓库编码
|
||||
scanBar2() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.warehouseCode = res.result;
|
||||
_this.scanBarCode(_this.formData.warehouseCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//质检方案编码
|
||||
scanBar3() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qcQualityBillDetailList[0].qualityTypeCode = res.result;
|
||||
_this.scanBarCode(_this.qcQualityBillDetailList[0].qualityTypeCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//质检标准编码
|
||||
scanBar4(index) {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qcQualityBillDetailList[index].qualityStandardCode = res.result;
|
||||
_this.scanBarCode(_this.qcQualityBillDetailList[index].qualityStandardCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
_this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定完成该质检吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
for (var i in _this.formData.qcQualityBillDetailList) {
|
||||
if (_this.formData.qcQualityBillDetailList[i]
|
||||
.qualityStandardCode && _this.formData.qcQualityBillDetailList[
|
||||
i].qualityStandardCode != "") {
|
||||
//查询质检标准编码的id
|
||||
const res = _this.StandardList.find(item => item
|
||||
.qualityStandardCode == _this.formData
|
||||
.qcQualityBillDetailList[i].qualityStandardCode);
|
||||
if (res !== undefined) {
|
||||
_this.formData.qcQualityBillDetailList[i]
|
||||
.qualityStandardCode = res.id;
|
||||
} else {
|
||||
_this.$modal.msg("请填写正确的质检标准编码!");
|
||||
}
|
||||
} else {
|
||||
_this.formData.qcQualityBillDetailList[i].qualityStandardCode =
|
||||
null;
|
||||
}
|
||||
}
|
||||
_this.$modal.loading('提交中')
|
||||
updateQualityBill(_this.formData).then(async res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("检验成功!");
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
|
||||
</style>
|
||||
463
pages/qc/ipqc.vue
Normal file
463
pages/qc/ipqc.vue
Normal file
@@ -0,0 +1,463 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-collapse-item title="生产过程检单" :open="true">
|
||||
<uni-forms-item label="来源单" :labelWidth='90' name="sourceCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar1" @confirm="scanBarSourceCode"
|
||||
v-model="formData.sourceCode" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检单" :labelWidth='90' name="qualityCode">
|
||||
<uni-combox-re labelKey="qualityCode" valueKey="id" :candidates="qualityCodeList" emptyTips="无"
|
||||
@input="scanBarCode" v-model="formData.qualityCode"></uni-combox-re>
|
||||
<!-- <uni-easyinput suffixIcon="scan" @iconClick="scanBar" @confirm="scanBarCode"
|
||||
v-model="formData.qualityCode" type="text" /> -->
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="单据类型" :labelWidth='90' name="type">
|
||||
<uni-tag :text="formData.typeText" type="success"></uni-tag>
|
||||
</uni-forms-item>
|
||||
<!-- <uni-forms-item label="仓库编码" :labelWidth='90' name="warehouseCode">
|
||||
<uni-easyinput type="text" v-model="formData.warehouseCode" />
|
||||
</uni-forms-item> -->
|
||||
<uni-forms-item label="工单" :labelWidth='90' name="pwoCode">
|
||||
{{formData.pwoCode}}
|
||||
<!-- <uni-easyinput type="text" v-model="formData.warehouseCode" /> -->
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料编码" :labelWidth='90' name="ptNoTar">
|
||||
{{formData.ptNoTar}}
|
||||
<!-- <uni-easyinput type="text" v-model="formData.warehouseCode" /> -->
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料名称" :labelWidth='90' name="ptTitleTar">
|
||||
{{formData.ptTitleTar}}
|
||||
<!-- <uni-easyinput type="text" v-model="formData.warehouseCode" /> -->
|
||||
</uni-forms-item>
|
||||
|
||||
</uni-collapse-item>
|
||||
<uni-collapse-item title="生产过程检单明细" :open="true">
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item :rightOptions="rightOptions" :key="index"
|
||||
v-for="(item, index) in formData.qcQualityBillDetailList"
|
||||
@click="(data) => clickDetail(index,data)" @change="swipChange">
|
||||
<view>
|
||||
<uni-badge :text="index+1" class="uni-badge-left-margin" type="primary"></uni-badge>
|
||||
<button @click="open(index)" size="mini" type="primary">编辑</button>
|
||||
</view>
|
||||
<uni-forms-item label="物料编码" :labelWidth='80'
|
||||
:name="'qcQualityBillDetailList.'+ index +'.materialCode'">
|
||||
<uni-easyinput type="text" disabled v-model="item.materialCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料名称" :labelWidth='80'
|
||||
:name="'qcQualityBillDetailList.'+ index +'.materialName'">
|
||||
<uni-easyinput type="text" disabled v-model="item.materialName"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料规格" :labelWidth='80'
|
||||
:name="'qcQualityBillDetailList.'+ index +'.specification1'">
|
||||
<uni-easyinput type="text" disabled v-model="item.specification1"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="制程编码" :labelWidth='80'
|
||||
:name="'qcQualityBillDetailList.'+ index +'.opCode'">
|
||||
<uni-easyinput type="text" disabled v-model="item.opCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料批号" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.materialBatchNo'">
|
||||
<uni-easyinput disabled type="text" v-model="item.materialBatchNo" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料箱号" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.materialLotNo'">
|
||||
<uni-easyinput disabled type="text" v-model="item.materialLotNo" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检员" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'qualityBy'">
|
||||
<!-- <uni-easyinput type="text" v-model="item.qualityBy" suffixIcon="scan"
|
||||
@iconClick="scanBarqualityBy" /> -->
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBarqualityBy"
|
||||
v-model="item.qualityBy" @confirm="(data) => isEmp(index,data)" />
|
||||
<uni-data-select style="margin-top: 10px;" v-model="item.qualityBy" :localdata="empList"
|
||||
@change="qualityByChange"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
<!-- <uni-forms-item label="质检方案编码" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.qualityTypeCode'">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar3"
|
||||
v-model="item.qualityTypeCode" />
|
||||
</uni-forms-item> -->
|
||||
<uni-forms-item label="质检标准编码" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.qualityStandardCode'">
|
||||
<uni-easyinput type="text" disabled
|
||||
v-model="item.qualityStandardCode+':'+item.qualityStandardName" />
|
||||
</uni-forms-item>
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="计划质检数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.planNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.planNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="实收数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.actualNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.actualNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.number'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.number"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检合格数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.passNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.passNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-forms-item label="质检不通过原因" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.failReason'">
|
||||
<uni-easyinput type="textarea" v-model="item.failReason" />
|
||||
</uni-forms-item>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
<uni-forms-item label="失败自动补单" :labelWidth='100' name="failRemake" style="margin-top: 10px;">
|
||||
<u-switch v-model="formData.failRemake" activeColor="#5AC725" inactiveColor="#ff4949"
|
||||
style="float: left;"></u-switch>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="检验结果" :labelWidth='90' name="result" style="margin-top: 10px;">
|
||||
<uni-data-select v-model="formData.result" :localdata="resultOptions"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
</uni-collapse>
|
||||
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listQualityBill,
|
||||
addQualityBill,
|
||||
getQualityBill,
|
||||
updateQualityBill,
|
||||
listQualityBillByBatchNo,
|
||||
getStandardList,
|
||||
listStandardList
|
||||
} from "@/api/qc/qc.js";
|
||||
import {
|
||||
listPwoJob
|
||||
} from "../../api/mes/jobReport";
|
||||
import {
|
||||
listPwo
|
||||
} from "../../api/mes/pwoDraw";
|
||||
import uniComboxRe from "../../uni_modules/uni-combox/components/uni-combox/uni-combox-re.vue"
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
import {
|
||||
listEmployee
|
||||
} from "@/api/mes/jobIn.js";
|
||||
export default {
|
||||
mounted() {
|
||||
listStandardList().then(async res => {
|
||||
this.StandardList = res.rows;
|
||||
})
|
||||
getDicts("qc_bill_result").then(res => {
|
||||
this.resultOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
getDicts("qc_bill_type").then(res => {
|
||||
this.typeOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
});
|
||||
listEmployee().then((res) => {
|
||||
this.empList = res.rows.map(item => {
|
||||
let obj = {
|
||||
text: item.name,
|
||||
value: item.empCode
|
||||
}
|
||||
return obj
|
||||
})
|
||||
})
|
||||
},
|
||||
components: {
|
||||
uniComboxRe
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
empList: [],
|
||||
resultOptions: [],
|
||||
typeOptions: [],
|
||||
formData: {
|
||||
qualityCode: null,
|
||||
warehouseCode: null,
|
||||
qcQualityBillDetailList: [],
|
||||
ptNoTar: null,
|
||||
ptTitleTar: null,
|
||||
typeText: null
|
||||
},
|
||||
qualityCodeList: [],
|
||||
StandardList: null,
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
rules: {
|
||||
sourceCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入来源单!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
qualityByChange(e) {
|
||||
console.log(e)
|
||||
this.formData.qualityBy = e;
|
||||
},
|
||||
//验证是否为员工
|
||||
isEmp(i, code) {
|
||||
listEmployee({
|
||||
empCode: code
|
||||
}).then(res => {
|
||||
if (res.total == 0) {
|
||||
this.$modal.msg("未查询到该员工!");
|
||||
this.formData.qcQualityBillDetailList[i].qualityBy = null;
|
||||
this.formData.qualityBy = null;
|
||||
}
|
||||
})
|
||||
},
|
||||
otherFun(object) {
|
||||
console.log(object)
|
||||
this.formData.qcQualityBillDetailList.find(item => item.id == object.did).number = object.number;
|
||||
this.formData.qcQualityBillDetailList.find(item => item.id == object.did).passNumber = object.passNumber;
|
||||
},
|
||||
open(index) {
|
||||
let qscid = null;
|
||||
if (this.formData.qcQualityBillDetailList[index].qualityStandardCode && this.formData
|
||||
.qcQualityBillDetailList[index].qualityStandardCode != "") {
|
||||
const result = this.StandardList.find(item => item.qualityStandardCode == this.formData
|
||||
.qcQualityBillDetailList[index].qualityStandardCode);
|
||||
if (result !== undefined) {
|
||||
console.log(result)
|
||||
// 找到了匹配项,进行后续逻辑
|
||||
qscid = result.id
|
||||
let did = this.formData.qcQualityBillDetailList[index].id;
|
||||
let mbn = this.formData.qcQualityBillDetailList[index].materialBatchNo;
|
||||
let mc = this.formData.qcQualityBillDetailList[index].materialCode;
|
||||
let mn = this.formData.qcQualityBillDetailList[index].materialName || '';
|
||||
let sp = this.formData.qcQualityBillDetailList[index].specification1 || '';
|
||||
let billId = this.formData.id;
|
||||
let number = this.formData.qcQualityBillDetailList[index].number;
|
||||
console.log(qscid + ' ' + mbn + ' ' + mc);
|
||||
uni.navigateTo({
|
||||
url: '/pages/qc/updateStandardList?qscid=' + qscid +
|
||||
'&materialBatchNo=' + mbn +
|
||||
'&materialCode=' + mc +
|
||||
'&materialName=' + mn +
|
||||
'&specification1=' + sp +
|
||||
'&number=' + number +
|
||||
'&did=' + did +
|
||||
'&billId=' + billId
|
||||
});
|
||||
} else {
|
||||
console.log(result)
|
||||
this.$modal.msg("未检索到该质检标准编码相关信息!");
|
||||
}
|
||||
} else {
|
||||
this.$modal.msg("请输入质检标准编码!");
|
||||
}
|
||||
},
|
||||
test() {},
|
||||
change(e) {
|
||||
console.log('当前模式:' + e.type + ',状态:' + e.show);
|
||||
},
|
||||
scanBarCode(e) {
|
||||
if (e) {
|
||||
//查询质检单明细
|
||||
getQualityBill(e).then(async response => {
|
||||
response.data.typeText = this.typeOptions.find(i =>
|
||||
i.value == response.data.type
|
||||
).text
|
||||
this.formData = {
|
||||
...this.formData,
|
||||
...response.data
|
||||
}
|
||||
this.formData.qcQualityBillDetailList =
|
||||
response.data.qcQualityBillDetailList.map((item) => {
|
||||
item.qualityStandardCode = this.StandardList.find(i =>
|
||||
i.id == item.qualityStandardCode)
|
||||
.qualityStandardCode
|
||||
item.qualityStandardName = this.StandardList.find(i =>
|
||||
i.id == item.qualityStandardCode)
|
||||
.qualityStandardName
|
||||
item.qualityTypeCode = Number(item.qualityTypeCode);
|
||||
return item;
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
scanBarSourceCode() {
|
||||
if (this.formData.sourceCode && this.formData.sourceCode != "") {
|
||||
let q = {
|
||||
sourceCode: this.formData.sourceCode
|
||||
}
|
||||
listQualityBill(q).then(async res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.qualityCodeList = res.rows;
|
||||
console.log(this.qualityCodeList)
|
||||
} else {
|
||||
this.$modal.msg("未检索到该来源单相关信息!");
|
||||
}
|
||||
});
|
||||
listPwoJob({
|
||||
code: this.formData.sourceCode
|
||||
}).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.formData.pwoCode = res.rows[0].pwoCode
|
||||
listPwo({
|
||||
pwoCode: this.formData.pwoCode
|
||||
}).then(resp => {
|
||||
if (resp.rows.length > 0) {
|
||||
this.formData.ptNoTar = resp.rows[0].ptNoTar;
|
||||
this.formData.ptTitleTar = resp.rows[0].ptTitleTar;
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
//质检单
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qualityCode = res.result;
|
||||
_this.scanBarCode(_this.formData.qualityCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//来源单
|
||||
scanBar1() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.sourceCode = res.result;
|
||||
_this.scanBarSourceCode(_this.formData.sourceCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//仓库编码
|
||||
scanBar2() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.warehouseCode = res.result;
|
||||
// _this.scanBarCode(_this.formData.warehouseCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//质检方案编码
|
||||
scanBar3() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qcQualityBillDetailList[0].qualityTypeCode = res.result;
|
||||
_this.scanBarCode(_this.qcQualityBillDetailList[0].qualityTypeCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//质检标准编码
|
||||
scanBar4(index) {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qcQualityBillDetailList[index].qualityStandardCode = res.result;
|
||||
_this.scanBarCode(_this.qcQualityBillDetailList[index].qualityStandardCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//质检员扫码
|
||||
scanBarqualityBy(index) {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qcQualityBillDetailList[index].qualityBy = res.result;
|
||||
_this.formData.qualityBy = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
_this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定完成该质检吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
for (var i in _this.formData.qcQualityBillDetailList) {
|
||||
if (_this.formData.qcQualityBillDetailList[i]
|
||||
.qualityStandardCode && _this.formData.qcQualityBillDetailList[
|
||||
i].qualityStandardCode != "") {
|
||||
//查询质检标准编码的id
|
||||
const res = _this.StandardList.find(item => item
|
||||
.qualityStandardCode == _this.formData
|
||||
.qcQualityBillDetailList[i].qualityStandardCode);
|
||||
if (res !== undefined) {
|
||||
_this.formData.qcQualityBillDetailList[i]
|
||||
.qualityStandardCode = res.id;
|
||||
} else {
|
||||
_this.$modal.msg("请填写正确的质检标准编码!");
|
||||
}
|
||||
} else {
|
||||
_this.formData.qcQualityBillDetailList[i].qualityStandardCode =
|
||||
null;
|
||||
}
|
||||
}
|
||||
_this.$modal.loading('提交中')
|
||||
console.log(_this.formData)
|
||||
updateQualityBill(_this.formData).then(async res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("检验成功!");
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
|
||||
</style>
|
||||
300
pages/qc/iqc.vue
Normal file
300
pages/qc/iqc.vue
Normal file
@@ -0,0 +1,300 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-collapse-item title="采购入库检单" :open="true">
|
||||
<uni-forms-item label="质检单" :labelWidth='90' name="qualityCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" @confirm="scanBarCode"
|
||||
v-model="formData.qualityCode" type="text" />
|
||||
</uni-forms-item>
|
||||
<!-- <uni-forms-item label="来源单" :labelWidth='90' name="sourceCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar1" @confirm="scanBarCode" v-model="formData.sourceCode" type="text" />
|
||||
</uni-forms-item> -->
|
||||
<uni-forms-item label="仓库编码" :labelWidth='90' name="warehouseCode">
|
||||
<uni-easyinput type="text" v-model="formData.warehouseCode" />
|
||||
</uni-forms-item>
|
||||
</uni-collapse-item>
|
||||
<uni-collapse-item title="采购入库检单明细" :open="true">
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item :rightOptions="rightOptions" :key="index"
|
||||
v-for="(item, index) in formData.qcQualityBillDetailList"
|
||||
@click="(data) => clickDetail(index,data)" @change="swipChange">
|
||||
<view>
|
||||
<uni-badge :text="index+1" class="uni-badge-left-margin" type="primary"></uni-badge>
|
||||
<button @click="open(index)" size="mini" type="primary">编辑</button>
|
||||
</view>
|
||||
<uni-forms-item label="物料编码" :labelWidth='80'
|
||||
:name="'qcQualityBillDetailList.'+ index +'.materialCode'">
|
||||
<uni-easyinput type="text" disabled v-model="item.materialCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="制程编码" :labelWidth='80'
|
||||
:name="'qcQualityBillDetailList.'+ index +'.opCode'">
|
||||
<uni-easyinput type="text" disabled v-model="item.opCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料批号" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.materialBatchNo'">
|
||||
<uni-easyinput disabled type="text" v-model="item.materialBatchNo" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料箱号" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.materialLotNo'">
|
||||
<uni-easyinput disabled type="text" v-model="item.materialLotNo" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检员" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'qualityBy'">
|
||||
<uni-easyinput disabled type="text" v-model="item.qualityBy" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检方案编码" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.qualityTypeCode'">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar3"
|
||||
v-model="item.qualityTypeCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检标准编码" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.qualityStandardCode'">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar4(index)"
|
||||
v-model="item.qualityStandardCode" />
|
||||
</uni-forms-item>
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="计划质检数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.planNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.planNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="实收数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.actualNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.actualNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.number'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.number"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检合格数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.passNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.passNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-forms-item label="质检不通过原因" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.failReason'">
|
||||
<uni-easyinput type="textarea" v-model="item.failReason" />
|
||||
</uni-forms-item>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listQualityBill,
|
||||
addQualityBill,
|
||||
getQualityBill,
|
||||
updateQualityBill,
|
||||
listQualityBillByBatchNo,
|
||||
getStandardList,
|
||||
listStandardList
|
||||
} from "@/api/qc/qc.js";
|
||||
export default {
|
||||
mounted() {
|
||||
listStandardList().then(async res => {
|
||||
this.StandardList = res.rows;
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
qualityCode: null,
|
||||
warehouseCode: null,
|
||||
qcQualityBillDetailList: [],
|
||||
},
|
||||
StandardList: null,
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
rules: {
|
||||
qualityCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入质检单!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
otherFun(object) {
|
||||
console.log(object)
|
||||
this.formData.qcQualityBillDetailList.find(item => item.id == object.did).number = object.number;
|
||||
this.formData.qcQualityBillDetailList.find(item => item.id == object.did).passNumber = object.passNumber;
|
||||
},
|
||||
open(index) {
|
||||
let qscid = null;
|
||||
if (this.formData.qcQualityBillDetailList[index].qualityStandardCode && this.formData
|
||||
.qcQualityBillDetailList[index].qualityStandardCode != "") {
|
||||
const result = this.StandardList.find(item => item.qualityStandardCode == this.formData
|
||||
.qcQualityBillDetailList[index].qualityStandardCode);
|
||||
if (result !== undefined) {
|
||||
// 找到了匹配项,进行后续逻辑
|
||||
qscid = result.id
|
||||
let did = this.formData.qcQualityBillDetailList[index].id;
|
||||
let mbn = this.formData.qcQualityBillDetailList[index].materialBatchNo;
|
||||
let mc = this.formData.qcQualityBillDetailList[index].materialCode;
|
||||
|
||||
console.log(qscid + ' ' + mbn + ' ' + mc);
|
||||
uni.navigateTo({
|
||||
url: '/pages/qc/updateStandardList?qscid=' + qscid +
|
||||
'&materialBatchNo=' + mbn +
|
||||
'&materialCode=' + mc +
|
||||
'&did=' + did
|
||||
});
|
||||
} else {
|
||||
console.log(result)
|
||||
this.$modal.msg("未检索到该质检标准编码相关信息!");
|
||||
}
|
||||
} else {
|
||||
this.$modal.msg("请输入质检标准编码!");
|
||||
}
|
||||
},
|
||||
test() {},
|
||||
change(e) {
|
||||
console.log('当前模式:' + e.type + ',状态:' + e.show);
|
||||
},
|
||||
scanBarCode() {
|
||||
if (this.formData.qualityCode && this.formData.qualityCode != "") {
|
||||
let q = {
|
||||
qualityCode: this.formData.qualityCode,
|
||||
}
|
||||
listQualityBill(q).then(async res => {
|
||||
console.log(res);
|
||||
if (res.rows != null && res.rows.length > 0) {
|
||||
let did = res.rows[0].id
|
||||
//查询质检单明细
|
||||
getQualityBill(did).then(async response => {
|
||||
this.formData = response.data;
|
||||
this.formData.qcQualityBillDetailList =
|
||||
response.data.qcQualityBillDetailList.map((item) => {
|
||||
item.qualityStandardCode = this.StandardList.find(i =>
|
||||
i.id == item.qualityStandardCode)
|
||||
.qualityStandardCode
|
||||
item.qualityTypeCode = Number(item.qualityTypeCode);
|
||||
return item;
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.$modal.msg("未检索到该质检单相关信息!");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$modal.msg("请输入质检单!");
|
||||
}
|
||||
},
|
||||
//质检单
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qualityCode = res.result;
|
||||
_this.scanBarCode(_this.formData.qualityCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//仓库编码
|
||||
scanBar2() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.warehouseCode = res.result;
|
||||
_this.scanBarCode(_this.formData.warehouseCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//质检方案编码
|
||||
scanBar3() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qcQualityBillDetailList[0].qualityTypeCode = res.result;
|
||||
_this.scanBarCode(_this.qcQualityBillDetailList[0].qualityTypeCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//质检标准编码
|
||||
scanBar4(index) {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qcQualityBillDetailList[index].qualityStandardCode = res.result;
|
||||
_this.scanBarCode(_this.qcQualityBillDetailList[index].qualityStandardCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
_this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定完成该质检吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
for (var i in _this.formData.qcQualityBillDetailList) {
|
||||
if (_this.formData.qcQualityBillDetailList[i]
|
||||
.qualityStandardCode && _this.formData.qcQualityBillDetailList[
|
||||
i].qualityStandardCode != "") {
|
||||
//查询质检标准编码的id
|
||||
const res = _this.StandardList.find(item => item
|
||||
.qualityStandardCode == _this.formData
|
||||
.qcQualityBillDetailList[i].qualityStandardCode);
|
||||
if (res !== undefined) {
|
||||
_this.formData.qcQualityBillDetailList[i]
|
||||
.qualityStandardCode = res.id;
|
||||
} else {
|
||||
_this.$modal.msg("请填写正确的质检标准编码!");
|
||||
}
|
||||
} else {
|
||||
_this.formData.qcQualityBillDetailList[i].qualityStandardCode =
|
||||
null;
|
||||
}
|
||||
}
|
||||
_this.$modal.loading('提交中')
|
||||
updateQualityBill(_this.formData).then(async res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("检验成功!");
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
|
||||
</style>
|
||||
227
pages/qc/opqc.vue
Normal file
227
pages/qc/opqc.vue
Normal file
@@ -0,0 +1,227 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData">
|
||||
<uni-forms-item label="作业编码" :labelWidth='90' name="sourceCode">
|
||||
<uni-easyinput v-model="formData.sourceCode" suffixIcon="scan" @iconClick="scanBarSourceCode"
|
||||
@confirm="submit" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="检验状态" :labelWidth='90' name="status">
|
||||
<u-radio-group v-model="formData.status" placement="row">
|
||||
<u-radio v-for="(item, index) in statusOptions" :key="index" :label="item.text"
|
||||
:name="item.value">
|
||||
</u-radio>
|
||||
</u-radio-group>
|
||||
</uni-forms-item>
|
||||
<u-button type="primary" @click="submit">查询</u-button>
|
||||
<uni-collapse-item title="查询结果" :open="true">
|
||||
<uni-card :is-shadow="false" v-for="(item,index) in qcList" :key="index" is-full>
|
||||
<view><strong>制程</strong> : {{item.opTitle}}</view>
|
||||
<view><strong>物料编码</strong> : {{item.ptNoTar}}</view>
|
||||
<view><strong>物料名称</strong> : {{item.ptTitleTar}}</view>
|
||||
<view><strong>质检结果</strong> : {{item.result}}</view>
|
||||
<uni-row>
|
||||
<uni-col :span="18">
|
||||
<view><strong>物料规格</strong> : {{item.specification1}}</view>
|
||||
<view><strong>报工数量</strong> : {{item.reportNumber}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="6">
|
||||
<u-button type="primary" @click="badRecordList(item)" style="font-size: 14px;"
|
||||
v-if="item.isRecord">不良记录</u-button>
|
||||
<u-button type="primary" @click="badRecordForm(item)"
|
||||
style="font-size: 14px;margin-top: 10px;" v-else>不良记录新增</u-button>
|
||||
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row>
|
||||
<uni-col :span="18">
|
||||
<view><strong>加工人员</strong> : {{item.createByName}}</view>
|
||||
<view><strong>报工时间</strong> :{{item.reportcreateTime}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="6"> <u-button type="success" @click="handleFinish(item)"
|
||||
style="font-size: 14px;margin-top: 10px;">通过</u-button></uni-col>
|
||||
</uni-row>
|
||||
</uni-card>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
import {
|
||||
listQualityBill,
|
||||
addQualityBill,
|
||||
getQualityBill,
|
||||
updateQualityBill,
|
||||
listQualityBillByBatchNo,
|
||||
getStandardList,
|
||||
listStandardList
|
||||
} from "@/api/qc/qc.js";
|
||||
import {
|
||||
listPwoJob,
|
||||
addReport,
|
||||
getEquipment,
|
||||
addReportEnterPiece,
|
||||
listEquipment
|
||||
} from "@/api/mes/jobReport.js";
|
||||
import {
|
||||
listMesPwoRecordrecord,
|
||||
getMesPwoRecordrecord,
|
||||
delMesPwoRecordrecord,
|
||||
addMesPwoRecordrecord,
|
||||
updateMesPwoRecordrecord
|
||||
} from "@/api/mes/mesPwoRecordrecord";
|
||||
import {
|
||||
listMesPwoRecordDetail,
|
||||
getMesPwoRecordDetail,
|
||||
delMesPwoRecordDetail,
|
||||
addMesPwoRecordDetail,
|
||||
updateMesPwoRecordDetail,
|
||||
} from "@/api/mes/mesPwoRecordDetail";
|
||||
export default {
|
||||
mounted() {
|
||||
getDicts("qc_bill_status").then(res => {
|
||||
this.statusOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
getDicts("qc_bill_result").then(res => {
|
||||
this.resultOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
listMesPwoRecordrecord().then(resp => {
|
||||
this.recordList = resp.rows
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
recordList: [],
|
||||
statusOptions: [],
|
||||
resultOptions: [],
|
||||
qcList: [],
|
||||
formData: {
|
||||
sourceCode: null,
|
||||
status: "0",
|
||||
type: 3
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
badRecordList(item) {
|
||||
listMesPwoRecordrecord({
|
||||
relOrderCode: item.qualityCode
|
||||
}).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
listMesPwoRecordDetail({
|
||||
pwoRecordId: res.rows[0].id
|
||||
}).then(response => {
|
||||
console.log(response)
|
||||
let mesPwoRecordDetailList = response.rows.map((obj) => {
|
||||
obj.dataInfo = JSON.parse(obj.dataInfo);
|
||||
return obj;
|
||||
});
|
||||
console.log(mesPwoRecordDetailList)
|
||||
let obj = {
|
||||
pwoRecordName: res.rows[0].pwoRecordName,
|
||||
pwoRecordCode: res.rows[0].pwoRecordCode,
|
||||
mesPwoRecordDetailList: mesPwoRecordDetailList
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/mes/pwoRecord/badRecordList?formData=' +
|
||||
encodeURIComponent(
|
||||
JSON.stringify(obj))
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.$modal.msg("未查询到记录单相关信息!")
|
||||
}
|
||||
})
|
||||
},
|
||||
badRecordForm(item) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/mes/pwoRecord/badRecord?reportForm=' +
|
||||
encodeURIComponent(
|
||||
JSON.stringify(item))
|
||||
});
|
||||
},
|
||||
scanBarSourceCode(code) {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.sourceCode = res.result;
|
||||
_this.submit()
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
listQualityBill(this.formData).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
res.rows.map(item => {
|
||||
let obj = this.recordList.find(r => r.relOrderCode == item.qualityCode)
|
||||
if (obj) {
|
||||
item.isRecord = true
|
||||
} else {
|
||||
item.isRecord = false
|
||||
}
|
||||
item.additionalJson = JSON.parse(item.additionalJson);
|
||||
item.ptNoTar = item.additionalJson.ptNoTar;
|
||||
item.opTitle = item.additionalJson.opTitle;
|
||||
item.ptTitleTar = item.additionalJson.ptTitleTar;
|
||||
item.specification1 = item.additionalJson.specification1;
|
||||
item.reportNumber = item.additionalJson.reportNumber;
|
||||
item.createByName = item.additionalJson.createByName;
|
||||
item.reportcreateTime = item.additionalJson.createTime;
|
||||
item.pwoCode = item.additionalJson.pwoCode;
|
||||
item.pwoJobCode = item.additionalJson.pwoJobCode;
|
||||
item.reportId = item.additionalJson.id;
|
||||
item.eqpCode = item.additionalJson.machineId;
|
||||
item.opCode = item.additionalJson.opCode;
|
||||
return item
|
||||
})
|
||||
console.log(res.rows)
|
||||
this.qcList = res.rows;
|
||||
console.log(this.qcList)
|
||||
} else {
|
||||
this.$modal.msg("未查询到相关信息,请重新输入!")
|
||||
this.formData.sourceCode = null;
|
||||
}
|
||||
})
|
||||
},
|
||||
handleFinish(item) {
|
||||
let obj = this.resultOptions.find(i => i.text == '通过')
|
||||
if (obj) {
|
||||
item.additionalJson = JSON.stringify(item.additionalJson)
|
||||
item.result = obj.value
|
||||
getQualityBill(item.id).then(res => {
|
||||
item.qcQualityBillDetailList = res.data.qcQualityBillDetailList
|
||||
updateQualityBill(item).then(res => {
|
||||
this.$modal.msgSuccess("修改成功!");
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.text {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
300
pages/qc/oqc.vue
Normal file
300
pages/qc/oqc.vue
Normal file
@@ -0,0 +1,300 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-collapse-item title="销售出库检单" :open="true">
|
||||
<uni-forms-item label="质检单" :labelWidth='90' name="qualityCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" @confirm="scanBarCode"
|
||||
v-model="formData.qualityCode" type="text" />
|
||||
</uni-forms-item>
|
||||
<!-- <uni-forms-item label="来源单" :labelWidth='90' name="sourceCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar1" @confirm="scanBarCode" v-model="formData.sourceCode" type="text" />
|
||||
</uni-forms-item> -->
|
||||
<uni-forms-item label="仓库编码" :labelWidth='90' name="warehouseCode">
|
||||
<uni-easyinput type="text" v-model="formData.warehouseCode" />
|
||||
</uni-forms-item>
|
||||
</uni-collapse-item>
|
||||
<uni-collapse-item title="销售出库检单明细" :open="true">
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item :rightOptions="rightOptions" :key="index"
|
||||
v-for="(item, index) in formData.qcQualityBillDetailList"
|
||||
@click="(data) => clickDetail(index,data)" @change="swipChange">
|
||||
<view>
|
||||
<uni-badge :text="index+1" class="uni-badge-left-margin" type="primary"></uni-badge>
|
||||
<button @click="open(index)" size="mini" type="primary">编辑</button>
|
||||
</view>
|
||||
<uni-forms-item label="物料编码" :labelWidth='80'
|
||||
:name="'qcQualityBillDetailList.'+ index +'.materialCode'">
|
||||
<uni-easyinput type="text" disabled v-model="item.materialCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="制程编码" :labelWidth='80'
|
||||
:name="'qcQualityBillDetailList.'+ index +'.opCode'">
|
||||
<uni-easyinput type="text" disabled v-model="item.opCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料批号" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.materialBatchNo'">
|
||||
<uni-easyinput disabled type="text" v-model="item.materialBatchNo" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料箱号" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.materialLotNo'">
|
||||
<uni-easyinput disabled type="text" v-model="item.materialLotNo" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检员" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'qualityBy'">
|
||||
<uni-easyinput disabled type="text" v-model="item.qualityBy" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检方案编码" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.qualityTypeCode'">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar3"
|
||||
v-model="item.qualityTypeCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检标准编码" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.qualityStandardCode'">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar4(index)"
|
||||
v-model="item.qualityStandardCode" />
|
||||
</uni-forms-item>
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="计划质检数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.planNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.planNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="实收数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.actualNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.actualNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.number'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.number"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检合格数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.passNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.passNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-forms-item label="质检不通过原因" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.failReason'">
|
||||
<uni-easyinput type="textarea" v-model="item.failReason" />
|
||||
</uni-forms-item>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listQualityBill,
|
||||
addQualityBill,
|
||||
getQualityBill,
|
||||
updateQualityBill,
|
||||
listQualityBillByBatchNo,
|
||||
getStandardList,
|
||||
listStandardList
|
||||
} from "@/api/qc/qc.js";
|
||||
export default {
|
||||
mounted() {
|
||||
listStandardList().then(async res => {
|
||||
this.StandardList = res.rows;
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
qualityCode: null,
|
||||
warehouseCode: null,
|
||||
qcQualityBillDetailList: [],
|
||||
},
|
||||
StandardList: null,
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
rules: {
|
||||
qualityCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入质检单!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
otherFun(object) {
|
||||
console.log(object)
|
||||
this.formData.qcQualityBillDetailList.find(item => item.id == object.did).number = object.number;
|
||||
this.formData.qcQualityBillDetailList.find(item => item.id == object.did).passNumber = object.passNumber;
|
||||
},
|
||||
open(index) {
|
||||
let qscid = null;
|
||||
if (this.formData.qcQualityBillDetailList[index].qualityStandardCode && this.formData
|
||||
.qcQualityBillDetailList[index].qualityStandardCode != "") {
|
||||
const result = this.StandardList.find(item => item.qualityStandardCode == this.formData
|
||||
.qcQualityBillDetailList[index].qualityStandardCode);
|
||||
if (result !== undefined) {
|
||||
// 找到了匹配项,进行后续逻辑
|
||||
qscid = result.id
|
||||
let did = this.formData.qcQualityBillDetailList[index].id;
|
||||
let mbn = this.formData.qcQualityBillDetailList[index].materialBatchNo;
|
||||
let mc = this.formData.qcQualityBillDetailList[index].materialCode;
|
||||
|
||||
console.log(qscid + ' ' + mbn + ' ' + mc);
|
||||
uni.navigateTo({
|
||||
url: '/pages/qc/updateStandardList?qscid=' + qscid +
|
||||
'&materialBatchNo=' + mbn +
|
||||
'&materialCode=' + mc +
|
||||
'&did=' + did
|
||||
});
|
||||
} else {
|
||||
console.log(result)
|
||||
this.$modal.msg("未检索到该质检标准编码相关信息!");
|
||||
}
|
||||
} else {
|
||||
this.$modal.msg("请输入质检标准编码!");
|
||||
}
|
||||
},
|
||||
test() {},
|
||||
change(e) {
|
||||
console.log('当前模式:' + e.type + ',状态:' + e.show);
|
||||
},
|
||||
scanBarCode() {
|
||||
if (this.formData.qualityCode && this.formData.qualityCode != "") {
|
||||
let q = {
|
||||
qualityCode: this.formData.qualityCode
|
||||
}
|
||||
listQualityBill(q).then(async res => {
|
||||
console.log(res);
|
||||
if (res.rows != null && res.rows.length > 0) {
|
||||
let did = res.rows[0].id
|
||||
//查询质检单明细
|
||||
getQualityBill(did).then(async response => {
|
||||
this.formData = response.data;
|
||||
this.formData.qcQualityBillDetailList =
|
||||
response.data.qcQualityBillDetailList.map((item) => {
|
||||
item.qualityStandardCode = this.StandardList.find(i =>
|
||||
i.id == item.qualityStandardCode)
|
||||
.qualityStandardCode
|
||||
item.qualityTypeCode = Number(item.qualityTypeCode);
|
||||
return item;
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.$modal.msg("未检索到该质检单相关信息!");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$modal.msg("请输入质检单!");
|
||||
}
|
||||
},
|
||||
//质检单
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qualityCode = res.result;
|
||||
_this.scanBarCode(_this.formData.qualityCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//仓库编码
|
||||
scanBar2() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.warehouseCode = res.result;
|
||||
_this.scanBarCode(_this.formData.warehouseCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//质检方案编码
|
||||
scanBar3() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qcQualityBillDetailList[0].qualityTypeCode = res.result;
|
||||
_this.scanBarCode(_this.qcQualityBillDetailList[0].qualityTypeCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//质检标准编码
|
||||
scanBar4(index) {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qcQualityBillDetailList[index].qualityStandardCode = res.result;
|
||||
_this.scanBarCode(_this.qcQualityBillDetailList[index].qualityStandardCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
_this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定完成该质检吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
for (var i in _this.formData.qcQualityBillDetailList) {
|
||||
if (_this.formData.qcQualityBillDetailList[i]
|
||||
.qualityStandardCode && _this.formData.qcQualityBillDetailList[
|
||||
i].qualityStandardCode != "") {
|
||||
//查询质检标准编码的id
|
||||
const res = _this.StandardList.find(item => item
|
||||
.qualityStandardCode == _this.formData
|
||||
.qcQualityBillDetailList[i].qualityStandardCode);
|
||||
if (res !== undefined) {
|
||||
_this.formData.qcQualityBillDetailList[i]
|
||||
.qualityStandardCode = res.id;
|
||||
} else {
|
||||
_this.$modal.msg("请填写正确的质检标准编码!");
|
||||
}
|
||||
} else {
|
||||
_this.formData.qcQualityBillDetailList[i].qualityStandardCode =
|
||||
null;
|
||||
}
|
||||
}
|
||||
_this.$modal.loading('提交中')
|
||||
updateQualityBill(_this.formData).then(async res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("检验成功!");
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
|
||||
</style>
|
||||
338
pages/qc/qcAdd.vue
Normal file
338
pages/qc/qcAdd.vue
Normal file
@@ -0,0 +1,338 @@
|
||||
<template>
|
||||
<view style="background-color: #fff;">
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="作业编码" :labelWidth='80' name="sourceCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" type="text" v-model="formData.sourceCode"
|
||||
@confirm="scanBarCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<!-- <uni-col :span="24">
|
||||
<uni-forms-item label="工单" :labelWidth='80' name="pwoCode">
|
||||
<uni-easyinput disabled type="text" v-model="formData.pwoCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col> -->
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="物料编码" :labelWidth='80' name="materialCode">
|
||||
<uni-easyinput disabled type="text" v-model="formData.qcQualityBillDetailList.materialCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="物料名称" :labelWidth='80' name="materialName">
|
||||
<uni-easyinput disabled type="text" v-model="formData.qcQualityBillDetailList.materialName" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="制程编码" :labelWidth='80' name="opCode">
|
||||
<uni-easyinput type="text" v-model="formData.qcQualityBillDetailList.opCode" />
|
||||
<uni-data-select v-model="formData.qcQualityBillDetailList.opCode" :localdata="pPbomOptions" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检类型" :labelWidth='80' name="type">
|
||||
<uni-data-select v-model="formData.type" :localdata="typeOptions" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检标准" :labelWidth='80' name="qualityStandardCode">
|
||||
<uni-data-select v-model="formData.qcQualityBillDetailList.qualityStandardCode"
|
||||
:localdata="standardOptions" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="实收数量" :labelWidth='80' name="actualNumber">
|
||||
<uni-easyinput type="number" v-model="formData.qcQualityBillDetailList.actualNumber" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="质检数量" :labelWidth='80' name="number">
|
||||
<uni-easyinput type="number" v-model="formData.qcQualityBillDetailList.number" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="" :labelWidth='80'>
|
||||
<uni-data-checkbox v-model="radio" multiple :localdata="qcchecked" @change="qcAllCheck"
|
||||
style="transform:scale(1.4);"></uni-data-checkbox>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检员" :labelWidth='90' name="qualityBy">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarQualityBy" @confirm="confirmQualityBy"
|
||||
v-model="formData.qualityBy" type="text" style="margin-bottom: 5px;" />
|
||||
<uni-data-select v-model="formData.qualityBy" :localdata="empList" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listQualityBill,
|
||||
addQualityBill,
|
||||
getQualityBill,
|
||||
updateQualityBill,
|
||||
listQualityBillByBatchNo,
|
||||
getStandardList,
|
||||
listStandardList,
|
||||
listStandardApply
|
||||
} from "@/api/qc/qc.js";
|
||||
import {
|
||||
listPwoJob
|
||||
} from "@/api/mes/jobReport.js"
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
import {
|
||||
listPbom
|
||||
} from "@/api/qc/ppom";
|
||||
import {
|
||||
listEmployee
|
||||
} from "@/api/mes/jobIn";
|
||||
export default {
|
||||
mounted() {
|
||||
getDicts("qc_bill_type").then(res => {
|
||||
this.typeOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
listEmployee().then((res) => {
|
||||
this.empList = res.rows.map(item => {
|
||||
return {
|
||||
text: item.empCode + ':' + item.name,
|
||||
value: item.empCode,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
empList: [],
|
||||
radio: [],
|
||||
qcchecked: [{
|
||||
text: '全选',
|
||||
value: 0
|
||||
}],
|
||||
typeOptions: [],
|
||||
pPbomOptions: [],
|
||||
standardOptions: [],
|
||||
formData: {
|
||||
qcQualityBillDetailList: {
|
||||
qualityBy: null,
|
||||
materialCode: null,
|
||||
materialName: null,
|
||||
qualityStandardCode: null,
|
||||
opCode: null,
|
||||
actualNumber: null,
|
||||
number: null,
|
||||
},
|
||||
type: null,
|
||||
pwoCode: null,
|
||||
sourceCode: null,
|
||||
qualityBy: null
|
||||
},
|
||||
rules: {
|
||||
pwoJobCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入作业编码!'
|
||||
}]
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'formData.qcQualityBillDetailList.materialCode': {
|
||||
handler: function(newVal, oldVal) {
|
||||
if (newVal != null) {
|
||||
this.selectStandardOptions();
|
||||
}
|
||||
}
|
||||
},
|
||||
'formData.qcQualityBillDetailList.opCode': {
|
||||
handler: function(newVal, oldVal) {
|
||||
if (newVal != null) {
|
||||
this.selectStandardOptions();
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
'formData.type': {
|
||||
handler: function(newVal, oldVal) {
|
||||
if (newVal != null) {
|
||||
this.selectStandardOptions();
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
scanBarQualityBy() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qualityBy = res.result;
|
||||
_this.formData.qcQualityBillDetailList.qualityBy = res.result;
|
||||
_this.confirmQualityBy()
|
||||
}
|
||||
});
|
||||
},
|
||||
confirmQualityBy() {
|
||||
listEmployee({
|
||||
empCode: this.formData.qualityBy
|
||||
}).then(async res => {
|
||||
if (res.rows.length == 0) {
|
||||
this.$modal.msg("未查询到该人员,请重新输入!")
|
||||
this.formData.qualityBy = null;
|
||||
this.formData.qcQualityBillDetailList.qualityBy = null;
|
||||
}
|
||||
})
|
||||
},
|
||||
qcAllCheck(e) {
|
||||
if (e.detail.data.length > 0) {
|
||||
this.formData.qcQualityBillDetailList.number = this.formData.qcQualityBillDetailList
|
||||
.actualNumber
|
||||
} else {
|
||||
this.formData.qcQualityBillDetailList.number = null;
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
this.$refs.form.validate().then(res => {
|
||||
this.formData.qcQualityBillDetailList.qualityBy = this.formData.qualityBy
|
||||
this.formData.qcQualityBillDetailList = [this.formData.qcQualityBillDetailList]
|
||||
if (this.formData && this.formData.qcQualityBillDetailList.length > 0) {
|
||||
//默认新建质检单结果为通过,状态为新建
|
||||
this.formData.status = '0'
|
||||
// this.qcform.result = '1'
|
||||
console.log(this.formData)
|
||||
this.$modal.loading('提交中')
|
||||
addQualityBill(this.formData).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("创建成功!");
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
} else {
|
||||
this.$message.error("请输入明细!");
|
||||
}
|
||||
})
|
||||
},
|
||||
scanBarCode() {
|
||||
if (this.formData.sourceCode) {
|
||||
listPwoJob({
|
||||
code: this.formData.sourceCode
|
||||
}).then(async res => {
|
||||
let jobs = res.rows;
|
||||
if (jobs.length == 0) {
|
||||
this.$modal.msg("未检索到该作业编码相关的信息!");
|
||||
} else {
|
||||
let pwoJob = jobs[0];
|
||||
// 根据物料编码找制程
|
||||
this.selectMaterial(pwoJob.ptNoTar);
|
||||
// 添加明细
|
||||
this.formData.qcQualityBillDetailList.materialCode = pwoJob.ptNoTar;
|
||||
this.formData.qcQualityBillDetailList.materialName = pwoJob.ptTitleTar;
|
||||
this.formData.qcQualityBillDetailList.materialBatchNo = pwoJob.batchNo;
|
||||
this.formData.qcQualityBillDetailList.materialLotNo = pwoJob.lotNo;
|
||||
this.formData.qcQualityBillDetailList.opCode = pwoJob.opCode;
|
||||
this.formData.qcQualityBillDetailList.planNumber = pwoJob.targetNum;
|
||||
this.formData.qcQualityBillDetailList.qualityTypeCode = "";
|
||||
this.formData.qcQualityBillDetailList.qualityBy = "";
|
||||
this.formData.qcQualityBillDetailList.qualityStandardCode = "";
|
||||
this.formData.qcQualityBillDetailList.planNumber = 0;
|
||||
this.formData.qcQualityBillDetailList.actualNumber = pwoJob.targetNum;
|
||||
this.formData.qcQualityBillDetailList.number = 0;
|
||||
this.formData.qcQualityBillDetailList.unitId = "";
|
||||
this.formData.qcQualityBillDetailList.secondActualNumber = "";
|
||||
this.formData.qcQualityBillDetailList.secondNumber = "";
|
||||
this.formData.qcQualityBillDetailList.secondUnit = "";
|
||||
this.formData.qcQualityBillDetailList.passNumber = 0;
|
||||
this.formData.qcQualityBillDetailList.passUnit = "";
|
||||
this.formData.qcQualityBillDetailList.secondPassNumber = "";
|
||||
this.formData.qcQualityBillDetailList.secondPassUnit = "";
|
||||
this.formData.qcQualityBillDetailList.failReason = "";
|
||||
this.formData.qcQualityBillDetailList.enclosure = "";
|
||||
this.formData.qcQualityBillDetailList.remark = "";
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
selectMaterial(materialCode) {
|
||||
let ppbom = {};
|
||||
ppbom.concatPnCode = materialCode;
|
||||
ppbom.filterSearch = true;
|
||||
if (ppbom.concatPnCode != "" && ppbom.concatPnCode) {
|
||||
listPbom(ppbom).then((response) => {
|
||||
|
||||
this.pPbomOptions = response.rows.map(item => {
|
||||
item.text = item.opCode + ":" + item.opTitle;
|
||||
item.value = item.opCode;
|
||||
return item
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
selectStandardOptions() {
|
||||
let materialCode = this.formData.qcQualityBillDetailList.materialCode;
|
||||
let opCode = this.formData.qcQualityBillDetailList.opCode;
|
||||
let type = this.formData.type;
|
||||
let standardOptions = [];
|
||||
if (materialCode != "" && materialCode && opCode != "" && opCode && type != "" && type) {
|
||||
listStandardList().then((res) => {
|
||||
standardOptions = res.rows;
|
||||
});
|
||||
let mt = null;
|
||||
if (materialCode.includes('@')) {
|
||||
mt = materialCode.split('@')[0];
|
||||
}
|
||||
listStandardApply({
|
||||
materialCode: mt,
|
||||
opCode: opCode,
|
||||
billType: type
|
||||
}).then((response) => {
|
||||
console.log(response)
|
||||
if (response.total > 0) {
|
||||
let array = response.rows.map(item => ({
|
||||
id: item.qualityStandardId
|
||||
}))
|
||||
array.forEach(aitem => {
|
||||
standardOptions.forEach(sitem => {
|
||||
if (sitem.id == aitem.id) {
|
||||
sitem.text = sitem.qualityStandardCode +
|
||||
":" + sitem.qualityStandardName;
|
||||
sitem.value = sitem.qualityStandardCode;
|
||||
this.standardOptions.push(sitem)
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
console.log(this.standardOptions)
|
||||
}
|
||||
// this.pPbomOptions = response.rows;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.sourceCode = res.result;
|
||||
_this.scanBarCode(_this.formData.sourceCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
551
pages/qc/updateStandardList.vue
Normal file
551
pages/qc/updateStandardList.vue
Normal file
@@ -0,0 +1,551 @@
|
||||
<template>
|
||||
|
||||
<view>
|
||||
<button type="primary" size="mini" @click="add">添加</button>
|
||||
<uni-row>
|
||||
<uni-col :span="12">
|
||||
<view style="margin-bottom: 10px;">物料编码 <input v-model="mc" /> </view>
|
||||
<view style="margin-bottom: 10px;">物料批号 <input v-model="materialBatchNo" /></view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view style="margin-bottom: 10px;">物料名称 <input v-model="materialName" /> </view>
|
||||
<view style="margin-bottom: 10px;">规格 <input v-model="specification1" /></view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<view style="background-color: #fff;">
|
||||
<uni-table ref="table" :loading="loading" border stripe emptyText="暂无更多数据" style="padding-bottom: 18vh;">
|
||||
<uni-tr>
|
||||
<uni-th width="50" align="center">序号</uni-th>
|
||||
<uni-th width="50" align="center">质检标准项/单位</uni-th>
|
||||
<uni-th width="50" align="center">质检实际检测值</uni-th>
|
||||
<uni-th width="50" align="center">是否合格</uni-th>
|
||||
<uni-th width="50" align="center">图片上传</uni-th>
|
||||
</uni-tr>
|
||||
<uni-tr v-for="(item, index) in dataslice(tableData,historyCurPage)" :key="index">
|
||||
<uni-td>{{ item.seq }}</uni-td>
|
||||
<uni-td>{{ item.qualityStandardItem }}/{{ item.qualityStandardUnit }}</uni-td>
|
||||
<uni-td>
|
||||
<uni-easyinput @change="count(index)" type="text" v-model="item.qualityActualValue" />
|
||||
</uni-td>
|
||||
<uni-td>
|
||||
<uni-data-select v-model="item.isQuality" :localdata="range"></uni-data-select>
|
||||
</uni-td>
|
||||
<uni-td align="center">
|
||||
<!-- <uni-file-picker :value="item.qcImages" @select @success="success" :listStyles="listStyles"
|
||||
limit="3"></uni-file-picker> -->
|
||||
<u-upload :fileList="item.qcImages" @afterRead="afterRead(index, $event)"
|
||||
@delete="deletePic(index, $event)" name="1" multiple :maxCount="5"></u-upload>
|
||||
<!-- <view class="addrpage_text" style="">
|
||||
<view class="addrimg">
|
||||
<view class="upimg">
|
||||
<view class="uni-uploader__files">
|
||||
<view v-for="(image, index1) in item.qcImages" :key="index1">
|
||||
<view class="uni-uploader__file">
|
||||
<view class="delete" @tap="onDeleteClick(index,index1)">
|
||||
<text>✖️</text>
|
||||
</view>
|
||||
<image class="uni-uploader__img" @tap.stop="lookimgbut(index,image)"
|
||||
:src="image"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="upload" @tap="onGetImgClick(index)" style="">
|
||||
<uni-icons custom-prefix="iconfont" type="icon-jiahao"
|
||||
style="color: #C6C6C6;margin-top:30rpx;" size="40"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</uni-td>
|
||||
</uni-tr>
|
||||
|
||||
</uni-table>
|
||||
<view style="position: fixed;bottom: 0;background-color: #fff;width: 100%;padding: 10px 0;">
|
||||
<uni-pagination :total="historyTotal" :pageSize="historyPageSize" @change="changePage" title="标题文字" />
|
||||
<view style="margin: 10px 0 10px 0;text-align: center;">
|
||||
<text
|
||||
class="example-info">当前页:{{ historyCurPage }},数据总量:{{ historyTotal }}条,每页数据:{{ historyPageSize }}</text>
|
||||
</view>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
uploadImage,
|
||||
getStandardList,
|
||||
addQualityHistoryList,
|
||||
listQualityHistory,
|
||||
updateQualityHistory
|
||||
} from "@/api/qc/qc.js";
|
||||
// var did;
|
||||
// var list = null;
|
||||
// var qscid = null;
|
||||
export default {
|
||||
onLoad: function(option) { //option为object类型,会序列化上个页面传递的参数
|
||||
console.log(option);
|
||||
this.materialBatchNo = option.materialBatchNo;
|
||||
this.materialCode = option.materialCode;
|
||||
this.materialName = option.materialName;
|
||||
this.specification1 = option.specification1;
|
||||
this.qscid = Number(option.qscid);
|
||||
this.number = option.number;
|
||||
this.billId = option.billId;
|
||||
this.did = option.did;
|
||||
this.mc = this.materialCode.replace(/\"/g, "");
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
qualityStandardDetailOptions: [],
|
||||
queryDetailParams: {},
|
||||
fileList1: [],
|
||||
qscid: null,
|
||||
did: null,
|
||||
qualityStandardCode: null,
|
||||
materialBatchNo: null,
|
||||
materialCode: null,
|
||||
specification1: null,
|
||||
materialName: '',
|
||||
mc: null,
|
||||
number: null,
|
||||
tableData: [],
|
||||
qualityActualValue: null,
|
||||
loading: false,
|
||||
historyCurPage: 1,
|
||||
historyTotal: 0,
|
||||
historyPageSize: 1,
|
||||
range: [{
|
||||
value: 0,
|
||||
text: "不合格"
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
text: "合格"
|
||||
},
|
||||
],
|
||||
listStyles: {
|
||||
// 是否显示边框
|
||||
border: true,
|
||||
// 是否显示分隔线
|
||||
dividline: true,
|
||||
// 线条样式
|
||||
borderStyle: {
|
||||
width: 1,
|
||||
color: 'blue',
|
||||
style: 'dashed',
|
||||
radius: 2
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
dataslice(array, historyCurPage) {
|
||||
const newdata = array.filter((item) => {
|
||||
return item.seq == historyCurPage;
|
||||
});
|
||||
return newdata;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.first();
|
||||
},
|
||||
methods: {
|
||||
changePage(e) {
|
||||
console.log(e)
|
||||
this.historyCurPage = e.current
|
||||
},
|
||||
dataslice(array, historyCurPage) {
|
||||
const newdata = array.filter((item) => {
|
||||
return item.seq == historyCurPage;
|
||||
});
|
||||
return newdata;
|
||||
},
|
||||
// 删除图片
|
||||
deletePic(index, event) {
|
||||
this.tableData[index].qcImages.splice(event.index, 1)
|
||||
},
|
||||
// 新增图片
|
||||
async afterRead(index, event) {
|
||||
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
let lists = [].concat(event.file)
|
||||
console.log(this.tableData[index].qcImages)
|
||||
let fileListLen = this.tableData[index].qcImages.length
|
||||
lists.map((item) => {
|
||||
this.tableData[index].qcImages.push({
|
||||
...item,
|
||||
status: 'uploading',
|
||||
message: '上传中'
|
||||
})
|
||||
})
|
||||
for (let i = 0; i < lists.length; i++) {
|
||||
console.log(1)
|
||||
const result = await this.uploadFilePromise(lists[i].url)
|
||||
let item = this.tableData[index].qcImages[fileListLen]
|
||||
// console.log(item)
|
||||
this.tableData[index].qcImages.splice(fileListLen, 1, Object.assign(item, {
|
||||
status: 'success',
|
||||
message: '',
|
||||
url: result
|
||||
}))
|
||||
fileListLen++
|
||||
}
|
||||
},
|
||||
uploadFilePromise(url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let a = uploadImage({
|
||||
filePath: url
|
||||
}).then(response => {
|
||||
uni.showToast({
|
||||
title: "上传成功",
|
||||
icon: 'success'
|
||||
});
|
||||
console.log(response)
|
||||
resolve(response.fileName)
|
||||
});
|
||||
})
|
||||
},
|
||||
// 获取上传状态
|
||||
select(e) {
|
||||
console.log('选择文件:', e)
|
||||
},
|
||||
// 获取上传进度
|
||||
progress(e) {
|
||||
console.log('上传进度:', e)
|
||||
},
|
||||
|
||||
// 上传成功
|
||||
success(e) {
|
||||
|
||||
console.log(e)
|
||||
},
|
||||
|
||||
// 上传失败
|
||||
fail(e) {
|
||||
console.log('上传失败:', e)
|
||||
},
|
||||
onGetImgClick(index) {
|
||||
const _this = this
|
||||
console.log(index);
|
||||
console.log(_this.tableData[index].qcImages);
|
||||
uni.chooseImage({
|
||||
count: 5, // 最多可以选择的图片张数,默认9
|
||||
sizeType: ['original', 'compressed'], //original 原图,compressed 压缩图,默认二者都有
|
||||
sourceType: ['album', 'camera'], //album 从相册选图,camera 使用相机,默认二者都有。如需直接开相机或直接选相册,请只使用一个选项
|
||||
success: function(res) {
|
||||
console.log(JSON.stringify(res.tempFilePaths));
|
||||
|
||||
for (let i = 0; i < res.tempFilePaths.length; i++) {
|
||||
let a = res.tempFilePaths[i];
|
||||
let data = {
|
||||
filePath: res.tempFilePaths[i]
|
||||
}
|
||||
uploadImage(data).then(response => {
|
||||
uni.showToast({
|
||||
title: "上传成功",
|
||||
icon: 'success'
|
||||
});
|
||||
_this.tableData[index].qcImages.push(response.url);
|
||||
});
|
||||
}
|
||||
|
||||
// if(_this.tableData[index].qcImages!=null){
|
||||
// const len = _this.tableData[index].qcImages.length;
|
||||
// console.log(len);
|
||||
// for (let i = 0; i < 5 - len; i++) {
|
||||
// if (res.tempFilePaths[i]) _this.tableData[index].qcImages.push(res.tempFilePaths[i])
|
||||
// }
|
||||
// }else{
|
||||
// for (let i = 0; i < 5; i++) {
|
||||
// if (res.tempFilePaths[i]) _this.tableData[index].qcImages.push(res.tempFilePaths[i])
|
||||
// }
|
||||
// }
|
||||
}
|
||||
})
|
||||
},
|
||||
//删除功能
|
||||
onDeleteClick(index, index1) {
|
||||
const _this = this
|
||||
console.log(index + ' ' + index1 + ' ' + _this.tableData[index].qcImages);
|
||||
|
||||
_this.tableData[index].qcImages.splice(index1, 1);
|
||||
},
|
||||
// 预览功能
|
||||
lookimgbut(index, image) {
|
||||
uni.previewImage({
|
||||
urls: this.tableData[index].qcImages,
|
||||
current: image,
|
||||
loop: false //是否可循环预览,默认值为 false,有需要的可以设置为true
|
||||
})
|
||||
},
|
||||
//先执行,查看已添加的质检序列
|
||||
first() {
|
||||
// this.materialBatchNo = row.materialBatchNo;
|
||||
// this.materialCode = row.materialCode;
|
||||
// this.materialLotNo = row.materialLotNo;
|
||||
// this.qualityStandardId = row.qualityStandardCode;
|
||||
// this.qualityBillId = this.form.id;
|
||||
// this.qualityBillDetailId = row.id;
|
||||
|
||||
this.queryDetailParams.batchNo = this.materialBatchNo;
|
||||
this.queryDetailParams.materialCode = this.materialCode;
|
||||
this.queryDetailParams.qualityBillId = this.billId;
|
||||
this.queryDetailParams.qualityStandardId = this.qscid;
|
||||
this.queryDetailParams.qualityBillDetailId = this.did;
|
||||
|
||||
// getStandardList(this.qualityStandardId).then((response) => {
|
||||
// this.qualityStandardDetailOptions =
|
||||
// response.data.qcQualtyStandardListDetailList;
|
||||
// });
|
||||
this.tableData = [];
|
||||
getStandardList(this.qscid).then((response) => {
|
||||
this.qualityStandardDetailOptions =
|
||||
response.data.qcQualtyStandardListDetailList;
|
||||
});
|
||||
listQualityHistory(this.queryDetailParams).then((res) => {
|
||||
console.log(res.rows);
|
||||
let arry = res.rows;
|
||||
for (let i in arry) {
|
||||
if (arry[i].isQuality != "") {
|
||||
arry[i].isQuality = Number(arry[i].isQuality);
|
||||
} else {
|
||||
arry[i].isQuality = 1;
|
||||
}
|
||||
|
||||
if (arry[i].qcImages != null) {
|
||||
arry[i].qcImages = arry[i].qcImages.split(',');
|
||||
} else {
|
||||
arry[i].qcImages = [];
|
||||
}
|
||||
|
||||
this.tableData.push(arry[i]);
|
||||
}
|
||||
console.log(this.tableData);
|
||||
});
|
||||
// this.tableData = [];
|
||||
// let obj = {
|
||||
// batchNo: this.materialBatchNo,
|
||||
// materialCode: this.materialCode
|
||||
// }
|
||||
// listQualityHistory(obj).then(async res => {
|
||||
// console.log(res.rows);
|
||||
// let arry = res.rows;
|
||||
// for (let i in arry) {
|
||||
// if (arry[i].isQuality != "") {
|
||||
// arry[i].isQuality = Number(arry[i].isQuality);
|
||||
// }
|
||||
|
||||
// if (arry[i].qcImages != null) {
|
||||
// arry[i].qcImages = arry[i].qcImages.split(',');
|
||||
// } else {
|
||||
// arry[i].qcImages = [];
|
||||
// }
|
||||
// this.tableData.push(arry[i]);
|
||||
// }
|
||||
// console.log(this.tableData);
|
||||
// });
|
||||
},
|
||||
add() {
|
||||
this.tableData = [];
|
||||
var objs = [];
|
||||
for (let seq = 0; seq < this.number; seq++) {
|
||||
for (let i = 0; i < this.qualityStandardDetailOptions.length; i++) {
|
||||
let obj = {};
|
||||
obj.seq = seq + 1;
|
||||
obj.batchNo = this.materialBatchNo;
|
||||
obj.lotNo = this.materialLotNo;
|
||||
obj.materialCode = this.materialCode;
|
||||
obj.qualityStandardItem =
|
||||
this.qualityStandardDetailOptions[i].qualityStandardItem;
|
||||
obj.downQualityStandardValue =
|
||||
this.qualityStandardDetailOptions[i].downQualityStandardValue;
|
||||
obj.upQualityStandardValue =
|
||||
this.qualityStandardDetailOptions[i].upQualityStandardValue;
|
||||
obj.upValueRate = this.qualityStandardDetailOptions[i].upValueRate;
|
||||
obj.downValueRate = this.qualityStandardDetailOptions[i].downValueRate;
|
||||
obj.qualityStandardValue =
|
||||
this.qualityStandardDetailOptions[i].qualityStandardValue;
|
||||
obj.qualityStandardUnit =
|
||||
this.qualityStandardDetailOptions[i].qualityStandardUnit;
|
||||
obj.qualityActualValue = "";
|
||||
obj.isQuality = 1;
|
||||
obj.remark = "";
|
||||
// 设置单据Id,方便追溯
|
||||
obj.qualityBillId = this.queryDetailParams.qualityBillId;
|
||||
obj.qualityStandardId = this.queryDetailParams.qualityStandardId;
|
||||
obj.qualityBillDetailId = this.queryDetailParams.qualityBillDetailId;
|
||||
objs.push(obj);
|
||||
}
|
||||
}
|
||||
this.tableData = this.tableData.concat(objs);
|
||||
this.historyTotal = this.tableData.length;
|
||||
this.historyPageSize = this.historyTotal / this.number;
|
||||
},
|
||||
count(index) {
|
||||
var qsv = this.tableData[index].qualityStandardValue;
|
||||
var uqsv = this.tableData[index].upQualityStandardValue;
|
||||
var dqsv = this.tableData[index].downQualityStandardValue;
|
||||
var v = this.tableData[index].qualityActualValue;
|
||||
var m = /\d+(\.\d+)?/g;
|
||||
var rangeUp = null;
|
||||
var rangeDown = null;
|
||||
if (uqsv && dqsv) {
|
||||
rangeUp = Number(qsv.match(m)) + Number(uqsv.match(m));
|
||||
rangeDown = Number(qsv.match(m)) - Number(dqsv.match(m));
|
||||
console.log(rangeUp + " " + rangeDown);
|
||||
if (v <= rangeUp && v >= rangeDown) {
|
||||
console.log("合格");
|
||||
this.tableData[index].isQuality = 1;
|
||||
console.log(this.tableData[index].isQuality);
|
||||
} else {
|
||||
console.log("不合格");
|
||||
this.tableData[index].isQuality = 0;
|
||||
console.log(this.tableData[index].isQuality);
|
||||
}
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
/** 计算合格数 */
|
||||
var passNumber = 0;
|
||||
for (var i = 1, k = 0; i <= this.tableData.length; i++) {
|
||||
k += Number(this.tableData[i - 1].isQuality);
|
||||
if (i % this.qualityStandardDetailOptions.length == 0) {
|
||||
if (k == this.qualityStandardDetailOptions.length) {
|
||||
passNumber++;
|
||||
k = 0;
|
||||
} else {
|
||||
k = 0;
|
||||
}
|
||||
}
|
||||
// console.log(this.tableData[i].qcImages)
|
||||
// if (this.tableData[i].qcImages.length > 0) {
|
||||
// console.log(this.tableData[i].qcImages)
|
||||
// // this.tableData[i].qcImages = this.tableData[i].qcImages.map(obj => obj.url).join(', ');
|
||||
// }
|
||||
}
|
||||
// var zjNum = 0;
|
||||
// var zjhgNum = 0;
|
||||
// var a = null;
|
||||
for (var i in this.tableData) {
|
||||
// this.tableData[i].materialCode = this.materialCode;
|
||||
// this.tableData[i].index = i;
|
||||
// if (this.tableData[i].qualityActualValue != null && this.tableData[i].isQuality != null) {
|
||||
// zjNum++;
|
||||
// if (this.tableData[i].isQuality == 1) {
|
||||
// zjhgNum++;
|
||||
// }
|
||||
// }
|
||||
if (this.tableData[i].qcImages) {
|
||||
this.tableData[i].qcImages = this.tableData[i].qcImages.map(obj => obj.url).join(', ');
|
||||
}
|
||||
}
|
||||
console.log(this.tableData);
|
||||
this.$modal.loading('提交中')
|
||||
addQualityHistoryList(this.tableData, this.queryDetailParams.qualityBillDetailId).then(async res => {
|
||||
this.$modal.closeLoading();
|
||||
console.log(getCurrentPages());
|
||||
var pages = getCurrentPages();
|
||||
var prevPage = pages[pages.length - 2]; //上一个页面
|
||||
var object = {
|
||||
number: this.tableData.length /
|
||||
this.qualityStandardDetailOptions.length,
|
||||
passNumber: passNumber,
|
||||
did: this.did
|
||||
}
|
||||
prevPage.$vm.otherFun(object); //重点$vm
|
||||
|
||||
uni.navigateBack();
|
||||
|
||||
// this.$tab.navigateTo('/pages/qc/ipqc');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.u-reset-button {
|
||||
background-color: #3c9cff;
|
||||
font-size: 18px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.example-body {
|
||||
padding: 10px;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.upload {
|
||||
float: left;
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.addrimg {
|
||||
width: 100%;
|
||||
background-color: rgb(255, 255, 255);
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.uptext {
|
||||
color: rgba(74, 74, 74, 1);
|
||||
font-size: 28rpx;
|
||||
padding: 30rpx 0rpx 0rpx 30rpx;
|
||||
}
|
||||
|
||||
.upimg {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.upimg::after {
|
||||
content: '';
|
||||
display: block;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.upimg>image {
|
||||
width: 159rpx;
|
||||
height: 159rpx;
|
||||
margin: 20rpx 0rpx 20rpx 30rpx;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.uni-uploader__file {
|
||||
float: left;
|
||||
width: 159rpx;
|
||||
height: 159rpx;
|
||||
margin: 20rpx 0rpx 20rpx 30rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* 上传成功的图片 */
|
||||
.uni-uploader__img {
|
||||
float: left;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
|
||||
.delete {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 40rpx;
|
||||
line-height: 45rpx;
|
||||
/* color: rgb(255, 255, 255); */
|
||||
font-size: 26rpx;
|
||||
position: absolute;
|
||||
top: -20rpx;
|
||||
right: 30rpx;
|
||||
background-color: rgb(255, 255, 255);
|
||||
z-index: 99;
|
||||
text-align: center;
|
||||
border: 1rpx solid rgb(255, 255, 255);
|
||||
}
|
||||
|
||||
.delete>text {
|
||||
position: absolute;
|
||||
top: -2rpx;
|
||||
right: -10rpx;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user