mes部分功能修改修改

master
guoshuang 2 years ago
parent beff5a95c7
commit c1c0ea35a0

@ -0,0 +1,114 @@
<template>
<view class="yjy-switch-container" :style="{ 'border-color': '' + defaultColor }">
<view
v-for="(item, index) in switchArr"
:key="index"
class="yjy-switch-item"
:class="{
'yjy-switch-selected': defaultValue == item.value ? true : false,
}"
@click="itemClick(item)"
:style="{
color: (defaultValue == item.value ? true : false) ? highColor : defaultColor,
background: (defaultValue == item.value ? true : false) ? defaultColor : '',
}"
>
<i v-if="switchType == 'icon'" class="uni-icon" :class="item.title"></i>
<view v-if="switchType == 'text'">{{ item.title }}</view>
</view>
</view>
</template>
<script>
export default {
name: 'chooseOne',
props: {
//int
defaultValue: {
type: Number,
default: 0,
},
//
itemIndex: {
type: Number,
default: 0,
},
//
highColor: {
type: String,
default: '#FFFFFF',
},
//
defaultColor: {
type: String,
default: '#30C58D',
},
//texticon
switchType: {
type: String,
default: 'text',
},
//
switchList: {
type: Array,
default: null,
},
},
data() {
return {
//
switchArr: [],
};
},
methods: {
itemClick(swithcSelectItem) {
if (this.defaultValue != swithcSelectItem.value) {
this.$emit('switchfunction', { swithcSelectItem, ...{ index: this.itemIndex } });
}
},
},
created() {
//
if (this.switchList.length > 0) {
for (let i = 0; i < this.switchList.length; i++) {
let arrItem = {
title: this.switchList[i].title,
value: this.switchList[i].value,
};
this.switchArr.push(arrItem);
}
}
},
};
</script>
<style lang="scss" scoped>
.yjy-switch-container {
padding: 2upx;
display: flex;
flex-direction: row;
border-radius: 100upx;
// border: 4upx solid $uni-color-primary;
padding: 6upx;
.yjy-switch-selected {
color: #ffffff;
border-radius: 40upx;
background: $uni-color-primary;
}
.yjy-switch-item {
color: $uni-color-primary;
font-size: 19upx;
width: 60upx;
height: 44upx;
display: flex;
justify-content: center;
border: 4upx solid;
border-radius: 100upx;
align-items: center;
transition: all 0.4s ease-in-out;
i {
font-size: $uni-font-size-lg;
}
}
}
</style>

@ -12,37 +12,74 @@
<view class="single">
<view class="single-left">
<view>rfid:</view>
<u-search placeholder="请扫描" v-model="orderNo" @search="query" :show-action="false"></u-search>
<u-search placeholder="请扫描" v-model="orderNo" :show-action="false"></u-search>
</view>
<view class="single-right">
<!-- <view class="single-right">
<u-button type="primary" @click="query"></u-button>
</view>
</view> -->
</view>
<u-form-item label="托盘码">
<u-search placeholder="请扫描托盘码" v-model="location" :show-action="false"></u-search>
</u-form-item>
<u-form-item>
<choose-one @switchfunction="switchChangeFun" :switchType="'text'" :defaultColor="'#4A72F9'" :highColor="'#FFFFFF'" :defaultValue="locationStatus" :switchList="switchListText"></choose-one>
</u-form-item>
<u-form-item>
<jPicker sureColor="#ff0000" @bindpicker="selectProductCode" showKey="label" valKey="value" :val="productCodeList.value" :options="model.DictList" />
</u-form-item>
</u-form>
<view class="bottom-bar">
<u-row class="button-bar">
<!-- 确定 -->
<u-col :span="6">
<u-button @click="query" type="primary">确定</u-button>
</u-col>
<!-- 返回 -->
<u-col :span="6">
<u-button type="error" @click="uni.navigateBack({})"></u-button>
</u-col>
</u-row>
</view>
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import model from './model';
import chooseOne from '@/components/choose-one/choose-one.vue';
import jPicker from '@/components/J-Picker/jPicker.vue';
//import { session } from '@/store/modules/session';
//import store from '@/store';
@Component({})
@Component({
components: {
chooseOne,
jPicker,
},
})
export default class PalletChange extends BasePage {
model = model;
switchListText = [
{
title: '置为正常',
value: 1,
},
{
title: '人工处理',
value: 0,
},
];
productCodeList: any = {};
// remove: any = {};
// async onReady() {
// await this.model.queryLocation();
// this.remove = this.model.WlList[0];
// }
async onReady() {
await this.model.getDictList();
//this.remove = this.model.WlList[0];
}
// selectItem(e: any) {
// this.remove = e.pickerName;
// }
orderNo: any = '';
location: any = '';
locationStatus: any = 1;
generateGUID() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = (Math.random() * 16) | 0,
@ -72,9 +109,18 @@ export default class PalletChange extends BasePage {
reqCode: this.generateGUID(),
reqTime: formattedDate,
location: this.location,
locationStatus: this.locationStatus,
productionState: this.productCodeList.value,
};
await this.model.palletInforUpdate(params);
}
switchChangeFun(e) {
//console.log(e);
this.locationStatus = e.swithcSelectItem.value;
}
async selectProductCode(e: any) {
this.productCodeList = e.pickerName;
}
}
</script>
<style lang="scss" scoped>
@ -161,5 +207,21 @@ export default class PalletChange extends BasePage {
}
}
}
.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;
}
::v-deep .yjy-switch-container .yjy-switch-item {
width: 100%;
}
::v-deep .yjy-switch-container {
width: 50%;
}
}
</style>

@ -36,6 +36,22 @@ export class PalletChange extends VuexModule {
const SubmitCode = result.code;
return { SubmitCode };
}
//缓存区下拉列表
DictList: any = [];
@MutationAction
async getDictList() {
const result: any = await http.get(url.lanjumes.product.getDictList, {
params: {
equipmentTypeCode: 'cache',
},
});
const DictListoild: [] = result.data;
const DictList = DictListoild.map((item: any) => ({
label: item.itemName,
value: item.itemCode,
}));
return { DictList };
}
}
export default getModule(PalletChange);

@ -241,6 +241,7 @@ export default class productCheckReceipt extends BasePage {
rfidNo: this.orderNo,
reqCode: this.generateGUID(),
reqTime: formattedDate,
currentStationNo: model.orderNoItemList.machineCode,
};
await this.model.sendDestinationStations(params);
}

@ -407,6 +407,7 @@ export const url = {
queryhandChecklist: '/dev-api/quality/handCheck/list',
sendDestinationStations: '/api/ReceivingAndFeedingMaterials/sendDestinationStations',
palletInforUpdate: '/api/ReceivingAndFeedingMaterials/palletInforUpdate',
getDictList: '/dev-api/quality/handCheck/getDictList',
},
},
lanjuwms: {

Loading…
Cancel
Save