Compare commits

...

6 Commits

@ -0,0 +1,175 @@
<template>
<view class="photoList">
<view class="itemBox photoBox" v-for="(img, index) in localValue" :key="index">
<view class="closeBtn" @click="deleteImg(index)">
<image class="img" src="../../../static/images/iconCloseGray.svg" mode="scaleToFill"></image>
</view>
<image class="img" :src="img" mode="aspectFit" @click="showScreenImg(index)"></image>
</view>
<view class="itemBox chooseBtn" @click="chooseImg">
<view class="inner">
<image class="img" src="../../../static/images/upload-pic-icon.svg" mode="scaleToFill"></image>
<text class="desc">添加照片</text>
</view>
</view>
</view>
</template>
<script lang="ts">
import {session} from "@/store/modules/session";
import {url} from "@/utils/url";
export default {
name:"ljChooseImg",
props: {
imgList: {
type: Array,
default () {
return []
}
},
},
data(){
return{
localValue:this.imgList
}
},
methods:{
deleteImg(index : any){
this.localValue.splice(index, 1);
},
chooseImg(){
uni.chooseImage({
count: 9,
sourceType: ['album', 'camera'],
success: (res) => {
let tempFilePaths: any = res.tempFilePaths;
tempFilePaths.map((item) => {
uni.uploadFile({
url: "http://192.168.202.34:30000/prod-api/file/upload",
fileType: 'image',
filePath: item,
header: {
Authorization: 'Bearer ' + session.user?.access_token,
},
name: 'file',
success: (res) => {
uni.hideLoading();
if (!res.data) {
return;
}
let data = JSON.parse(res.data);
this.localValue = [...this.localValue, data.data.url];
uni.hideLoading();
},
fail: (err) => {
console.log(err);
uni.showToast({
title:"图片上传失败!",
icon:"none"
})
uni.hideLoading();
},
});
});
},
});
},
showScreenImg(index : any){
uni.previewImage({
current: index,
urls: this.localValue,
loop: true
});
}
},
watch: {
localValue(newVal) {
this.$emit('update:imgList', newVal);
}
}
}
</script>
<style scoped lang="scss">
.photoList {
display: flex;
flex-wrap: wrap;
padding-top: 12rpx;
.chooseBtn {
width: 202rpx;
height: 202rpx;
background: #fafafa;
border-radius: 12rpx;
border: 2rpx dashed #e2e2e2;
display: flex;
justify-content: center;
align-items: center;
.inner {
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.desc {
font-size: 28rpx;
font-weight: 400;
color: #24252a;
line-height: 40rpx;
}
.img {
width: 50rpx;
height: 50rpx;
margin-bottom: 6rpx;
}
}
.photoBox {
width: 202rpx;
height: 202rpx;
background: #fafafa;
border-radius: 12rpx;
position: relative;
.closeBtn {
position: absolute;
top: -12rpx;
right: -12rpx;
z-index: 2;
width: 36rpx;
height: 36rpx;
.img {
width: 36rpx;
height: 36rpx;
}
}
.img {
width: 202rpx;
height: 202rpx;
border-radius: 12rpx;
}
}
.itemBox {
flex: 0 0 202rpx;
margin-right: 10rpx;
&:last-child {
margin-right: 0;
}
}
}
</style>

@ -1,6 +1,18 @@
<template>
<view class="row-list">
<view>
<view v-if="type === 'input'" class="row-input">
<label class="row-label"> {{ label }}:</label>
<input :disabled="disabled" class="row-input-item" v-model="localValue" :placeholder="'请填写'+label" />
</view>
<view v-else-if="type === 'picker'" class="row-input">
<label class="row-label"> {{ label }}</label>
<view class="row-input-item">
<jPicker :disabled="disabled" @bindpicker="bindPicker" sureColor="#ff0000" showKey="label" valKey="value" :val="localValue" :options="pickerOptions" />
</view>
</view>
<view v-else>
<label class="row-label"> {{ label }}</label>
<label class="row-value"> {{ value }}</label>
</view>
@ -8,22 +20,88 @@
</template>
<script>
import jPicker from "@/components/J-Picker/jPicker.vue";
export default {
name: 'ljListRow',
props: ['label', 'value'],
data() {
return {};
components: {jPicker},
props: {
label: {
type: String,
default: ''
},
value: {
type: [Number, String],
default: ''
},
type: {
type: String,
default: ''
},
disabled: {
type: Boolean,
default: false
},
pickerOptions: {
type: Array,
default () {
return []
}
},
},
data() {
return {
localValue:this.value
};
},
methods:{
bindPicker(e) {
this.localValue = e.pickerVal
}
},
watch: {
localValue(newVal) {
this.$emit('update:value', newVal);
},
value(newVal) {
this.localValue = newVal;
}
}
};
</script>
<style scoped lang="scss">
.row-list {
font-size: 28rpx !important;
display: flex;
flex-direction: row;
margin-bottom: 7rpx;
.row-label {
margin-right: 30rpx;
margin-right: 10rpx;
}
.row-input{
display: flex ;
width: 100%;
align-items: center;
.row-label {
flex-shrink: 0;
}
.row-input-item{
font-size: 28rpx;
border: black 1rpx solid;
border-radius: 8rpx;
flex-grow: 0;
flex-shrink: 1;
width: 100%;
box-sizing: border-box;
}
}
}
</style>

@ -719,6 +719,14 @@
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/wms/Raw/ProductionREQ2/index",
"style": {
"navigationBarTitleText": "领料转储",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
}

@ -142,7 +142,7 @@ export default class LoginPage extends BasePage {
// console.log('Version////', this.Version);
}
///******************
version = '0.0.189'; //
version = '0.0.190'; //
//version = '0.0.14'; //
//*************** false true ****************
//isTest = true;

@ -1,7 +1,7 @@
import { getModule, Module, MutationAction, VuexModule } from 'vuex-module-decorators';
import store from '@/store';
import http from '@/utils/request';
// import { url } from '@/utils/url';
import { url } from '@/utils/url';
// import { session } from '@/store/modules/session';
@Module({
namespaced: true,
@ -13,7 +13,7 @@ export class login extends VuexModule {
checkversion: any = {};
@MutationAction
async checkupdate() {
const result: any = await http.post('/dev-api/system/apkFile/getLastApkVersion', {
const result: any = await http.post(url.wmspda.system.getLastApkVersion, {
factory: 1000,
});
const checkversion: any = result.data;

@ -164,8 +164,7 @@ import {
getManagerList,
getQcWaitCheckSampleTaskList,
getWorkshopList,
submitCheckSampleTaskZl0030,
updateQcCheckSampleTask
submitCheckSampleTaskZl0030
} from './model';
import moment from 'moment';
import PageHead from '@/components/lanju/page-head/index.vue';
@ -312,8 +311,17 @@ export default class SampleCheck extends BasePage {
//
timeDifference(time: any) {
//
const sampleTime = new Date(moment(time).format('YYYY-MM-DD')).getMonth();
return new Date().getMonth() - sampleTime;
const targetDate = moment(time).toDate(); // Date
// 2.
const now = new Date();
const currentYear = now.getFullYear();
const currentMonth = now.getMonth();
const targetYear = targetDate.getFullYear();
const targetMonth = targetDate.getMonth();
// 3.
return (currentYear - targetYear) * 12 + (currentMonth - targetMonth);
}
//

@ -1,6 +1,7 @@
import { getModule, Module, MutationAction, VuexModule } from 'vuex-module-decorators';
import store from '@/store';
import http from '@/utils/request';
import {url} from "@/utils/url";
// import { url } from '@/utils/url';
// import { session } from '@/store/modules/session';
@Module({
@ -13,7 +14,7 @@ export class shouye extends VuexModule {
checkversion: any = {};
@MutationAction
async checkupdate() {
const result: any = await http.post('/dev-api/system/apkFile/getLastApkVersion', {
const result: any = await http.post(url.wmspda.system.getLastApkVersion, {
factory: 1000,
});
const checkversion: any = result.data;

@ -23,52 +23,27 @@
<!-- <u-form-item label="物料编码">
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="aimWl.value" :options="materilist" />
</u-form-item> -->
<u-form-item label="标志卡">
<u-search placeholder="请扫描" :focus="twofouces" v-model="Idcard" @search="querybyidcard" :show-action="false"></u-search>
</u-form-item>
</u-form>
<u-form v-show="materilist.length" v-for="(item, index) in materilist" :key="index" :style="{ marginTop: '1rpx', backgroundColor: item.planNumber <= item.outNumber ? '#4eea9b59' : '#ffffff' }" class="form3">
<view class="list">
<view class="row-list">
<view style="width: 25%" class="list-item"> 领料单: </view>
<view style="width: 80%"> {{ item.produceCode }} </view>
<!-- 列表 -->
<u-form class="page-list" v-show="materilist.length">
<view class="page-list-item" v-for="(item, index) in materilist" :key="index">
<lj-list-row label="领料单:" :value="item.produceCode" />
<lj-list-row label="物料编码:" :value="item.materialCode" />
<lj-list-row label="物料名称:" :value="item.materialDesc" />
<view style="display: flex">
<lj-list-row style="width: 50%" label="应出:" :value="item.planNumber" />
<lj-list-row style="width: 50%" label="已出:" :value="item.outNumber" />
</view>
<view class="row-list">
<view style="width: 25%" class="list-item"> 物料编码: </view>
<view style="width: 80%"> {{ item.handlematerialCode }} </view>
</view>
<view class="row-list">
<view style="width: 25%" class="list-item"> 物料名称: </view>
<view style="width: 80%"> {{ item.materialDesc }} </view>
</view>
<view class="row-list">
<view class="row-list-item1">
<view class="list-item"> 应出: </view>
<view> {{ item.planNumber }} </view>
</view>
<view class="row-list-item2">
<view class="list-item"> 已出: </view>
<view> {{ item.outNumber }} </view>
</view>
</view>
<view class="row-list">
<view class="row-list-item1">
<view class="list-item"> 未出: </view>
<view> {{ parseFloat(item.planNumber) - parseFloat(item.outNumber) }} </view>
</view>
<view class="row-list-item2">
<view class="list-item"> 单位: </view>
<view> {{ item.unit }} </view>
</view>
</view>
<view class="row-list">
<view style="width: 25%" class="list-item"> 是否过账: </view>
<jPicker style="border: 2rpx solid; border-radius: 8rpx" @bindpicker="bookTypeChange($event, index)" :disabled="item.planNumber <= item.outNumber ? true : false" sureColor="#ff0000" showKey="label" valKey="value" :val="item.isguozhang.value" :options="reducelist" />
</view>
<view class="row-list">
<view style="width: 25%" class="list-item"> 物料凭证: </view>
<view style="width: 80%"> {{ item.userDefined9 ? item.userDefined9 : '无' }} </view>
<view style="display: flex">
<lj-list-row style="width: 50%" label="未出:" :value="parseFloat(item.planNumber) - parseFloat(item.outNumber)" />
<lj-list-row style="width: 50%" label="单位:" :value="item.unit" />
</view>
<lj-list-row v-if="item.userDefined10 !== '2'" type="picker" label="是否过账:" :disabled="item.userDefined10 === '2'" :value.sync="item.isPost" :pickerOptions="reducelist" />
<lj-list-row v-if="item.userDefined10 === '2'" label="过账状态:" :value="'已过账'" />
<lj-list-row label="物料凭证:" :value="item.userDefined9 || '无'" />
<lj-list-row v-if="item.userDefined10 !== '2'" type="input" label="出账数量" :value.sync="item.qty" />
</view>
</u-form>
</view>
@ -106,7 +81,7 @@
<u-row class="button-bar">
<!-- 确定 -->
<u-col :span="6">
<u-button :disabled="isdisabled" @click="onSubmit" type="primary">确认出库</u-button>
<u-button :disabled="isdisabled" @click="onSubmitV2" type="primary">确认出库</u-button>
</u-col>
<!-- 返回 -->
<u-col :span="6">
@ -121,8 +96,10 @@
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import jPicker from '@/components/J-Picker/jPicker.vue';
import model from './model';
import model, {submitReverseMaterialList} from './model';
import { session } from '@/store/modules/session';
import LjListRow from "@/components/lanju/lj-list-row/index.vue";
import {submitTransferMaterialList} from "@/pages/wms/Raw/ProductionREQ2/model";
interface OptionType {
label: string;
value: string;
@ -130,6 +107,7 @@ interface OptionType {
//import { session } from '@/store/modules/session';
@Component({
components: {
LjListRow,
jPicker,
},
})
@ -376,6 +354,55 @@ export default class ProductionREQ extends BasePage {
//this.getlist();
}
}
async onSubmitV2() {
if (this.orderNo == '' || this.orderNo.length == 0) {
(this.$refs.uToast as any).show({
title: '请输入领料单号',
});
return;
}
const list = []
//
//
for (const item of this.materilist){
if (item.isPost + "" === "1"){
list.push(item)
continue;
}
if ( item.qty && parseInt(item.qty) > 0){
list.push(item)
}
}
const data = {
createBy:session.userName,
factoryCode:session.FactoryCode,
orderList:list,
}
submitReverseMaterialList(data).then(res=>{
if (res.code === 200){
uni.showToast({
title: '操作成功!',
mask:true
})
}else {
uni.showToast({
title: '操作失败!',
mask:true
})
}
setTimeout(()=>{
this.query()
},1500)
})
}
mepty() {
this.list = [];
this.materilist = [];

@ -108,3 +108,9 @@ export class ProductionREQ extends VuexModule {
}
export default getModule(ProductionREQ);
export function submitReverseMaterialList(data: any): Promise<any> {
return http.post(url.lanjuwms.raw.ProductionREQ.submitReverseMaterialList, data);
}

@ -0,0 +1,213 @@
<template>
<view class="page-product-receipt">
<!-- 页面头 -->
<page-head title="批量生产领料" />
<!-- 查询条件 -->
<u-form class="queryFrom" ref="queryFrom" label-width="180rpx">
<u-form-item label="领料单">
<u-search placeholder="请扫描" v-model="queryParams.code" @search="query" :show-action="false"></u-search>
</u-form-item>
</u-form>
<!-- 列表 -->
<scroll-view id="list" scroll-y="true" :style="{ height: listHeight + 'px' }" :lower-threshold="50">
<!-- 列表 -->
<u-form class="page-list">
<view class="page-list-item" v-for="item in list" :key="item.id">
<lj-list-row label="领料单:" :value="item.produceCode" />
<lj-list-row label="物料编码:" :value="item.materialCode" />
<lj-list-row label="物料名称:" :value="item.materialDesc" />
<view style="display: flex">
<lj-list-row style="width: 50%" label="应出:" :value="item.planNumber" />
<lj-list-row style="width: 50%" label="已出:" :value="item.outNumber" />
</view>
<view style="display: flex">
<lj-list-row style="width: 50%" label="未出:" :value="parseFloat(item.planNumber) - parseFloat(item.outNumber)" />
<lj-list-row style="width: 50%" label="单位:" :value="item.unit" />
</view>
<lj-list-row v-if="item.userDefined10 !== '2'" type="picker" label="是否过账:" :disabled="item.userDefined10 === '2'" :value.sync="item.isPost" :pickerOptions="pickerOptions" />
<lj-list-row v-if="item.userDefined10 === '2'" label="过账状态:" :value="'已过账'" />
<lj-list-row label="物料凭证:" :value="item.userDefined9 || '无'" />
<lj-list-row v-if="item.userDefined10 !== '2'" type="input" label="出账数量" :value.sync="item.qty" />
</view>
</u-form>
</scroll-view>
<!-- 按钮 -->
<view id="button" class="bottom-bar">
<u-row class="button-bar">
<u-col :span="12">
<u-button type="primary" @click="submit"></u-button>
</u-col>
</u-row>
</view>
</view>
</template>
<script lang="ts">
import {Component} from "vue-property-decorator";
import PageHead from "@/components/lanju/page-head/index.vue";
import {BasePage} from "@/components/base/page";
import LjListRow from "@/components/lanju/lj-list-row/index.vue";
import {session} from "@/store/modules/session";
import {getBatchProductionMaterialList, submitTransferMaterialList} from "@/pages/wms/Raw/ProductionREQ2/model";
interface QueryParams {
code: string;
productDate: string;
type: string;
factoryCode: string;
operator: string;
}
@Component({
components: {LjListRow, PageHead}
})
export default class Index extends BasePage {
queryParams: QueryParams = {
code:undefined,
productDate:undefined,
type:undefined,
factoryCode: session.FactoryCode,
operator: session.userName,
};
listHeight = 500
list = []
pickerOptions: any = [
{
label: '否',
value: '0',
},
{
label: '是',
value: '1',
},
];
onReady() {
//
this.$nextTick(() => {
let buttonTop = 0;
//
const query = uni.createSelectorQuery().in(this);
query
.select('#button')
.boundingClientRect((data) => {
//
buttonTop = data.top;
})
.exec();
//
query
.select('#list')
.boundingClientRect((data) => {
//
const listTop = data.top;
//
this.listHeight = buttonTop - listTop - 10;
})
.exec();
});
}
query(){
if (!this.queryParams.code){
uni.showToast({
title: '请输入领料单号!',
})
return;
}
if (!this.queryParams.code.includes("ZC")){
uni.showToast({
title: '请输入正确的领料单号!',
})
return;
}
const code = this.queryParams.code.split("_")
this.queryParams.productDate = code[1]
this.queryParams.type = code[0]
console.log(this.queryParams)
getBatchProductionMaterialList(this.queryParams).then(res=>{
this.list = res.data
})
}
submit(){
if (!this.queryParams.code){
uni.showToast({
title: '请输入领料单号!',
})
return;
}
if (!this.queryParams.code.includes("ZC")){
uni.showToast({
title: '请输入正确的领料单号!',
})
return;
}
const list = []
//
//
for (const item of this.list){
if (item.isPost + "" === "1"){
list.push(item)
continue;
}
if ( item.qty && parseInt(item.qty) > 0){
list.push(item)
}
}
const data = {
createBy:session.userName,
factoryCode:session.FactoryCode,
orderList:list,
}
submitTransferMaterialList(data).then(res=>{
if (res.code === 200){
uni.showToast({
title: '操作成功!',
mask:true
})
}else {
uni.showToast({
title: '操作失败!',
mask:true
})
}
setTimeout(()=>{
this.query()
},1500)
})
}
}
</script>
<style scoped lang="scss">
</style>

@ -0,0 +1,14 @@
import http from '@/utils/request';
import { url } from '@/utils/url';
export function getBatchProductionMaterialList(data: any): Promise<any> {
return http.get(url.lanjuwms.raw.ProductionREQ2.getBatchProductionMaterialList, {
params: data,
});
}
export function submitTransferMaterialList(data: any): Promise<any> {
return http.post(url.lanjuwms.raw.ProductionREQ2.submitTransferMaterialList, data);
}

@ -6,6 +6,19 @@
min-height: 100%;
}
//
.queryFrom {
background-color: #fff;
margin-top: 10px;
padding: 20rpx;
border-radius: 10rpx;
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
.u-form-item {
line-height: 35rpx;
}
}
//
.page-form {
background-color: #fff;
@ -19,6 +32,30 @@
}
}
//
.page-list {
margin-top: 20rpx;
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
.page-list-item {
margin-bottom: 20rpx;
background-color: #fff;
padding: 20rpx 20rpx 25rpx;
border-radius: 10rpx;
}
/* 奇数行背景色 */
.page-list-item:nth-child(odd) {
background-color: #ffffff;
}
/* 偶数行背景色 */
.page-list-item:nth-child(even) {
background-color: #f5f5f5;
}
}
//
.bottom-bar {

@ -25,16 +25,22 @@ http.interceptors.request.use(
config.timeout = 1000 * 60 * 60;
//console.log('123456',config)
//生产请将注释解开重要重要
// if (config.url.includes('/api')) {
// config.baseURL = 'http://192.168.202.23:5001';
// } else if (config.url.includes('http')) {
// //直接使用写死地址
// } else {
// config.baseURL = 'http://192.168.202.34:30000'; //正式
// // config.baseURL = 'http://192.168.202.20:9000'//测试
// //'http://192.168.202.20:9000' ///测试
// //'http://192.168.202.34:30000'; //正式
// }
if (config.url.includes('/api')) {
config.baseURL = 'http://192.168.202.23:5001';
} else if (config.url.includes('http')) {
//直接使用写死地址
} else {
if (process.env.NODE_ENV === 'development') {
console.log('开发环境');// 发布到生产环境时,此处代码会被摇树移除掉。
} else {
config.baseURL = 'http://192.168.202.34:30000'; //正式
}
// config.baseURL = 'http://192.168.202.34:30000'; //正式
// config.baseURL = 'http://192.168.202.20:9000'//测试
//'http://192.168.202.20:9000' ///测试
//'http://192.168.202.34:30000'; //正式
}
// 所有请求默认提示加载中
if (config.url == '/prod-api/quality/handCheck/commitCheckResultsCg') {
loading = undefined;

@ -1,12 +1,17 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
const qianzhuione = '/dev-api'; // '/prod-api'生产环境 // '/dev-api'开发环境是调后端本地时使用
// const qianzhuione = '/prod-api';
let qianzhuione = '/prod-api';
if (process.env.NODE_ENV === 'development') {
console.log('开发环境');
qianzhuione = '/dev-api';
}
export const url = {
wmspda: {
system: {
test: '/wmspda/system/test',
login: qianzhuione + '/auth/login',
getInfo: qianzhuione + '/system/user/mobileGetInfo',
getLastApkVersion: qianzhuione + '/system/apkFile/getLastApkVersion'
},
},
sys: {
@ -173,6 +178,11 @@ export const url = {
ProductionMaterialRequisitionSC: qianzhuione + '/wms/WmsToWCSmission/ProductionMaterialRequisitionSC',
NewConMaterialOutSC: qianzhuione + '/wms/WmsToWCSmission/NewConMaterialOutSC',
NewConMaterialOutSCNew: qianzhuione + '/wms/WmsToWCSmission/NewConMaterialOutSCNew',
submitReverseMaterialList: qianzhuione + '/wms/rawMaterialOut/submitReverseList',
},
ProductionREQ2: {
getBatchProductionMaterialList: qianzhuione + '/wms/rawMaterialOut/transferMaterialList',
submitTransferMaterialList: qianzhuione + '/wms/rawMaterialOut/submitTransferList',
},
ReturnMaterials: {
listReturnSC: qianzhuione + '/wms/WmsToWCSmission/listReturnSC',

Loading…
Cancel
Save