init project
This commit is contained in:
173
pages/mes/mesJobSingleReportSign/reportContEnsure.vue
Normal file
173
pages/mes/mesJobSingleReportSign/reportContEnsure.vue
Normal file
@@ -0,0 +1,173 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-forms-item label="物料编码" :labelWidth='90' name="ptNoTar">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" @confirm="scanBarCode"
|
||||
v-model="formData.ptNoTar" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料名称" :labelWidth='90' name="ptTitleTar">
|
||||
<uni-easyinput v-model="formData.ptTitleTar" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料规格" :labelWidth='90' name="specification1">
|
||||
<uni-easyinput v-model="formData.specification1" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="仓库" :labelWidth='90' name="formData.whCode">
|
||||
<zxz-uni-data-select v-model="formData.whCode" :localdata="whOptions"
|
||||
:filterable="true"></zxz-uni-data-select>
|
||||
<!-- <uni-data-select v-model="formData.whCode" :localdata="whOptions"></uni-data-select> -->
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="query" style="margin-bottom: 10px;">查询</u-button>
|
||||
<!-- <uni-collapse-item :open="true"> -->
|
||||
<u-checkbox size="25" iconSize="25" activeColor="green" labelSize='40rpx' :label="'全选'" @change="selectAll"
|
||||
v-if="reportList.length>0" :checked="selectAllChecked">
|
||||
</u-checkbox>
|
||||
<u-checkbox-group v-model="checked" @change="getCheckedList" :borderBottom="true" placement="column"
|
||||
iconPlacement="right" style="height: 63vh;overflow: scroll;">
|
||||
<u-checkbox size="25" iconSize="25" activeColor="green" v-for="(item, index) in reportList" :key="index"
|
||||
:disabled="item.disabled" :name="item.id" :label="'\n'+' 序号 : '+(index+1)+'\n\n'+
|
||||
'物料编码 : '+(item.ptNoTar?item.ptNoTar:'')+'\n\n'+
|
||||
'物料名称 : '+(item.ptTitleTar?item.ptTitleTar:'')+'\n\n'+
|
||||
'物料规格 : '+(item.specification1?item.specification1:'')+'\n\n'+
|
||||
'数量 : '+(item.reportNumber?item.reportNumber:'')+'\n\n'+
|
||||
'仓库 : '+(item.whCode?item.whCode:'')+'\n\n'+
|
||||
'合并标签号 : '+(item.singleReportSign? item.singleReportSign:'')+'\n'
|
||||
">
|
||||
</u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<!-- </uni-collapse-item> -->
|
||||
<u-button type="primary" @click="submit" v-if="reportList.length>0">提交</u-button>
|
||||
</uni-collapse>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listMesJobSingleReportSign,
|
||||
advListMesJobSingleReportSign,
|
||||
getMesJobSingleReportSign,
|
||||
delMesJobSingleReportSign,
|
||||
addMesJobSingleReportSign,
|
||||
updateMesJobSingleReportSign,
|
||||
reportConfirm,
|
||||
qualityConfirm,
|
||||
whInConfirm
|
||||
} from "@/api/mes/mesJobSingleReportSign";
|
||||
import {
|
||||
listWarehouse
|
||||
} from "@/api/wms/pdcIn";
|
||||
|
||||
export default {
|
||||
mounted() {
|
||||
listWarehouse().then(res => {
|
||||
this.whOptions = res.rows.map(item => {
|
||||
return {
|
||||
text: item.warehouseCode + ':' + item.warehouseName,
|
||||
value: item.warehouseCode,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selectAllChecked: false,
|
||||
checked: [],
|
||||
whOptions: [],
|
||||
reportList: [],
|
||||
formData: {
|
||||
ptNoTar: null,
|
||||
ptTitleTar: null,
|
||||
specification1: null,
|
||||
whCode: null,
|
||||
status: 0
|
||||
},
|
||||
ids: [],
|
||||
rules: {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getCheckedList(e) {
|
||||
this.ids = e;
|
||||
console.log(this.ids)
|
||||
// 判断当前选中的复选框数量,决定全选框的状态
|
||||
if (this.ids.length === this.reportList.length) {
|
||||
this.selectAllChecked = true;
|
||||
} else {
|
||||
this.selectAllChecked = false;
|
||||
}
|
||||
},
|
||||
//物料编码
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.ptNoTar = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
query() {
|
||||
listMesJobSingleReportSign(this.formData).then(res => {
|
||||
if (res.rows.length === 0) {
|
||||
this.$modal.msg("未查询到相关记录!");
|
||||
return;
|
||||
}
|
||||
|
||||
this.reportList = res.rows.map(item => {
|
||||
let obj = this.whOptions.find(item => item.warehouseCode == item.whCode)
|
||||
if (obj) {
|
||||
item.whName = obj.warehouseName
|
||||
}
|
||||
return item
|
||||
});
|
||||
|
||||
})
|
||||
},
|
||||
selectAll() {
|
||||
// 点击全选按钮时,更新所有复选框的选中状态
|
||||
if (this.checked.length === this.reportList.length) {
|
||||
this.checked = [];
|
||||
this.ids = this.checked;
|
||||
this.selectAllChecked = false; // 全选框不选中
|
||||
} else {
|
||||
this.checked = this.reportList.map(item => item.id);
|
||||
this.ids = this.checked
|
||||
this.selectAllChecked = true; // 全选框选中
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
_this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定完成该质检确认吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log(_this.ids)
|
||||
// let ids = this.reportList.map(item => item.id)
|
||||
reportConfirm(_this.ids)
|
||||
_this.$modal.msg("报工确认已提交!");
|
||||
_this.formData = {
|
||||
ptNoTar: null,
|
||||
ptTitleTar: null,
|
||||
specification1: null,
|
||||
whCode: null,
|
||||
}
|
||||
_this.reportList = [];
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
Reference in New Issue
Block a user