合并代码

master
FCD 1 month ago
parent ef2ed73f53
commit 9fb25f5966

@ -2,7 +2,7 @@
<view class="jPicker">
<view @click="showPicker" class="showLine">
<view v-if="listData.length > 0 && nSel != -1">
{{ listData[nSel][showKey] || listData[nSel] }}
{{ removeLeadingZeros(listData[nSel][showKey]) || removeLeadingZeros(listData[nSel]) }}
</view>
<view style="color: #7d7d7d" v-else>
{{ moren != undefined ? moren : $t('message.workArea_Selelct') }}
@ -47,6 +47,8 @@
</template>
<script lang="ts">
import { removeLeadingZeros } from '@/utils/tool';
/**
* 选择组件
* @property {Array} options 选择数组
@ -110,6 +112,7 @@ export default {
}
},
methods: {
removeLeadingZeros,
delzero(item) {
return item.slice(item.search(/[1-9]/));
},

@ -0,0 +1,29 @@
<template>
<view class="row-list">
<view>
<label class="row-label"> {{ label }}</label>
<label class="row-value"> {{ value }}</label>
</view>
</view>
</template>
<script>
export default {
name: 'ljListRow',
props: ['label', 'value'],
data() {
return {};
},
};
</script>
<style scoped lang="scss">
.row-list {
display: flex;
flex-direction: row;
.row-label {
margin-right: 30rpx;
}
}
</style>

@ -0,0 +1,66 @@
<template>
<div class="pagination">
<button @click="prevPage()" :disabled="currentPage === 1">上一页</button>
<span>{{ currentPage }} / {{ totalPages }}</span>
<button @click="nextPage()" :disabled="currentPage === totalPages">下一页</button>
</div>
</template>
<script lang="ts">
export default {
name: 'ljPagination',
props: {
total: {
type: Number as () => number,
default: 10,
},
pageSize: {
type: Number as () => number,
default: 10,
},
currentPage: {
type: Number as () => number,
default: 1,
},
},
data() {
return {};
},
computed: {
totalPages(): number {
return Math.ceil(this.total / this.pageSize);
},
},
methods: {
prevPage(): void {
if (this.currentPage > 1) {
this.$emit('change', this.currentPage - 1);
}
},
nextPage(): void {
if (this.currentPage < this.totalPages) {
this.$emit('change', this.currentPage + 1);
}
},
},
};
</script>
<style scoped>
.pagination {
display: flex;
align-items: center;
justify-content: center;
margin-top: 20px;
}
.pagination button {
font-size: 16rpx;
cursor: pointer;
}
.pagination span {
padding: 8px 12px;
margin: 0 5px;
}
</style>

@ -0,0 +1,71 @@
<template>
<view class="header" :style="{ backgroundColor: `rgba(250, 53, 52, ${scrollTop / 100})` }">
<view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack({})" />
</view>
<view class="title">{{ $props.title }}</view>
<view class="right"></view>
</view>
</template>
<script lang="ts">
export default {
name: 'pageHead',
props: ['title'],
data() {
return {
scrollTop: 0,
uni: uni,
};
},
};
//
//
//
//VUE API
//VUE API
//
//
//
//
</script>
<style scoped lang="scss">
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 99;
display: flex;
height: 120rpx;
line-height: 88rpx;
color: #fff;
font-size: 34rpx;
font-weight: 500;
text-align: center;
padding: 45rpx 0 0;
.title {
flex: 3;
}
.left,
.right {
flex: 1;
}
.icon {
display: flex;
justify-content: center;
align-items: center;
width: 88rpx;
height: 88rpx;
}
}
</style>

@ -26,6 +26,8 @@ import uniThead from '@/uni_modules/uni-table/components/uni-thead/uni-thead.vue
import uniDataSelect from '@/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue';
import uniIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue';
import MyMixins from './utils/mixin';
// global css
import '@/static/styles/index.scss';
Vue.config.productionTip = false;

@ -663,9 +663,32 @@
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/wms/Raw/SapStock/index",
"style": {
"navigationBarTitleText": "实时库存",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/quality/ProductSample/index",
"style": {
"navigationBarTitleText": "成品留样",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/quality/SampleCheck/index",
"style": {
"navigationBarTitleText": "留样复检",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
}
],

@ -0,0 +1,176 @@
<template>
<view class="page-product-receipt">
<!-- 页面头 -->
<page-head title="成品留样" />
<u-form class="form" ref="form" label-width="180rpx" style="margin-top: 10px">
<u-form-item label="首检日期">
<u-input @click="showCalendar = true" placeholder="请选择日期" v-model="checkTime" :clearable="false" />
<u-icon name="close-circle-fill" @click="clear" color="rgb(96, 98, 102)" size="28"></u-icon>
</u-form-item>
</u-form>
<view class="scroll">
<view v-for="(item, index) in list" :key="index">
<u-form style="margin-top: 10rpx" class="form2">
<view>
<lj-list-row label="物料名称:" :value="item.materialName" />
<lj-list-row label="来料批次号:" :value="item.incomeBatchNo" />
<lj-list-row label="留样时间:" :value="formatDate(item.sampleTime, '未留样')" />
<view v-if="!item.sampleTime" class="righttitle">
<view @click.stop="handelOption(item)" class="boder-icon-rigth"> 留样</view>
</view>
</view>
</u-form>
</view>
</view>
<u-calendar v-model="showCalendar" :mode="mode" @change="changeTime"></u-calendar>
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import model from './model';
import moment from 'moment';
import PageHead from '@/components/lanju/page-head/index.vue';
import LjListRow from '@/components/lanju/lj-list-row/index.vue';
@Component({
components: {
LjListRow,
PageHead,
},
})
export default class ProductSample extends BasePage {
model = model;
checkTime: any = moment().format('YYYY-MM-DD');
showCalendar = false;
mode = 'date';
queryParams = {
queryDate: undefined,
};
list: any = [];
clear() {
this.checkTime = null;
}
async changeTime(e) {
console.log(e.result);
this.checkTime = e.result;
await this.getList();
}
onLoad() {
this.getList();
}
async handelOption(item) {
uni.showModal({
title: '提示',
content: '是否选择留样',
confirmText: '确定',
cancelText: '取消',
success: async (res) => {
//
if (res.confirm) {
await this.model.updateQcCheckSampleTask({
id: item.id,
sampleTime: new Date(),
sampleNum: '1盒',
sampleAddress: '成品留样室',
});
if (this.model.confirmCode === 200) {
await this.getList();
}
}
},
});
}
async getList() {
let time = this.checkTime;
if (!time) {
time = moment().format('YYYY-MM-DD');
}
this.queryParams.queryDate = time;
await this.model.selectQcCheckSampleTaskList(this.queryParams);
this.list = this.model.list;
}
//
formatDate(time: any, msg: string) {
if (!time) {
return msg;
}
return moment(time).format('YYYY-MM-DD HH:mm:ss');
}
}
</script>
<style lang="scss" scoped>
.form {
background-color: #fff;
padding: 0 40rpx;
border-radius: 10rpx;
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
.u-form-item {
padding: 30rpx 0;
line-height: 35rpx;
}
.row {
display: flex;
flex-direction: row;
justify-content: space-around;
flex: 1;
}
}
.scroll {
.form2 {
background-color: #fff;
padding: 10rpx 25rpx 10rpx 25rpx;
border-radius: 10rpx;
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
color: #8d8989;
.row-list {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-top: 10rpx;
.list-label {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 30%;
}
.list-text {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 70%;
}
}
.righttitle {
display: flex;
justify-content: flex-end;
.boder-icon-rigth {
border: 1rpx solid #fa3534;
width: 130rpx;
text-align: center;
background: #fa3534;
color: #ffffff;
margin-top: 10px;
}
}
}
}
</style>

@ -0,0 +1,31 @@
import { getModule, Module, MutationAction, VuexModule } from 'vuex-module-decorators';
import store from '@/store';
import http from '@/utils/request';
import { url } from '@/utils/url';
@Module({
namespaced: true,
dynamic: true,
store,
name: 'page.raw.ProductSample',
})
export class ProductSample extends VuexModule {
list: any = [];
@MutationAction
async selectQcCheckSampleTaskList(query: any): Promise<{ list: any }> {
const result: any = await http.get(url.lanjuquality.ProductSample.getQcCheckSampleTaskList, {
params: query,
});
const list = result.rows;
return { list };
}
confirmCode: any = '';
@MutationAction
async updateQcCheckSampleTask(data: any): Promise<{ confirmCode: string }> {
const result: any = await http.put(url.lanjuquality.ProductSample.updateQcCheckSampleTask, data);
const confirmCode = result.code;
return { confirmCode };
}
}
export default getModule(ProductSample);

@ -0,0 +1,223 @@
<template>
<view class="page-product-receipt">
<!-- 页面头 -->
<page-head title="留样复检" />
<view class="scroll">
<view v-for="(item, index) in list" :key="index">
<u-form style="margin-top: 10rpx" class="form2">
<view>
<lj-list-row label="物料名称:" :value="item.materialName" />
<lj-list-row label="来料批次号:" :value="item.incomeBatchNo" />
<lj-list-row label="留样时间:" :value="formatDate(item.sampleTime, '未留样')" />
<lj-list-row label="第一次复检:" :value="formatDate(item.firstCheckTime, '未复检')" />
<lj-list-row label="第二次复检:" :value="formatDate(item.secondCheckTime, '未复检')" />
<lj-list-row label="第三次复检:" :value="formatDate(item.thirdCheckTime, '未复检')" />
<view class="righttitle">
<view @click.stop="handelOption(item, 1)" v-if="firstCheckButton(item)" class="boder-icon-rigth"> </view>
<view @click.stop="handelOption(item, 2)" v-if="secondCheckButton(item)" class="boder-icon-rigth"> </view>
<view @click.stop="handelOption(item, 3)" v-if="thirdCheckButton(item)" class="boder-icon-rigth"> </view>
</view>
</view>
</u-form>
</view>
</view>
<view style="position: absolute; bottom: 0; width: 90%">
<lj-pagination :total="total" :currentPage="queryParams.pageNum" @change="changePage"></lj-pagination>
</view>
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import model from './model';
import moment from 'moment';
import PageHead from '@/components/lanju/page-head/index.vue';
import LjListRow from '@/components/lanju/lj-list-row/index.vue';
import ljPagination from '@/components/lanju/lj-pagination/index.vue';
@Component({
components: {
LjListRow,
PageHead,
ljPagination,
},
})
export default class SampleCheck extends BasePage {
model = model;
nowTime: any = new Date(moment().format('YYYY-MM-DD')).getTime();
mode = 'date';
queryParams = {
pageNum: 1,
pageSize: 10,
firstDate: undefined,
secondDate: undefined,
thirdDate: undefined,
};
total = 0;
list: any = [];
userinfo: any = uni.getStorageSync('userinfo');
onLoad() {
this.getList();
}
async handelOption(item: any, num: number) {
uni.showModal({
title: '提示',
content: '确认是否第' + num + '次复检',
confirmText: '确定',
cancelText: '取消',
success: (res) => {
//
if (res.confirm) {
uni.showModal({
title: '提示',
content: '请选择复检结果',
confirmText: '正常',
cancelText: '不正常',
success: async (res) => {
let result = '0';
//
if (res.confirm) {
result = 'Y';
}
//
if (res.cancel) {
result = 'N';
}
const po = {
id: item.id,
firstCheckUserCode: undefined,
firstCheckUserName: undefined,
firstCheckResult: undefined,
firstCheckTime: undefined,
secondCheckUserCode: undefined,
secondCheckUserName: undefined,
secondCheckResult: undefined,
secondCheckTime: undefined,
thirdCheckUserCode: undefined,
thirdCheckUserName: undefined,
thirdCheckResult: undefined,
thirdCheckTime: undefined,
};
if (num === 1) {
po.firstCheckUserCode = this.userinfo.userName;
po.firstCheckUserName = this.userinfo.nickName;
po.firstCheckResult = result;
po.firstCheckTime = new Date();
}
if (num === 2) {
po.secondCheckUserCode = this.userinfo.userName;
po.secondCheckUserName = this.userinfo.nickName;
po.secondCheckResult = result;
po.secondCheckTime = new Date();
}
if (num === 3) {
po.thirdCheckUserCode = this.userinfo.userName;
po.thirdCheckUserName = this.userinfo.nickName;
po.thirdCheckResult = result;
po.thirdCheckTime = new Date();
}
await this.model.updateQcCheckSampleTask(po);
if (this.model.confirmCode === 200) {
await this.getList();
}
},
});
}
},
});
}
firstCheckButton(item: any) {
if (item.firstCheckResult) {
return false;
}
const diff = this.timeDifference(item.sampleTime);
return diff >= 30;
}
secondCheckButton(item: any) {
if (item.secondCheckResult) {
return false;
}
const diff = this.timeDifference(item.sampleTime);
return diff >= 90;
}
thirdCheckButton(item: any) {
if (item.thirdCheckResult) {
return false;
}
const diff = this.timeDifference(item.sampleTime);
return diff >= 180;
}
//
timeDifference(time: any) {
//
const sampleTime = new Date(moment(time).format('YYYY-MM-DD')).getTime();
const diffTime = this.nowTime - sampleTime;
return diffTime / (3600 * 24 * 1000);
}
//
formatDate(time: any, msg: string) {
if (!time) {
return msg;
}
return moment(time).format('YYYY-MM-DD HH:mm:ss');
}
//
changePage(e: any) {
this.queryParams.pageNum = e;
this.getList();
}
async getList() {
//30
const oldDate1 = new Date().setDate(new Date().getDate() - 30);
const oldDate2 = new Date().setDate(new Date().getDate() - 90);
const oldDate3 = new Date().setDate(new Date().getDate() - 180);
this.queryParams.firstDate = moment(oldDate1).format('YYYY-MM-DD');
this.queryParams.secondDate = moment(oldDate2).format('YYYY-MM-DD');
this.queryParams.thirdDate = moment(oldDate3).format('YYYY-MM-DD');
await this.model.getQcWaitCheckSampleTaskList(this.queryParams);
this.list = this.model.list;
this.total = this.model.total;
}
}
</script>
<style lang="scss" scoped>
.scroll {
height: 1100rpx;
overflow: scroll;
.form2 {
background-color: #fff;
padding: 10rpx 25rpx 10rpx 25rpx;
border-radius: 10rpx;
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
color: #8d8989;
.righttitle {
display: flex;
justify-content: flex-end;
.boder-icon-rigth {
font-size: 30rpx;
border-radius: 5px;
border: 1rpx solid #fa3534;
text-align: center;
background: #fa3534;
color: #ffffff;
margin-top: 10px;
margin-left: 10px;
}
}
}
}
</style>

@ -0,0 +1,33 @@
import { getModule, Module, MutationAction, VuexModule } from 'vuex-module-decorators';
import store from '@/store';
import http from '@/utils/request';
import { url } from '@/utils/url';
@Module({
namespaced: true,
dynamic: true,
store,
name: 'page.raw.ProductSample',
})
export class SampleCheck extends VuexModule {
list: any = [];
total = 0;
@MutationAction
async getQcWaitCheckSampleTaskList(query: any): Promise<{ list: any; total: number }> {
const result: any = await http.get(url.lanjuquality.ProductSample.getQcWaitCheckSampleTaskList, {
params: query,
});
const list = result.rows;
const total = result.total;
return { list, total };
}
confirmCode: any = '';
@MutationAction
async updateQcCheckSampleTask(data: any): Promise<{ confirmCode: any }> {
const result: any = await http.put(url.lanjuquality.ProductSample.updateQcCheckSampleTask, data);
const confirmCode = result.code;
return { confirmCode };
}
}
export default getModule(SampleCheck);

@ -354,6 +354,10 @@ export default class receivePO extends BasePage {
});
console.log('this.reducelist', this.reducelist);
this.bimWl = this.reducelist[0];
if (this.reducelist[0].waCode) {
this.areaCode = this.reducelist[0].waCode;
await this.queryloc();
}
this.oldprodlist = materilist.map((item) => {
let newmaterialCode = item.materialCode.slice(item.materialCode.search(/[1-9]/));
return {

@ -0,0 +1,154 @@
<template>
<view class="page-product-receipt">
<!-- 页面头 -->
<page-head title="实时库存" />
<!-- 查询条件 -->
<u-form class="form" ref="form" label-width="180rpx">
<u-form-item label="物料编码">
<u-search placeholder="请输入物料编码" v-model="queryParams.matnr" @search="search" :show-action="false"></u-search>
</u-form-item>
<u-form-item label="物料名称">
<u-search placeholder="请输入物料名称" v-model="queryParams.maktx" @search="search" :show-action="false"></u-search>
</u-form-item>
</u-form>
<!-- 列表 -->
<view class="scroll">
<view v-for="item in sapStockList" :key="item.id">
<u-form style="margin-top: 10rpx" class="form2">
<view>
<lj-list-row label="物料编码:" :value="removeLeadingZeros(item.matnr)" />
<lj-list-row label="物料名称:" :value="item.maktx" />
<lj-list-row label="非限制库存:" :value="item.clabs" />
<lj-list-row label="冻结库存:" :value="item.cspem" />
</view>
</u-form>
</view>
</view>
<view style="position: absolute; bottom: 120rpx; width: 90%">
<lj-pagination :total="total" :currentPage="queryParams.pageNum" @change="changePage"></lj-pagination>
</view>
<!-- 按钮 -->
<view class="bottom-bar">
<u-row class="button-bar">
<u-col :span="12">
<u-button type="primary" @click="search"></u-button>
</u-col>
</u-row>
</view>
</view>
</template>
<script lang="ts">
import PageHead from '@/components/lanju/page-head/index.vue';
import { BasePage } from '@/components/base/page';
import { Component } from 'vue-property-decorator';
import jPicker from '@/components/J-Picker/jPicker.vue';
import LjRowList from '@/components/lanju/lj-list-row/index.vue';
import LjListRow from '@/components/lanju/lj-list-row/index.vue';
import model from './model';
import { removeLeadingZeros } from '@/utils/tool';
import ljPagination from '@/components/lanju/lj-pagination/index.vue';
interface QueryParamsPo {
matnr: string;
maktx: string;
pdaSearch: '1';
pageNum: 1;
pageSize: 10;
}
interface SapStockPo {
materialCode: string;
materialDesc: string;
storageAmount: string;
}
@Component({
methods: { removeLeadingZeros },
components: {
ljPagination,
LjListRow,
LjRowList,
jPicker,
PageHead,
},
})
export default class sapStockPo extends BasePage implements SapStockPo {
materialCode: string;
materialDesc: string;
storageAmount: string;
model = model;
queryParams: QueryParamsPo = {
matnr: undefined,
maktx: undefined,
pdaSearch: '1',
pageNum: 1,
pageSize: 10,
};
sapStockList: any[] = [];
total = 0;
async search() {
this.queryParams.pageNum = 1;
this.getList();
}
//
changePage(e: any) {
this.queryParams.pageNum = e;
this.getList();
}
onLoad() {
this.getList();
}
async getList() {
await this.model.getSapStockList(this.queryParams);
this.sapStockList = this.model.rows;
this.total = this.model.total;
}
}
</script>
<style scoped lang="scss">
.form {
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;
}
}
.scroll {
height: 740rpx;
overflow: scroll;
.form2 {
background-color: #fff;
padding: 20rpx 20rpx 25rpx;
border-radius: 10rpx;
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
color: #8d8989;
}
}
.bottom-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 99;
background: #ffffff;
box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2);
padding: 20rpx;
}
</style>

@ -0,0 +1,33 @@
import { getModule, Module, MutationAction, VuexModule } from 'vuex-module-decorators';
import store from '@/store';
import http from '@/utils/request';
import { url } from '@/utils/url';
@Module({
namespaced: true,
dynamic: true,
store,
name: 'page.raw.sapStockPo',
})
export class sapStockPo extends VuexModule {
WlList = [];
rows: any = [];
total = 0;
@MutationAction
async getSapStockList(data: any): Promise<{ rows: any; total: number }> {
const result: any = await http.get(url.lanjuwms.raw.SapStockPo.getSapStockList, {
params: data,
});
let rows: any;
let total: number;
if (result.total > 0) {
rows = result.rows;
total = result.total;
} else {
rows = [];
total = 0;
}
return { rows, total };
}
}
export default getModule(sapStockPo);

@ -0,0 +1,7 @@
//main-container
.page-product-receipt {
background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #f8262c 51%, #d9001b 100%) no-repeat;
background-size: 100% 600rpx;
padding: 118rpx 30rpx 162rpx;
min-height: 100%;
}

@ -48,5 +48,6 @@ export const page = {
BatchOfflineStorage: '/pages/wms/product/BatchOfflineStorage/index',
ArrivalRecord: '/pages/wms/Raw/ArrivalRecord/index',
ProductionRecord: '/pages/wms/product/ProductionRecord/index',
SapStock: '/pages/wms/Raw/SapStock/index',
},
};

@ -0,0 +1,3 @@
export function removeLeadingZeros(str: string): string {
return String(Number(str));
}

@ -192,6 +192,9 @@ export const url = {
ProductionMaterialRequisitionSC: qianzhuione + '/wms/WmsToWCSmission/listOdsProcureOutOrderTS',
NewConMaterialOutSCNew: qianzhuione + '/wms/WmsToWCSmission/OdsProcureOutOrderTSCK',
},
SapStockPo: {
getSapStockList: qianzhuione + '/wms/matetowsn/saplist',
},
},
WhiteManagement: {
WhiteInstorage: {
@ -371,5 +374,13 @@ export const url = {
// 根据工单获取批次下拉
getBatchList: qianzhuione + '/quality/handCheck/getBatchList',
},
//成品留样
ProductSample: {
//获取留样列表
getQcCheckSampleTaskList: qianzhuione + '/quality/qc-check-sample-task/list',
//获取待复检样品列表
getQcWaitCheckSampleTaskList: qianzhuione + '/quality/qc-check-sample-task/wait-list',
updateQcCheckSampleTask: qianzhuione + '/quality/qc-check-sample-task',
},
},
};

Loading…
Cancel
Save