Compare commits
No commits in common. '088578ba1b9ca545432a5233142872144b1a4687' and 'b13138fad0590af31f1902b7361c9ee07a09fa71' have entirely different histories.
088578ba1b
...
b13138fad0
@ -1,175 +0,0 @@
|
|||||||
<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,213 +0,0 @@
|
|||||||
<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>
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue