guoshuang 3 years ago
commit 98fec879d5

@ -1,5 +1,15 @@
<!--
* @Author: zhou lei
* @Date: 2021-12-14 09:59:02
* @LastEditTime: 2022-01-20 11:53:51
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/src/App.vue
* 联系方式:910592680@qq.com 18669792120 科海达信息技术有限公司
-->
<script lang="ts"> <script lang="ts">
import Vue from 'vue'; import Vue from 'vue';
import MyMixin from './utils/mixin';
// #ifdef APP-PLUS // #ifdef APP-PLUS
import checkAppUpdate from '@/plugins/app-update'; import checkAppUpdate from '@/plugins/app-update';
// #endif // #endif

@ -1,7 +1,17 @@
import { Component, Vue } from "vue-property-decorator"; /*
import { page } from "@/utils/page"; * @Author: zhou lei
import { session } from "@/store/modules/session"; * @Date: 2021-11-08 17:12:53
import { image } from "@/utils/image"; * @LastEditTime: 2022-01-20 11:57:05
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/src/components/base/page.ts
* :910592680@qq.com 18669792120
*/
import { Component, Vue } from 'vue-property-decorator';
import { page } from '@/utils/page';
import { session } from '@/store/modules/session';
import { image } from '@/utils/image';
@Component @Component
export class BasePage extends Vue { export class BasePage extends Vue {
/** /**

@ -68,7 +68,7 @@ export default {
po_Supplier: '供应商', po_Supplier: '供应商',
po_OrderType: '订单类型', po_OrderType: '订单类型',
po_Location: '库存地点', po_Location: '库存地点',
SAPLocation:'所选物料没有SAP库位请重新选择', SAPLocation: '所选物料没有SAP库位请重新选择',
po_PleaseScan: '请扫描PO单号', po_PleaseScan: '请扫描PO单号',
po_PleaseScanMATcode: '请扫描物料条码', po_PleaseScanMATcode: '请扫描物料条码',
PleaseScan: '请扫描', PleaseScan: '请扫描',
@ -253,7 +253,7 @@ export default {
CommissionedDemandData: '需求数据', CommissionedDemandData: '需求数据',
CommissionedCumulativeData: '累计数据', CommissionedCumulativeData: '累计数据',
CommissionedLocation: '库位', CommissionedLocation: '库位',
CommissionedThisNumber: '本次数量', CommissionedThisNumber: '本次',
CommissionedNumber: '入库数量', CommissionedNumber: '入库数量',
CommissionedEntrantDetails: '入库明细', CommissionedEntrantDetails: '入库明细',
CommissionedReceiptQuantity: '收货数量', CommissionedReceiptQuantity: '收货数量',
@ -356,6 +356,7 @@ export default {
product_Tip7: '同一条码不可重复录入!', product_Tip7: '同一条码不可重复录入!',
product_Tip8: '扫码成功', product_Tip8: '扫码成功',
product_Tip9: '该条码未入库', product_Tip9: '该条码未入库',
repeatedly: '请勿重复添加',
//半成品冰箱下线 //半成品冰箱下线
product_unit1: '件/个', product_unit1: '件/个',
@ -386,6 +387,7 @@ export default {
product_Tip5: '条码不规范', product_Tip5: '条码不规范',
product_Tip6: '扫描出库数量不可大于物料总数', product_Tip6: '扫描出库数量不可大于物料总数',
product_StoListDetails: 'STO单明细', product_StoListDetails: 'STO单明细',
delete: '删除',
//领用借用 //领用借用
Warehouse_Tip1: '请输入DN单号', Warehouse_Tip1: '请输入DN单号',

@ -245,7 +245,7 @@ export default {
finishedProduct: 'Please select finished product code first', finishedProduct: 'Please select finished product code first',
CommissionedDemandData: 'Demand', CommissionedDemandData: 'Demand',
CommissionedCumulativeData: 'total', CommissionedCumulativeData: 'total',
CommissionedLocation: 'Location', CommissionedLocation: 'Loc',
CommissionedThisNumber: 'quantity', CommissionedThisNumber: 'quantity',
CommissionedNumber: 'Receipt quantity', CommissionedNumber: 'Receipt quantity',
CommissionedEntrantDetails: 'Warehousing', CommissionedEntrantDetails: 'Warehousing',
@ -353,6 +353,8 @@ export default {
product_FGDes: 'FG desc', product_FGDes: 'FG desc',
product_MaterialDes: 'MAT desc', product_MaterialDes: 'MAT desc',
product_Number: 'Qty', product_Number: 'Qty',
repeatedly: 'Do not add repeatedly',
delete: 'delete',
product_costCenter: 'Cost center', product_costCenter: 'Cost center',
product_Unit: 'Unit', product_Unit: 'Unit',
product_Cancel: 'Cancel', product_Cancel: 'Cancel',

@ -11,6 +11,7 @@
<u-image width="288rpx" height="85rpx" :src="image.global.logo1"></u-image> <u-image width="288rpx" height="85rpx" :src="image.global.logo1"></u-image>
<span>V1.6</span> <span>V1.6</span>
</view> </view>
<u-form class="form" :model="form" ref="form" :border-bottom="false" :error-type="['toast']"> <u-form class="form" :model="form" ref="form" :border-bottom="false" :error-type="['toast']">
<u-form-item <u-form-item
class="form-item" class="form-item"
@ -24,7 +25,7 @@
}" }"
><u-input ><u-input
v-model="form.username" v-model="form.username"
:placeholder="this.$t('message.PleaseInputUserName')" :placeholder="$t('message.PleaseInputUserName')"
placeholder-style="color: rgba(255, 255, 255, 0.36)" placeholder-style="color: rgba(255, 255, 255, 0.36)"
:custom-style="{ :custom-style="{
height: '88rpx', height: '88rpx',
@ -44,7 +45,7 @@
}" }"
><u-input ><u-input
v-model="form.password" v-model="form.password"
:placeholder="this.$t('message.PleaseInputPassword')" :placeholder="$t('message.PleaseInputPassword')"
type="password" type="password"
placeholder-style="color: rgba(255, 255, 255, 0.36)" placeholder-style="color: rgba(255, 255, 255, 0.36)"
:custom-style="{ :custom-style="{
@ -77,7 +78,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Ref } from 'vue-property-decorator'; import { Component, Ref, Watch } from 'vue-property-decorator';
import { server } from '@/pages/login/server/model'; import { server } from '@/pages/login/server/model';
import Alerts from '@/components/alert/alerts.vue'; import Alerts from '@/components/alert/alerts.vue';
import { page } from '@/utils/page'; import { page } from '@/utils/page';
@ -87,10 +88,13 @@ import { VForm } from 'vue/types/form';
import { Lang } from '@/i18n'; import { Lang } from '@/i18n';
import { url } from '@/utils/url'; import { url } from '@/utils/url';
import { path } from 'lodash/fp'; import { path } from 'lodash/fp';
// mixin
import MyMixins from '@/utils/mixin';
// import { any } from 'lodash/fp'; // import { any } from 'lodash/fp';
@Component({ @Component({
components: { Alerts }, components: { Alerts },
mixins: [MyMixins],
}) })
export default class LoginPage extends BasePage { export default class LoginPage extends BasePage {
/** /**
@ -108,6 +112,14 @@ export default class LoginPage extends BasePage {
return server.serverAddress; return server.serverAddress;
} }
//
username = '';
@Watch('username')
typeNum() {
this.$nextTick(() => {
this.username = this.username.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');
});
}
form = { form = {
username: '', username: '',
password: '', password: '',

@ -152,7 +152,11 @@ export default class dnReceiptDom extends BasePage {
} }
// //
async query() { async query() {
this.empty(); this.list = [];
this.wlCode = '';
this.nowAmount = '';
this.every = '';
this.materialList = [];
if (this.form.documentNo == '') { if (this.form.documentNo == '') {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
@ -187,6 +191,13 @@ export default class dnReceiptDom extends BasePage {
} }
// //
Add() { Add() {
if (!this.every) {
uni.showToast({
icon: 'none',
title: this.$t('message.Commission_tips6') as any,
});
return;
}
if (this.nowAmount == '' || this.wlCode == '') { if (this.nowAmount == '' || this.wlCode == '') {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
@ -214,10 +225,15 @@ export default class dnReceiptDom extends BasePage {
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
let arr = { let arr = {
poNo: this.form.documentNo,
materialCode: this.every.materialCode,
loginName: this.session.loginName,
factoryCode: this.session.factoryCode,
wlCode: this.wlCode.label, wlCode: this.wlCode.label,
nowAmount: this.nowAmount, nowAmount: this.nowAmount,
}; };
this.list.push(arr); this.list.push(arr);
console.log('this.list', this.list);
this.business(); this.business();
} else if (res.cancel) { } else if (res.cancel) {
return; return;
@ -226,15 +242,21 @@ export default class dnReceiptDom extends BasePage {
}); });
} else { } else {
let arr = { let arr = {
poNo: this.form.documentNo,
materialCode: this.every.materialCode,
loginName: this.session.loginName,
factoryCode: this.session.factoryCode,
wlCode: this.wlCode.label, wlCode: this.wlCode.label,
nowAmount: this.nowAmount, nowAmount: this.nowAmount,
}; };
this.list.push(arr); this.list.push(arr);
console.log('this.list', this.list);
this.business(); this.business();
} }
} }
deleteItem(index: any) { deleteItem(index: any) {
this.list.splice(index, 1); this.list.splice(index, 1);
console.log('this.list', this.list);
this.business(); this.business();
} }
async onSubmit() { async onSubmit() {
@ -244,14 +266,14 @@ export default class dnReceiptDom extends BasePage {
title: this.$t('message.Commission_tips5') as any, title: this.$t('message.Commission_tips5') as any,
}); });
} }
let upload = { // let upload = {
poNo: this.form.documentNo, // poNo: this.form.documentNo,
materialCode: this.every.materialCode, // materialCode: this.every.materialCode,
loginName: session.loginName, // loginName: session.loginName,
factoryCode: session.factoryCode, // factoryCode: session.factoryCode,
list: this.list, // list: this.list,
}; // };
await this.model.submitOutsourcing(upload); await this.model.submitOutsourcing(this.list);
this.empty(); this.empty();
} }
async bill() { async bill() {

@ -1,14 +1,8 @@
import { import { Action, getModule, Module, MutationAction, VuexModule } from 'vuex-module-decorators';
Action, import store from '@/store';
getModule, import http from '@/utils/request';
Module, import { url } from '@/utils/url';
MutationAction, import { session } from '@/store/modules/session';
VuexModule,
} from "vuex-module-decorators";
import store from "@/store";
import http from "@/utils/request";
import { url } from "@/utils/url";
import { session } from "@/store/modules/session";
// import vm from '@/main'; // import vm from '@/main';
class OrderInInfo { class OrderInInfo {
@ -23,7 +17,7 @@ class OrderInInfo {
namespaced: true, namespaced: true,
dynamic: true, dynamic: true,
store, store,
name: "product.outbound.stoOutbound", name: 'product.outbound.stoOutbound',
}) })
export class ReturningModule extends VuexModule { export class ReturningModule extends VuexModule {
/** /**
@ -43,7 +37,7 @@ export class ReturningModule extends VuexModule {
*/ */
orderInInfo: OrderInInfo = new OrderInInfo(); orderInInfo: OrderInInfo = new OrderInInfo();
//记账按钮的code码 //记账按钮的code码
code = ""; code = '';
/** /**
* *
* @param orderNo * @param orderNo
@ -99,15 +93,12 @@ export class ReturningModule extends VuexModule {
*/ */
@Action @Action
async materialComplete(form: any) { async materialComplete(form: any) {
const res = await http.post( const res = await http.post(url.material.commission.goOut.materialComplete, {
url.material.commission.goOut.materialComplete, factoryCode: session.factoryCode,
{ loginName: session.loginName,
factoryCode: session.factoryCode, ...form,
loginName: session.loginName, });
...form, console.log(res, '>>>>>res');
}
);
console.log(res, ">>>>>res");
} }
/** /**
@ -120,15 +111,12 @@ export class ReturningModule extends VuexModule {
loginName: session.loginName, loginName: session.loginName,
}; };
let oneMaterielDetail: any = {}; let oneMaterielDetail: any = {};
const { data }: any = await http.post( const { data }: any = await http.post(url.outbound.stoOutbound.checkScan, obj);
url.outbound.stoOutbound.checkScan, console.log('shneme a ', data.records);
obj
);
console.log("shneme a ", data.records);
oneMaterielDetail = data.records[0]; oneMaterielDetail = data.records[0];
data.records[0].materialCode = list[0].productCode; data.records[0].materialCode = list[0].productCode;
data.records[0].materialDesc = list[0].productDescZh; data.records[0].materialDesc = list[0].productDescZh;
console.log("aaaaa", oneMaterielDetail); console.log('aaaaa', oneMaterielDetail);
return oneMaterielDetail; return oneMaterielDetail;
} }
/** /**
@ -137,11 +125,8 @@ export class ReturningModule extends VuexModule {
*/ */
@MutationAction @MutationAction
async confirm(list: any[]) { async confirm(list: any[]) {
const { code, data } = await http.post( const { code, data } = await http.post(url.outbound.stoOutbound.Bookkeeping, list);
url.outbound.stoOutbound.Bookkeeping, console.log('res数据', data, code);
list
);
console.log("res数据", data, code);
// if (code == '1') { // if (code == '1') {
// uni.showToast({ icon: 'success', title: msg }); // uni.showToast({ icon: 'success', title: msg });
// } else { // } else {
@ -150,13 +135,11 @@ export class ReturningModule extends VuexModule {
const materielList: any = []; const materielList: any = [];
return { code, materielList }; return { code, materielList };
} }
//委外出库 初始化获取库位
@Action({ commit: "updateCheckedOrderInInfoListKw" }) @Action({ commit: 'updateCheckedOrderInInfoListKw' })
async queryByFactoryCodeAndWorkAreaCode(content: any) { async queryByFactoryCodeAndWorkAreaCode(content: any) {
let res = await http.post( let res = await http.post('/wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content);
"/wmspda/fg/queryByFactoryCodeAndWorkAreaCode", console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', res);
content
);
return res; return res;
} }
@ -172,20 +155,14 @@ export class ReturningModule extends VuexModule {
@Action @Action
async submitOutsourcing(upload: any) { async submitOutsourcing(upload: any) {
let res = await http.post( let res = await http.post(url.outbound.stoOutbound.materialComplete, upload);
url.outbound.stoOutbound.materialComplete,
upload
);
return res; return res;
} }
//查询明细 //查询明细
@Action({ commit: "updateCheckedOrderInInfoListKw" }) @Action({ commit: 'updateCheckedOrderInInfoListKw' })
async querydetaildlist(content: any) { async querydetaildlist(content: any) {
let res: any = await http.post( let res: any = await http.post('/wmspda/material/outsourcing/outInfo', content);
"/wmspda/material/outsourcing/outInfo", console.log('明细》》》》》》》》》', res.list);
content
);
console.log("明细》》》》》》》》》", res.list);
this.detailedList = res.data; this.detailedList = res.data;
return res; return res;
} }

@ -55,7 +55,7 @@
<view class="library"> <view class="library">
<view class="library-left"> <view class="library-left">
<view>{{ $t('message.CommissionedLocation') }}</view> <view>{{ $t('message.CommissionedLocation') }}</view>
<jPicker sureColor="#ff0000" style="width: 230rpx" @bindpicker="LocationChoice" showKey="value" valKey="value" :val="wl.value" class="search" :options="newLocation" /> <jPicker sureColor="#ff0000" style="width: 230rpx" @bindpicker="LocationChoice" showKey="value" valKey="value" :val="wl.value" class="search" :options="Location" />
</view> </view>
<view class="library-right"> <view class="library-right">
<view class="library-right-title">{{ $t('message.CommissionedThisNumber') }}</view> <view class="library-right-title">{{ $t('message.CommissionedThisNumber') }}</view>
@ -66,21 +66,7 @@
<view class="add"> <view class="add">
<u-button type="primary" @click="Add">{{ $t('message.product_add') }}</u-button> <u-button type="primary" @click="Add">{{ $t('message.product_add') }}</u-button>
</view> </view>
<!-- 表格 --> <wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="headers" :contents="LocationList" :show-vert-border="false" @onCellClick="deleteItem($event)"></wyb-table>
<u-table class="library-table">
<u-tr class="u-tr">
<u-th class="u-th">{{ $t('message.product_Location') }}</u-th>
<u-th class="u-th">{{ $t('message.product_Number') }}</u-th>
<u-th class="u-th">{{ $t('message.operation') }}</u-th>
</u-tr>
<u-tr class="u-tr" v-for="(item, index) in LocationList" :key="index">
<u-td class="u-td">{{ item.wlCode }}</u-td>
<u-td class="u-td">{{ item.receiptAmount }}</u-td>
<u-td class="u-td">
<u-button type="error" size="small" style="font-size: 20px" @click="deleteItem(index)">{{ $t('message.product_Delete') }}</u-button>
</u-td>
</u-tr>
</u-table>
</view> </view>
<!-- 底部按钮 --> <!-- 底部按钮 -->
<view class="bottom-bar"> <view class="bottom-bar">
@ -99,12 +85,13 @@
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Ref } from 'vue-property-decorator'; import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page'; import { BasePage } from '@/components/base/page';
import jPicker from '@/components/J-Picker/jPicker.vue'; import jPicker from '@/components/J-Picker/jPicker.vue';
import { session } from '@/store/modules/session'; import { session } from '@/store/modules/session';
import { VForm, VFormRules } from 'vue/types/form';
import model from './model'; import model from './model';
import LocationDetail from './model.location';
import { headers } from './config';
@Component({ @Component({
components: { components: {
jPicker, jPicker,
@ -115,27 +102,27 @@ export default class dnReceiptDom extends BasePage {
form: any = { form: any = {
documentNo: '', documentNo: '',
}; };
//
material: any = []; material: any = [];
poList: any = []; poList: any = [];
materialList: any = []; materialList: any = [];
//
every: any = {}; every: any = {};
value = ''; value = '';
headers = headers;
type = 'text'; type = 'text';
//
DNReceivingList: any = [];
//
DNReceivingListIndex: any = null;
border = true; border = true;
//
//Cumulative: any = 0;
//
//sendSpotList: any = [];
// //
receiptAmount: any = ''; receiptAmount: any = '';
// //
Location: any = []; Location: LocationDetail[] = [];
// //
newLocation: any = [];
//
LocationList: any = []; LocationList: any = [];
DNReceivingListIndex: any = null; //
//
wl: any = { wl: any = {
value: null, value: null,
}; };
@ -143,13 +130,12 @@ export default class dnReceiptDom extends BasePage {
poNo: any = null; poNo: any = null;
// //
requestAmount: number = null; requestAmount: number = null;
//
upload: any = [];
//
async onReady() {}
// //
// //
async initLocation() { async initLocation(condition): Promise<LocationDetail[]> {
console.log('condition>>>>>>>>>>>>>>>>>>.', condition);
//
let list: Array<LocationDetail> = [];
let means: any = JSON.parse(localStorage.getItem('__GWMS_APP_STATE_DATA__') as any); let means: any = JSON.parse(localStorage.getItem('__GWMS_APP_STATE_DATA__') as any);
let sendSpot = JSON.parse(localStorage.getItem('sendSpot') as any); let sendSpot = JSON.parse(localStorage.getItem('sendSpot') as any);
let content = { let content = {
@ -159,27 +145,28 @@ export default class dnReceiptDom extends BasePage {
workArea: session.workareaCode, workArea: session.workareaCode,
}; };
let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content); let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content);
res.forEach((item: any) => { console.log('>>>>>>>>>>>>>>', res);
console.log('res is:', res); res.forEach((item: LocationDetail) => {
let pickerName: any = {}; if (item.sendSpot === condition.sendSpot) {
pickerName.label = item.locationCode; let pickerName: any = {};
pickerName.value = item.locationCode + '(' + item.sendSpot + ')'; pickerName.label = item.locationCode;
pickerName.sendSpot = item.sendSpot; pickerName.value = item.locationCode + '(' + item.sendSpot + ')';
this.Location.push(pickerName); pickerName.sendSpot = item.sendSpot;
list.push(pickerName);
}
}); });
return list;
} }
// //
async query() { async query() {
if (this.form.documentNo == '') { if (!this.form.documentNo) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: this.$t('message.Commission_tips1') as any, title: this.$t('message.Commission_tips1') as any,
}); });
return; return;
} }
// await this.model.ImportQueryOrderInfo(this.form.documentNo.trim());
this.initLocation();
await this.model.ImportQueryOrderInfo(this.form.documentNo);
if (model.code == '1') { if (model.code == '1') {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
@ -189,7 +176,7 @@ export default class dnReceiptDom extends BasePage {
let list: any = localStorage.getItem('list'); let list: any = localStorage.getItem('list');
localStorage.removeItem('list'); localStorage.removeItem('list');
this.material = JSON.parse(list); this.material = JSON.parse(list);
this.poList = [...this.material]; this.poList = [...this.material]; //
let arr = this.removeDuplicates(this.poList, 'poNo'); let arr = this.removeDuplicates(this.poList, 'poNo');
// //
arr.forEach((item: any) => { arr.forEach((item: any) => {
@ -215,7 +202,7 @@ export default class dnReceiptDom extends BasePage {
}, []); }, []);
return arr; return arr;
} }
// ADD list // ADD
totalLocation(list: []) { totalLocation(list: []) {
const receiptAmount = list.reduce((total: number, nextItem: any): any => { const receiptAmount = list.reduce((total: number, nextItem: any): any => {
return total + +nextItem.receiptAmount; return total + +nextItem.receiptAmount;
@ -235,42 +222,23 @@ export default class dnReceiptDom extends BasePage {
return true; return true;
} }
}); });
// this.material.forEach((item: any) => {
// if (item.poNo == e.pickerName.value) {
// let pickerName: any = {};
// pickerName.label = item.materialCode;
// pickerName.value = item.materialCode;
// this.materialList.push(pickerName);
// }
// });
// //
this.materialChoice({ this.materialChoice({
pickerName: this.materialList.find(() => true), pickerName: this.materialList.find(() => true),
}); });
} }
// receiptAmount requestAmount every= // receiptAmount requestAmount
materialChoice(e: any) { async materialChoice(e: any) {
// //
this.every = { ...e.pickerName }; this.every = { ...e.pickerName };
if (this.DNReceivingListIndex == null) { //
this.model.ImportDNReceivingList.push(this.every); this.Location = [];
} //
this.model.ImportDNReceivingList.forEach((item: any, index: any) => { this.Location = await this.initLocation(this.every);
if (item.poLine == this.every.poLine || item.materialCode == this.every.materialCode || item.dnNo == this.every.dnNo) {
this.DNReceivingListIndex = index; //
}
});
this.model.ImportDNReceivingList.forEach((item: any, index: any) => {
if (item.poLine != this.every.poLine || item.materialCode != this.every.materialCode || item.dnNo != this.every.dnNo) {
this.model.ImportDNReceivingList.push(this.every);
this.DNReceivingListIndex = index + 1;
}
});
this.newLocation = [];
this.newLocation = this.Location.filter((item: any) => item.sendSpot === this.every.sendSpot);
console.log('newLoction', this.newLocation);
this.LocationChoice({ this.LocationChoice({
pickerName: this.newLocation.find(() => true), pickerName: this.Location.find(() => true),
}); });
} }
// //
@ -279,9 +247,8 @@ export default class dnReceiptDom extends BasePage {
} }
// //
Add() { Add() {
//count
const count = this.totalLocation(this.LocationList); const count = this.totalLocation(this.LocationList);
if (this.receiptAmount == '' || this.wl.value == '') { if (this.receiptAmount == '' || !this.wl.value) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: this.$t('message.Commission_tips2') as any, title: this.$t('message.Commission_tips2') as any,
@ -302,48 +269,70 @@ export default class dnReceiptDom extends BasePage {
}); });
return; return;
} }
// return
let isTrue = this.LocationList.some((item) => item.wlCode !== this.wl.label);
//add???
if (isTrue) {
uni.showToast({
icon: 'none',
title: this.$t('message._tips5') as any,
});
return;
}
//aad
this.LocationList.push({ this.LocationList.push({
...this.every, ...this.every,
wlCode: this.wl.label, wlCode: this.wl.label,
receiptAmount: this.receiptAmount, receiptAmount: this.receiptAmount,
}); });
this.model.ImportDNReceivingList[this.DNReceivingListIndex].wllist.push(this.LocationList); this.every.wllist = [];
// if (this.DNReceivingList.length == 0) {
this.DNReceivingList.push(this.every);
this.DNReceivingList[0].wllist.push(this.LocationList[this.LocationList.length - 1]);
} else {
let isTrue: any = false;
let wllistIsTrue: any = false;
this.DNReceivingList.forEach((item: any, index: any) => {
if (item.poNo == this.every.poNo || item.poLine == this.every.poLine || item.materialCode == this.every.materialCode) {
isTrue = true;
this.DNReceivingListIndex = index;
item.wllist.forEach((item: any) => {
if (item.poNo == this.LocationList.poNo || item.poLine == this.LocationList.poLine || item.materialCode == this.LocationList.materialCode || item.wlCode == this.LocationList.wlCode || item.receiptAmount == this.LocationList.receiptAmount) {
wllistIsTrue = true;
}
});
}
});
if (isTrue == false) {
this.DNReceivingList.push(this.every);
this.DNReceivingList[this.DNReceivingList.length - 1].wllist.push(this.LocationList[this.LocationList.length - 1]);
}
if (isTrue == true || wllistIsTrue == true) {
uni.showToast({
icon: 'none',
title: this.$t('message.repeatedly') as any,
});
}
if (isTrue == true || wllistIsTrue == false) {
this.DNReceivingList[this.DNReceivingListIndex].wllist.push(this.LocationList[this.LocationList.length - 1]);
}
isTrue = false;
wllistIsTrue = false;
}
this.receiptAmount = ''; this.receiptAmount = '';
//true
isTrue = true;
this.business(); this.business();
} }
deleteItem(indexItem: any) { deleteItem(e: any) {
let Item: any = {}; console.log('data', e.lineData);
this.model.ImportDNReceivingList.forEach((item: any) => { uni.showModal({
if (item.poLine == this.every.poLine || item.materialCode == this.every.materialCode || item.dnNo == this.every.dnNo) { title: this.$t('message.delete') as any,
Item = item; cancelText: this.$t('message.Cancel') as any,
} confirmText: this.$t('message.workArea_Confirm') as any,
}); success: (res) => {
Item.wllist.forEach((item: any, index: any) => { if (res.confirm) {
if (item.poLine == this.LocationList[indexItem].poLine || item.materialCode == this.LocationList[indexItem].materialCode || item.dnNo == this.LocationList[indexItem].dnNo) { this.DNReceivingList.forEach((item: any) => {
Item.wllist.splice(index, 1); if (item.poNo == e.lineData.poNo || item.poLine == e.lineData.poLine || item.materialCode == e.lineData.materialCode) {
} item.wllist.forEach((item: any, index: any) => {
}); if (item.poNo == e.lineData.poNo || item.poLine == e.lineData.poLine || item.materialCode == e.lineData.materialCode || item.wlCode == e.lineData.wlCode || item.receiptAmount == e.lineData.receiptAmount) {
//splice item.wllist.splice(index, 1);
this.LocationList.splice(indexItem, 1); }
this.business(); });
// guoshuang }
uni.showToast({ });
icon: 'none', this.LocationList.splice(e.contentIndex, 1);
title: this.$t('message.success') as any, } else if (res.cancel) {
return;
}
},
}); });
} }
// //
@ -353,7 +342,6 @@ export default class dnReceiptDom extends BasePage {
this.LocationList = []; this.LocationList = [];
// //
this.Location = []; this.Location = [];
this.newLocation = [];
this.poNo = ''; this.poNo = '';
this.poList = []; this.poList = [];
// //
@ -362,10 +350,14 @@ export default class dnReceiptDom extends BasePage {
}; };
// //
this.every = {}; this.every = {};
//
// this.material = [];
// //
this.materialList = []; this.materialList = [];
// //
this.receiptAmount = null; this.receiptAmount = null;
this.DNReceivingList = [];
await this.query(); await this.query();
} }
async onSubmit() { async onSubmit() {
@ -376,9 +368,12 @@ export default class dnReceiptDom extends BasePage {
}); });
return null; return null;
} }
// let obj = {
this.every.wllist = this.LocationList; factoryCode: this.session.factoryCode,
await this.model.submitOrderInEnter(this.model.ImportDNReceivingList); loginName: this.session.loginName,
list: this.DNReceivingList,
};
await this.model.submitOrderInEnter(obj);
this.resetForm(); this.resetForm();
} }
async bill() { async bill() {
@ -395,9 +390,9 @@ export default class dnReceiptDom extends BasePage {
dnNo: this.form.documentNo, dnNo: this.form.documentNo,
}; };
await this.model.querydetaildlist(content); await this.model.querydetaildlist(content);
this.redirectTo(this.page.raw.ingoods.dnReceipt.Local); this.toPage(this.page.raw.ingoods.dnReceipt.Local);
} }
// totalLocationtotalLocationsome //
business() { business() {
this.every.receiptAmount = this.totalLocation(this.LocationList); this.every.receiptAmount = this.totalLocation(this.LocationList);
} }
@ -471,11 +466,25 @@ export default class dnReceiptDom extends BasePage {
height: 100%; height: 100%;
display: flex; display: flex;
view { view {
width: 200rpx; width: 140rpx;
line-height: 100rpx; line-height: 100rpx;
} }
} }
} }
// .material {
// width: 100%;
// height: 100rpx;
// display: flex;
// .material-left {
// width: 100%;
// height: 100%;
// display: flex;
// view {
// width: 100rpx;
// line-height: 100rpx;
// }
// }
// }
.material { .material {
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
@ -485,15 +494,11 @@ export default class dnReceiptDom extends BasePage {
height: 100%; height: 100%;
display: flex; display: flex;
view { view {
width: 100rpx; width: 140rpx;
line-height: 100rpx; line-height: 100rpx;
text-align: left;
} }
} }
}
.material {
width: 100%;
height: 100rpx;
display: flex;
.material-right { .material-right {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -538,6 +543,7 @@ export default class dnReceiptDom extends BasePage {
.number-right-title { .number-right-title {
width: 140rpx; width: 140rpx;
height: 100%; height: 100%;
text-align: center;
line-height: 100rpx; line-height: 100rpx;
} }
.input { .input {

@ -4,30 +4,35 @@
import vm from '@/main'; import vm from '@/main';
export const headers = [ export const headers = [
{ {
label: vm.$t('message.po_MaterielNo'), label: vm.$t('message.Line'),
key: 'materialCode', key: 'poLine',
}, },
{ {
label: vm.$t('message.po_MaterielDes'), label: vm.$t('message.po_OddNumbers'),
key: 'materialDesc', key: 'poNo',
width: 350, width: 350,
}, },
{ {
label: vm.$t('message.po_DemandQuantity'), label: vm.$t('message.Pi_materielNo'),
key: 'requestAmount', key: 'materialCode',
width: 350,
}, },
{ {
label: vm.$t('message.po_ActualQuantity'), label: vm.$t('message.CommissionedLocation'),
key: 'wlCode',
},
{
label: vm.$t('message.product_Number'),
key: 'receiptAmount', key: 'receiptAmount',
}, },
// { // {
// label: vm.$t('message.po_RemainingQuantity'), // label: vm.$t('message.po_RemainingQuantity'),
// key: 'splitAmount', // key: 'splitAmount',
// }, // },
{ // {
label: vm.$t('message.po_Location'), // label: vm.$t('message.po_Location'),
key: 'location', // key: 'location',
}, // },
// { // {
// label: '物料详情', // label: '物料详情',
// key: 'materialDesc', // key: 'materialDesc',

@ -66,21 +66,7 @@
<view class="add"> <view class="add">
<u-button type="primary" @click="Add">{{ $t('message.product_add') }}</u-button> <u-button type="primary" @click="Add">{{ $t('message.product_add') }}</u-button>
</view> </view>
<!-- 表格 --> <wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="headers" :contents="LocationList" :show-vert-border="false" @onCellClick="deleteItem($event)"></wyb-table>
<u-table class="library-table">
<u-tr class="u-tr">
<u-th class="u-th">{{ $t('message.product_Location') }}</u-th>
<u-th class="u-th">{{ $t('message.product_Number') }}</u-th>
<u-th class="u-th">{{ $t('message.operation') }}</u-th>
</u-tr>
<u-tr class="u-tr" v-for="(item, index) in LocationList" :key="index">
<u-td class="u-td">{{ item.wlCode }}</u-td>
<u-td class="u-td">{{ item.receiptAmount }}</u-td>
<u-td class="u-td">
<u-button type="error" size="small" style="font-size: 20px" @click="deleteItem(index)">{{ $t('message.product_Delete') }}</u-button>
</u-td>
</u-tr>
</u-table>
</view> </view>
<!-- 底部按钮 --> <!-- 底部按钮 -->
<view class="bottom-bar"> <view class="bottom-bar">
@ -105,6 +91,7 @@ import jPicker from '@/components/J-Picker/jPicker.vue';
import { session } from '@/store/modules/session'; import { session } from '@/store/modules/session';
import model from './model'; import model from './model';
import LocationDetail from './model.location'; import LocationDetail from './model.location';
import { headers } from './config';
@Component({ @Component({
components: { components: {
jPicker, jPicker,
@ -122,7 +109,12 @@ export default class dnReceiptDom extends BasePage {
// //
every: any = {}; every: any = {};
value = ''; value = '';
headers = headers;
type = 'text'; type = 'text';
//
DNReceivingList: any = [];
allNum: any = 0;
//
DNReceivingListIndex: any = null; DNReceivingListIndex: any = null;
border = true; border = true;
// //
@ -139,6 +131,7 @@ export default class dnReceiptDom extends BasePage {
poNo: any = null; poNo: any = null;
// //
requestAmount: number = null; requestAmount: number = null;
<<<<<<< HEAD
//receiptAmount = (this.receiptAmount.match(/\d+(.\d{0,2})?/) || [''])[0]; //receiptAmount = (this.receiptAmount.match(/\d+(.\d{0,2})?/) || [''])[0];
async onReady() { async onReady() {
this.model.DNReceivingList = []; this.model.DNReceivingList = [];
@ -148,6 +141,8 @@ export default class dnReceiptDom extends BasePage {
input() { input() {
this.receiptAmount = (this.receiptAmount.match(/\d+(.\d{0,2})?/) || [''])[0]; this.receiptAmount = (this.receiptAmount.match(/\d+(.\d{0,2})?/) || [''])[0];
} }
=======
>>>>>>> e06fba98009bdb7923f4a67091d1f3e4224bdb07
// //
// //
async initLocation(condition): Promise<LocationDetail[]> { async initLocation(condition): Promise<LocationDetail[]> {
@ -163,6 +158,7 @@ export default class dnReceiptDom extends BasePage {
workArea: session.workareaCode, workArea: session.workareaCode,
}; };
let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content); let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content);
console.log('>>>>>>>>>>>>>>', res);
res.forEach((item: LocationDetail) => { res.forEach((item: LocationDetail) => {
if (item.sendSpot === condition.sendSpot) { if (item.sendSpot === condition.sendSpot) {
let pickerName: any = {}; let pickerName: any = {};
@ -191,12 +187,6 @@ export default class dnReceiptDom extends BasePage {
}); });
} }
let list: any = localStorage.getItem('list'); let list: any = localStorage.getItem('list');
// if (list) {
// uni.showToast({
// icon: 'none',
// title: this.$t('message.success') as any,
// });
// }
localStorage.removeItem('list'); localStorage.removeItem('list');
this.material = JSON.parse(list); this.material = JSON.parse(list);
this.poList = [...this.material]; // this.poList = [...this.material]; //
@ -234,6 +224,7 @@ export default class dnReceiptDom extends BasePage {
} }
// //
poListChoice(e: any) { poListChoice(e: any) {
this.receiptAmount = '';
this.poNo = e.pickerName.value; this.poNo = e.pickerName.value;
// //
this.materialList = JSON.parse(JSON.stringify(this.removeDuplicates(this.material, 'materialCode'))); this.materialList = JSON.parse(JSON.stringify(this.removeDuplicates(this.material, 'materialCode')));
@ -252,23 +243,15 @@ export default class dnReceiptDom extends BasePage {
} }
// receiptAmount requestAmount // receiptAmount requestAmount
async materialChoice(e: any) { async materialChoice(e: any) {
this.receiptAmount = '';
// //
this.every = { ...e.pickerName }; this.every = { ...e.pickerName };
if (this.DNReceivingListIndex == null) { this.LocationList.forEach((item: any) => {
this.model.DNReceivingList.push(this.every); if (item.poNo == this.every.poNo || item.poLine == this.every.poLine || item.materialCode == this.every.materialCode) {
} this.every.receiptAmount += parseFloat(item.receiptAmount);
this.model.DNReceivingList.forEach((item: any, index: any) => {
if (item.poLine == this.every.poLine || item.materialCode == this.every.materialCode || item.dnNo == this.every.dnNo) {
this.DNReceivingListIndex = index;
} }
}); });
this.model.DNReceivingList.forEach((item: any, index: any) => { this.every.wllist = [];
if (item.poLine != this.every.poLine || item.materialCode != this.every.materialCode || item.dnNo != this.every.dnNo) {
this.model.DNReceivingList.push(this.every);
this.DNReceivingListIndex = index + 1;
}
});
console.log('this.model.DNReceivingList', this.model.DNReceivingList);
// //
this.Location = []; this.Location = [];
// //
@ -285,7 +268,9 @@ export default class dnReceiptDom extends BasePage {
} }
// //
Add() { Add() {
const count = this.totalLocation(this.LocationList); // const count = this.totalLocation(this.LocationList);
const count = parseFloat(this.every.requestAmount);
console.log('count', count);
if (this.receiptAmount == '' || !this.wl.value) { if (this.receiptAmount == '' || !this.wl.value) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
@ -300,52 +285,108 @@ export default class dnReceiptDom extends BasePage {
}); });
return; return;
} }
if (parseFloat(this.receiptAmount) > this.every.requestAmount || +this.receiptAmount + count > this.every.requestAmount) { if (parseFloat(this.receiptAmount) > this.every.requestAmount || parseFloat(this.receiptAmount) + parseFloat(this.every.receiptAmount) > count) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: this.$t('message.Commission_tips4') as any, title: this.$t('message.Commission_tips4') as any,
}); });
console.log('2333');
console.log('parseFloat(this.every.this.receiptAmount)', this.receiptAmount + parseFloat(this.every.receiptAmount));
return; return;
} }
// return
let isTrue = this.LocationList.some((item) => item.wlCode !== this.wl.label);
// if (isTrue) {
// uni.showToast({
// icon: 'none',
// title: this.$t('message._tips5') as any,
// });
// return;
// }
this.LocationList.push({ this.LocationList.push({
...this.every, ...this.every,
wlCode: this.wl.label, wlCode: this.wl.label,
receiptAmount: this.receiptAmount, receiptAmount: this.receiptAmount,
}); });
this.model.DNReceivingList[this.DNReceivingListIndex].wllist.push(this.LocationList); if (this.DNReceivingList.length != 0) {
let isTrue: any = false;
let wllistIsTrue: any = false;
this.DNReceivingList.forEach((item: any, index: any) => {
if (item.poNo == this.every.poNo && item.poLine == this.every.poLine && item.materialCode == this.every.materialCode) {
isTrue = true;
this.DNReceivingListIndex = index;
}
});
console.log('isTrue', isTrue);
if (isTrue == true) {
this.DNReceivingList[this.DNReceivingListIndex].wllist.forEach((item: any) => {
if (item.poNo == this.LocationList[this.LocationList.length - 1].poNo && item.poLine == this.LocationList[this.LocationList.length - 1].poLine && item.materialCode == this.LocationList[this.LocationList.length - 1].materialCode && item.wlCode == this.LocationList[this.LocationList.length - 1].wlCode && item.receiptAmount == this.LocationList[this.LocationList.length - 1].receiptAmount) {
wllistIsTrue = true;
}
});
console.log('wllistIsTrue', wllistIsTrue);
}
console.log(1);
if (isTrue == false) {
this.DNReceivingList.push(this.every);
this.DNReceivingList[this.DNReceivingList.length - 1].wllist.push(this.LocationList[this.LocationList.length - 1]);
console.log('this.DNReceivingList', this.DNReceivingList);
isTrue = false;
wllistIsTrue = false;
this.receiptAmount = '';
return;
}
if (isTrue == true || wllistIsTrue == true) {
uni.showToast({
icon: 'none',
title: this.$t('message.repeatedly') as any,
});
// this.LocationList.splice(this.LocationList[this.LocationList.length - 1], 1);
this.LocationList.pop();
console.log('this.DNReceivingList', this.DNReceivingList);
isTrue = false;
wllistIsTrue = false;
this.receiptAmount = '';
return;
}
if (isTrue == true || wllistIsTrue == false) {
this.DNReceivingList[this.DNReceivingListIndex].wllist.push(this.LocationList[this.LocationList.length - 1]);
console.log('this.DNReceivingList', this.DNReceivingList);
isTrue = false;
wllistIsTrue = false;
this.receiptAmount = '';
return;
}
isTrue = false;
wllistIsTrue = false;
this.DNReceivingListIndex = null;
}
if (this.DNReceivingList.length == 0) {
this.DNReceivingList.push(this.every);
this.DNReceivingList[0].wllist.push(this.LocationList[this.LocationList.length - 1]);
console.log('this.DNReceivingList', this.DNReceivingList);
this.DNReceivingListIndex = null;
}
this.receiptAmount = ''; this.receiptAmount = '';
isTrue = true;
// this.addition();
this.business(); this.business();
} }
deleteItem(indexItem: any) { deleteItem(e: any) {
let Item: any = {}; console.log('data', e.lineData);
this.model.DNReceivingList.forEach((item: any) => { uni.showModal({
if (item.poLine == this.every.poLine || item.materialCode == this.every.materialCode || item.dnNo == this.every.dnNo) { title: this.$t('message.delete') as any,
Item = item; cancelText: this.$t('message.Cancel') as any,
} confirmText: this.$t('message.workArea_Confirm') as any,
}); success: (res) => {
Item.wllist.forEach((item: any, index: any) => { if (res.confirm) {
if (item.poLine == this.LocationList[indexItem].poLine || item.materialCode == this.LocationList[indexItem].materialCode || item.dnNo == this.LocationList[indexItem].dnNo) { let DNIndex: any;
Item.wllist.splice(index, 1); let nemIndex: any;
} this.DNReceivingList.forEach((item: any, index: any) => {
}); if (item.poNo == e.lineData.poNo || item.poLine == e.lineData.poLine || item.materialCode == e.lineData.materialCode) {
this.LocationList.splice(indexItem, 1); DNIndex = index;
this.business(); }
// guoshuang this.DNReceivingList[DNIndex].wllist.forEach((item: any, index: any) => {
uni.showToast({ if (item.poNo == e.lineData.poNo || item.poLine == e.lineData.poLine || item.materialCode == e.lineData.materialCode || item.wlCode == e.lineData.wlCode || item.receiptAmount == e.lineData.receiptAmount) {
icon: 'none', nemIndex = index;
title: this.$t('message.success') as any, this.DNReceivingList[DNIndex].wllist.splice(nemIndex, 1);
}
});
});
this.LocationList.splice(e.contentIndex, 1);
} else if (res.cancel) {
return;
}
},
}); });
} }
// //
@ -370,6 +411,7 @@ export default class dnReceiptDom extends BasePage {
// //
this.receiptAmount = null; this.receiptAmount = null;
this.DNReceivingList = [];
await this.query(); await this.query();
} }
async onSubmit() { async onSubmit() {
@ -380,33 +422,9 @@ export default class dnReceiptDom extends BasePage {
}); });
return null; return null;
} }
await this.model.submitOrderInEnter(this.model.DNReceivingList); await this.model.submitOrderInEnter(this.DNReceivingList);
this.resetForm(); this.resetForm();
} }
addition() {
if (this.model.DNReceivingList.length != 0) {
let whether: any = false;
let nnum: any;
this.model.DNReceivingList.forEach((item: any, index: any) => {
if (item.poLine == this.every.poLine || item.sendSpot == this.every.sendSpot || item.materialCode == this.every.materialCode) {
whether = true;
nnum = index;
return;
}
});
console.log('nnum', nnum);
if (whether == true) {
this.model.DNReceivingList[nnum].wllist.push(this.LocationList[this.LocationList.length - 1]);
} else {
this.every.wllist.push(this.LocationList[this.LocationList.length - 1]);
this.model.DNReceivingList.push(this.every);
}
}
if (this.model.DNReceivingList.length == 0) {
this.model.DNReceivingList.push(this.every);
}
console.log('this.model.DNReceivingList', this.model.DNReceivingList);
}
async bill() { async bill() {
if (this.form.documentNo == '') { if (this.form.documentNo == '') {
uni.showToast({ uni.showToast({
@ -426,6 +444,7 @@ export default class dnReceiptDom extends BasePage {
// //
business() { business() {
this.every.receiptAmount = this.totalLocation(this.LocationList); this.every.receiptAmount = this.totalLocation(this.LocationList);
console.log('this.every.receiptAmount', this.every.receiptAmount);
} }
} }
</script> </script>
@ -497,11 +516,25 @@ export default class dnReceiptDom extends BasePage {
height: 100%; height: 100%;
display: flex; display: flex;
view { view {
width: 200rpx; width: 140rpx;
line-height: 100rpx; line-height: 100rpx;
} }
} }
} }
// .material {
// width: 100%;
// height: 100rpx;
// display: flex;
// .material-left {
// width: 100%;
// height: 100%;
// display: flex;
// view {
// width: 100rpx;
// line-height: 100rpx;
// }
// }
// }
.material { .material {
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
@ -511,15 +544,11 @@ export default class dnReceiptDom extends BasePage {
height: 100%; height: 100%;
display: flex; display: flex;
view { view {
width: 100rpx; width: 140rpx;
line-height: 100rpx; line-height: 100rpx;
text-align: left;
} }
} }
}
.material {
width: 100%;
height: 100rpx;
display: flex;
.material-right { .material-right {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -575,6 +604,7 @@ export default class dnReceiptDom extends BasePage {
} }
} }
} }
<<<<<<< HEAD
// .library { // .library {
// width: 100%; // width: 100%;
// height: 100rpx; // height: 100rpx;
@ -608,6 +638,41 @@ export default class dnReceiptDom extends BasePage {
// } // }
// } // }
// } // }
=======
.library {
width: 100%;
height: 100rpx;
display: flex;
.library-left {
width: 50%;
height: 100%;
display: flex;
view {
width: 100rpx;
line-height: 100rpx;
}
.search {
padding-left: 20px;
}
}
.library-right {
width: 50%;
height: 100%;
display: flex;
.library-right-title {
width: 120rpx;
height: 100%;
padding-left: 4px;
line-height: 100rpx;
}
.input {
width: 200rpx;
height: 70rpx;
margin-top: 15rpx;
}
}
}
>>>>>>> e06fba98009bdb7923f4a67091d1f3e4224bdb07
.add { .add {
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;

@ -35,7 +35,6 @@ export class ReceiptModule extends VuexModule {
dnNo = ''; dnNo = '';
code = ''; code = '';
DNdetailedList: any; DNdetailedList: any;
DNReceivingList: any = [];
ImportDNReceivingList: any = []; ImportDNReceivingList: any = [];
/** /**
* *

@ -0,0 +1,27 @@
/*
* @Author: zhou lei
* @Date: 2022-01-20 11:26:20
* @LastEditTime: 2022-01-20 17:48:10
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/src/utils/mixin.ts
* :910592680@qq.com 18669792120
*/
import Vue from 'vue';
import { Component } from 'vue-property-decorator';
@Component // 一定要用Component修饰
export default class MyMixins extends Vue {
customToast(msg: string, type = 'toast', title = '') {
if (type === 'toast') {
uni.showToast({
title: msg,
});
} else {
uni.showModal({
title: title,
content: msg,
});
}
}
}
Loading…
Cancel
Save