Commit 5728d9b2 by zhangzhen

功能优化

parent 55bd66e0
......@@ -160,3 +160,9 @@ export const getProjComboBox = (params) => {
let d = setParamsData(params)
return http.post(url, d)
}
export const getPickingUsers = (params) => {
let url = `/service/S_SC_LL_10`
let d = setParamsData(params)
return http.post(url, d)
}
\ No newline at end of file
......@@ -422,7 +422,7 @@
companyCode:this.orderInfo.companyCode
}).then(res => {
this.inventRecordList = toJsonData(res.data.__blocks__.invent_code_box_block_id.rows, res.data
.__blocks__.invent_code_box_block_id.meta.columns).map(item => {
.__blocks__.invent_code_box_block_id.meta.columns).filter(item=>Number(item.param7Field)).map(item => {
let spec = item.param3Field;
if(!spec.trim()){
spec = `${Number(item.param4Field)}*${Number(item.param5Field)}*${Number(item.param6Field)}`
......
......@@ -78,6 +78,23 @@
</picker>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>领料人:</text>
</view>
<view class="text-blue">
<picker @change="onUserChange" :value="index" :range="userList" range-key="label">
<view class="uni-input">
<text
class="text-blue">{{ userIndex>=0 && userList.length ? userList[userIndex].label:'请选择领料人'}}</text>
<text class="cuIcon-right"></text>
</view>
</picker>
</view>
</view>
</form>
</view>
</view>
......@@ -227,7 +244,8 @@
getProjComboBox,
updateInfo,
getInventInfo,
saveSubList
saveSubList,
getPickingUsers
} from "@/api/picking.js";
export default {
......@@ -257,7 +275,8 @@
inventRecordEnum:[],
inventTypeBoxList:[],
inventTypeBoxEnum:{},
userList:[],
userIndex:-1
};
},
onLoad() {
......@@ -388,7 +407,9 @@
projName: this.list[this.index].label,
whCode: this.projectList[this.projectIndex].value,
whName: this.projectList[this.projectIndex].label,
receiptDate: moment(this.receiptDate[0]).format("YYYYMMDD")
receiptDate: moment(this.receiptDate[0]).format("YYYYMMDD"),
receiveUserId: this.userList[this.userIndex].value,
receiveUserName: this.userList[this.userIndex].label
}).then(res => {
if (res.data.__sys__.status === 0) {
if(this.formList&&this.formList.length){
......@@ -454,7 +475,11 @@
this.factoryIndex = index;
this.index = -1;
this.onGetProjComboBox();
if(this.formList.length){
this.formList = [];
}
if(this.projectIndex>=0){
this.projectIndex= -1;
this.onGetInventInfo();
}
},
......@@ -463,11 +488,20 @@
if (this.index === index) return
this.index = index;
},
onUserChange(e){
let index = Number(e.target.value);
if (this.userIndex === index) return
this.userIndex = index;
},
onProjectChange(e) {
let index = Number(e.target.value);
if (this.projectIndex === index) return
this.projectIndex = index;
this.onGetInventInfo();
if(this.formList.length){
this.formList = [];
this.onAddSub()
}
},
onBack() {
uni.redirectTo({
......@@ -490,6 +524,7 @@
})
},
onLoading() {
this.onGetPickingUsers();
getList().then(res => {
this.inventTypeBoxList = toJsonData(res.data.__blocks__.invent_type_box_block_id.rows, res.data
.__blocks__.invent_type_box_block_id.meta.columns).map(item => {
......@@ -521,13 +556,27 @@
});
})
},
onGetPickingUsers(){
getPickingUsers().then(res => {
console.log(res,9999999)
if(res.data.__sys__.status === 0){
this.userList = toJsonData(res.data.__blocks__.user_block_id.rows, res.data.__blocks__
.user_block_id.meta.columns).map(item => {
return {
label: item.textField,
value: item.valueField
}
});
}
})
},
onGetInventInfo(){
getInventInfo({
companyCode: this.factoryList[this.factoryIndex].value,
whCode: this.projectList[this.projectIndex].value,
}).then(res => {
let list = toJsonData(res.data.__blocks__.invent_code_box_block_id.rows, res.data
.__blocks__.invent_code_box_block_id.meta.columns)
.__blocks__.invent_code_box_block_id.meta.columns).filter(item=> Number(item.param7Field))
if(list && list.length){
this.inventRecordList = list.map(item => {
let spec = item.param3Field;
......
......@@ -426,7 +426,7 @@
companyCode: this.orderInfo.companyCode
}).then(res => {
let list = toJsonData(res.data.__blocks__.invent_code_box_block_id.rows, res.data.__blocks__
.invent_code_box_block_id.meta.columns)
.invent_code_box_block_id.meta.columns).filter(item=> Number(item.param7Field))
if (list && list.length) {
this.inventRecordList = list.map(item => {
let spec = item.param3Field;
......
......@@ -69,6 +69,14 @@
</view>
<view class="cu-form-group">
<view class="title">
<text>领料人:</text>
</view>
<view class="">
<text>{{orderInfo.receiveUserName}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text v-if="orderInfo.status=='0'" class="text-xl text-red">*</text>
<text>单据日期:</text>
</view>
......
<template>
<view :class="floatBoxStatus? 'page-content-box':'' ">
<view :class="show? 'hidden-box':'' ">
<cu-custom bgColor="bg-blue" :isBack="true">
<block slot="backText">
<view class="list-icon" @tap="onBack">
......@@ -30,6 +30,13 @@
<u--input placeholder="请输入项目名称" v-model="queryData.projName" suffixIcon="search"
suffixIconStyle="color: #909399" :customStyle="{padding:'3px 6px'}" :fontSize="13" confirmType="search" @blur="onSearchByName"></u--input>
</view>
<view class="search-box" @tap="onPopOpen">
<text :class="searchStatus? 'text-blue': 'text-black'">筛选</text>
</view>
</view>
<view class="u-tabs-box">
<u-tabs :current="current" :list="tabList" @click="onChangeTab" :lineWidth="55" :scrollable="false"
lineColor="#0072fc" :activeStyle="{color: '#0072fc',fontWeight:'bold',fontSize:'16px'}"></u-tabs>
</view>
<view class="flex-col part-3">
<view v-for="(item,k) in projectDataList" :key="k" class="content-item">
......@@ -67,6 +74,12 @@
<text class="text-title">{{item.receiptDate}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">领料人</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.receiveUserName}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">创建时间</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.createdTime}}</text>
......@@ -92,10 +105,64 @@
</view>
</view>
</view>
<u-popup :show="show" mode="right" :closeOnClickOverlay="true" :zIndex="455" :safeAreaInsetBottom="true"
:safeAreaInsetTop="true" round="6" @close="onPopClose">
<view class="flex-col filter-box">
<view class="content-black" :style="{height:statusBarHeight+45+'px'}">
</view>
<view class="flex-between text-xxl">
<view class="text-title text-lg text-bold margin-left-sm">查询条件</view>
<text class="cuIcon-roundclose text-gray margin-right" @tap="onPopClose"></text>
</view>
<view class="flex-col query-data">
<view class="flex-col part">
<view class="title">
<text class="text-title">单据日期:</text>
</view>
<view class="input receiptDate" @tap="onOpenCalendar">
<text :class="queryData.receiptDate?'text-black':'text-grey'">{{queryData.receiptDate||'请选择单据日期'}}</text>
</view>
</view>
<view class="flex-col part">
<view class="title">
<text class="text-title">存货大类:</text>
</view>
<view class="input receiptDate">
<picker @change="onInventTypeChange" :value="inventTypeIndex" :range="inventTypeDetailList" range-key="label">
<view class="uni-input">
<text :class="inventTypeIndex>=0?'text-black':'text-grey'">{{ inventTypeIndex>=0 && inventTypeDetailList.length ? inventTypeDetailList[inventTypeIndex].label:'请选择存货大类'}}</text>
</view>
</picker>
</view>
</view>
<view class="flex-col part">
<view class="title">
<text class="text-title">领料人:</text>
</view>
<view class="input receiptDate">
<picker @change="onUserChange" :value="userIndex" :range="userList" range-key="label">
<view class="uni-input">
<text :class="userIndex>=0?'text-black':'text-grey'">{{ userIndex>=0 && userList.length ? userList[userIndex].label:'请选择领料人'}}</text>
</view>
</picker>
</view>
</view>
</view>
<view class="list-btn">
<button class="cu-btn bg-gray" @tap="onReset">重 置</button>
<button class="cu-btn bg-blue" @tap="onFilterConfirm">确 定</button>
</view>
</view>
</u-popup>
<u-calendar :show="show2" mode="single" :defaultDate="defaultDate" :minDate="minDate" :maxDate="maxDate" :monthNum='12'
@confirm="onConfirm" @close="onCancel"></u-calendar>
</view>
</template>
<script>
import {getDict} from "@/api/index.js"
import {
pathToBase64,
base64ToPath
......@@ -105,11 +172,17 @@
} from "@/utils/tools.js";
import moment from "@/common/moment.js";
import { getParamsList } from "@/api/product-warehousing.js";
import { getList } from "@/api/picking.js";
import { getList,getPickingUsers } from "@/api/picking.js";
export default {
data() {
return {
show: false,
show2: false,
defaultDate: moment().format("YYYY-MM-DD"),
minDate: moment().subtract(11, 'M').format("YYYY-MM-DD"),
maxDate: moment().format("YYYY-MM-DD 23:59:59"),
searchStatus: false,
projectDataList:[],
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
status: 'nomore ',
......@@ -127,6 +200,16 @@
//不良品类
form: {},
factoryIndex:0,
tabList: [
{
name: '未提交',
value: '0'
},
{
name: '已提交',
value: '1'
}
],
factoryList:[
{
value:"",
......@@ -142,7 +225,8 @@
endTimeStamp:0,
factoryEnum:{},
queryData: {
projName:''
receiveUserId:'',
receiptDate:'',
},
pageData:{
showCount: "true",
......@@ -155,13 +239,17 @@
},
submitStatusEnum:{
1:'已提交',
0:"提交"
0:"提交"
},
sourceEnum:{
1:"手动录入",
2:"盘点",
3:"调拨"
}
},
userList:[],
userIndex:-1,
inventTypeDetailList:[],
inventTypeIndex:-1
};
},
onLoad(option) {
......@@ -178,6 +266,7 @@
uni.navigateTo({
url:"/pages/picking/add"
})
this.show = false;
},
onFactoryChange(e){
this.factoryIndex = e.target.value;
......@@ -190,6 +279,12 @@
})
},
onLoading() {
this.onGetPickingUsers();
getDict({
codeset: 'hggp.hgpz.inventTypeDetail'
}).then(res => {
this.inventTypeDetailList = res.data.list
})
getParamsList().then(res=>{
let list = res.data.map(item=>{
this.factoryEnum[item.companyCode] = item.companyName
......@@ -209,6 +304,7 @@
})
getList({
...this.queryData,
status: this.tabList[this.current].value,
companyCode:this.factoryList[this.factoryIndex].value
},this.pageData).then(res => {
......@@ -252,6 +348,78 @@
uni.navigateTo({
url:`/pages/picking/index?id=${val.id}`
})
},
onPopClose() {
this.show2 = false;
this.show = false;
},
onPopOpen(){
this.show = true
},
onOpenCalendar() {
this.show2 = true;
},
onCancel() {
this.show2 = false;
},
onConfirm(e) {
console.log(e)
this.queryData.receiptDate = e[0];
this.defaultDate = e[0]
this.onCancel();
},
onFilterConfirm(){
if(!this.queryData.receiptDate && this.userIndex <0 && this.inventTypeIndex<0){
uni.showToast({
icon:"none",
title:"请输入至少一个查询条件"
})
return
}
this.show = false;
this.searchStatus = true;
this.pageData.offset = 0;
this.onGetList();
},
onReset(){
// 单据日期查询条件
this.queryData.receiptDate = "";
// 领料人查询条件
this.userIndex = -1;
this.queryData.receiveUserId = ''
// 存货大类查询条件
this.inventTypeIndex = -1;
this.queryData.inventTypeDetail = ''
this.pageData.offset = 0;
this.searchStatus = false;
this.show = false;
this.onGetList();
},
onGetPickingUsers(){
getPickingUsers().then(res => {
console.log(res,9999999)
if(res.data.__sys__.status === 0){
this.userList = toJsonData(res.data.__blocks__.user_block_id.rows, res.data.__blocks__
.user_block_id.meta.columns).map(item => {
return {
label: item.textField,
value: item.valueField
}
});
}
})
},
onUserChange(e){
let index = Number(e.target.value);
if (this.userIndex === index) return
this.userIndex = index;
this.queryData.receiveUserId = this.userList[this.userIndex].value;
},
onInventTypeChange(e){
let index = Number(e.target.value);
if (this.inventTypeIndex === index) return
this.inventTypeIndex = index;
this.queryData.inventTypeDetail = this.inventTypeDetailList[this.inventTypeIndex].value;
}
}
}
......@@ -262,6 +430,10 @@
}
</style>
<style lang="scss" scoped>
.hidden-box{
height: 100vh;
overflow: hidden;
}
.page-content-box{
width: 100vw;
height: 100vh;
......@@ -516,6 +688,9 @@
z-index: 99;
font-size: 32upx;
}
.search-box{
margin-left: 12upx;
}
.factory-name{
max-width: 360upx;
.factory-title{
......@@ -524,4 +699,56 @@
text-overflow: ellipsis;
}
}
.filter-box {
position: relative;
display: flex;
flex-direction: column;
width: 60vw;
height: 100%;
padding-top: 30upx;
.item {
margin: 20upx;
.input-box {
border: 1px solid #dadbde;
border-radius: 4px;
padding: 6px 9px;
font-size: 30upx;
}
}
.list-btn {
position: absolute;
left: 0;
bottom: 40upx;
width: 100%;
display: flex;
justify-content: space-between;
.cu-btn {
display: flex;
flex: 1;
margin: 20upx;
}
}
.receiptDate{
border: 1px solid #dadbde;
border-radius: 4px;
padding: 9px 9px;
}
}
.query-data{
border-top: 1px solid #e5e5e5;
margin-top: 24upx;
.part{
.input{
margin: 0 24upx;
}
}
.title{
padding: 12upx 20upx;
}
}
</style>
\ No newline at end of file
......@@ -478,6 +478,10 @@
}
</style>
<style lang="scss" scoped>
.hidden-box{
height: 100vh;
overflow: hidden;
}
.title-view{
display: flex;
flex-direction: row;
......
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