From e065047450407e9b0448e2b3e7786f8959f35cf9 Mon Sep 17 00:00:00 2001
From: Mr.Shi <1878285526@qq.com>
Date: 星期三, 06 九月 2023 09:35:15 +0800
Subject: [PATCH] 小程序
---
minipro_standard/pages_adjust/components/multipleMaterial.vue | 312 ++++++++++++++++++++++++++++++++++++++++++++
minipro_standard/pages_adjust/pages/newTransfer/newTransfer.vue | 98 +++++++++----
minipro_standard/common/config.js | 4
3 files changed, 382 insertions(+), 32 deletions(-)
diff --git a/minipro_standard/common/config.js b/minipro_standard/common/config.js
index fced58f..062a83a 100644
--- a/minipro_standard/common/config.js
+++ b/minipro_standard/common/config.js
@@ -1,8 +1,8 @@
module.exports = {
// baseUrl: 'http://106.14.20.42/test_hfznzz/',
// baseUrl: 'https://hefei.dtkey.cn/test_hfznzz/',
- baseUrl: 'http://192.168.0.15:10021',
- // baseUrl: 'https://dmtest.ahapp.net/doumeeplant_api',
+ // baseUrl: 'http://192.168.0.15:10021',
+ baseUrl: 'https://dmtest.ahapp.net/doumeeplant_api',
phoneRegular: /^1[3456789]\d{9}$/,
mailboxRegular: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
positiveInteger: /^[0-9]*[1-9][0-9]*$/,
diff --git a/minipro_standard/pages_adjust/components/multipleMaterial.vue b/minipro_standard/pages_adjust/components/multipleMaterial.vue
new file mode 100644
index 0000000..ea3d29a
--- /dev/null
+++ b/minipro_standard/pages_adjust/components/multipleMaterial.vue
@@ -0,0 +1,312 @@
+<template>
+ <u-popup :show="show" :round="10" closeable @close="show = false">
+ <view class="material-content bbox p30 rp">
+ <view class="tc b f24 c2 mb20">閫夋嫨鐗╂枡</view>
+ <v-Search @searchInput="searchInput" @submit="submit" :isShow="false" placeholder="鎼滅储鐗╂枡鍚嶇О/缂栫爜" />
+ <div class="content_total">鍏眥{form.total}}鏉℃暟鎹�</div>
+ <view class="scroll-content">
+ <!-- refresher-enabled="true"
+ :refresher-triggered="refreshing"
+ @refresherrefresh="onRefresh" -->
+ <scroll-view
+ scroll-y="true"
+ @scrolltolower="loadMore">
+ <view v-for="(item1, index) in list" :key="index" class="flex mb20" @click="jump(index)">
+ <view class="img36 mr20 pt10">
+ <u-checkbox-group style="display: block;" name="">
+ <u-checkbox :checked="item1.isActive"></u-checkbox>
+ </u-checkbox-group>
+ </view>
+ <view class="fx1">
+ <div class="page_content_title_top">
+ <span>{{ item1.materialName + ' | ' + item1.materialCode }}</span>
+ </div>
+ <div class="page_content_title_bottom">
+ <span class="green" v-if="item1.qualityType == 0">
+ 鍚堟牸
+ <text class="c1" decode>{{ splite }}</text>
+ </span>
+ <span class="orange" v-else-if="item1.qualityType == 1">
+ 涓嶈壇
+ <text class="c1" decode>{{ splite }}</text>
+ </span>
+ <span class="red" v-else-if="item1.qualityType == 2">
+ 鎶ュ簾
+ <text class="c1" decode>{{ splite }}</text>
+ </span>
+ <span v-else>
+ -
+ <text class="c1" decode>{{ splite }}</text>
+ </span>
+ <span>
+ {{item1.procedureName ? item1.procedureName : '-'}}
+ <text class="c1" decode>{{ splite }}</text>
+ </span>
+ <span>{{item1.batch ? item1.batch : '-'}}</span>
+ </div>
+ <div class="mt20 plr25 ptb20 bg_f7 f26">
+ <div class="c2 mb10"><span class="c6">璐т綅锛�</span>{{ item1.locationName }}</div>
+ <div class="c2"><span class="c6">鏁伴噺锛�</span>{{ item1.num }}{{ item1.unitName }}</div>
+ </div>
+ </view>
+ </view>
+ </scroll-view>
+ <!-- <u-list @scrolltoupper="scrolltoupper" @scrolltolower="scrolltolower">
+ <u-list-item v-for="(item1, index) in list" :key="index">
+
+ </u-list-item>
+ </u-list> -->
+ </view>
+ <view style="height: 98rpx;"></view>
+ <!-- <view class="">
+ <u-safe-bottom></u-safe-bottom>
+ </view> -->
+ <view class="fixedBottom bottom cY">
+ <view class="fx1 bbox plr30">
+ <u-checkbox-group style="display: block;" name="" @change="selectAll()">
+ <u-checkbox :checked="isAll" label="鍏ㄩ��"></u-checkbox>
+ </u-checkbox-group>
+ </view>
+ <view class="submit sbtn_green bbox tc" @click="submitAction">{{ `鎻愪氦(${totalNum})`}}</view>
+ </view>
+ </view>
+ </u-popup>
+</template>
+
+<script>
+ import vSearch from '@/components/Search.vue'
+ import { choiceStockListPage } from '@/util/api/agencyAPI'
+
+ export default {
+ name: "selectMaterial",
+ components: {
+ vSearch
+ },
+ data() {
+ return {
+ show: false,
+ splite: ' | ',
+ form: {
+ capacity: 50,
+ page: 0,
+ total: 0,
+ smodelLabel: '',
+ categoryId: ''
+ },
+ list: [],
+ loading: false,
+ finished: false,
+ refreshing: false,
+ total: 0
+ };
+ },
+ props: {
+ warehouseId: {
+ type: String,
+ default: ''
+ },
+ warehouseQualityType: {
+ type: String,
+ default: ''
+ },
+ selected: {
+ type: Array,
+ default: []
+ }
+ },
+ computed: {
+ all() {
+ for (let i = 0; i < this.list.length; i++) {
+ if (!this.list[i].isActive) {
+ return false
+ }
+ }
+ return true
+ },
+ totalNum() {
+ let num = 0;
+ this.list.forEach(item => {
+ if (item.isActive) {
+ num += 1
+ }
+ })
+ return num;
+ }
+ },
+ methods: {
+ open() {
+ this.show = true
+ this.refreshing = false
+ this.finished = false
+ this.list = []
+ this.form.page = 0
+ this.form.total = 0
+ this.loadData()
+ },
+ jump(index) {
+ this.list.forEach((item, i) => {
+ if (index === i) {
+ item.isActive = !item.isActive
+ }
+ })
+ },
+ // 鎼滅储鎻愪氦
+ submit() {
+ this.form.page = 0
+ this.finished = false
+ this.list = []
+ this.onLoad()
+ },
+ // 鎼滅储妗�
+ searchInput(data) {
+ this.form.page = 0
+ this.finished = false
+ this.list = []
+ this.form.smodelLabel = data
+ this.onLoad()
+ },
+ loadData() {
+ if (!this.finished) {
+ this.loading = true;
+ this.form.page = this.form.page += 1
+ choiceStockListPage({
+ capacity: this.form.capacity,
+ page: this.form.page,
+ model: {
+ warehouseId: this.warehouseId,
+ warehouseQualityType: this.warehouseQualityType,
+ ids: this.selected.length > 0 ? this.selected.join(',') : ''
+ }
+ }).then(res => {
+ if (this.refreshing) {
+ this.list = []
+ this.refreshing = false;
+ }
+ this.loading = false;
+ if (res.code === 200 && res.data.records && res.data.records.length !== 0) {
+ this.form.total = res.data.total
+ res.data.records.forEach(element => {
+ element.isActive = false
+ })
+ this.list.push(...res.data.records)
+ } else {
+ this.finished = true;
+ }
+ }).catch(err => {
+ this.loading = false;
+ this.finished = true;
+ if (this.refreshing) {
+ this.list = []
+ this.refreshing = false;
+ }
+ })
+ }
+ },
+ loadMore() {
+ this.pages.page += 1
+ this.loadData()
+ },
+ onRefresh() {
+ if (this.refreshing) return
+ this.refreshing = true;
+ this.pages.page = 1
+ this.loadData()
+ },
+ selectAll() {
+ this.list.forEach(element => {
+ element.isActive = this.all
+ })
+ },
+ submitAction () {
+ this.show = false
+ let arr = []
+ this.list.forEach(element => {
+ if (element.isActive) {
+ arr.push(element)
+ }
+ })
+ this.$emit('value', arr)
+ }
+ }
+ }
+</script>
+
+<style lang="scss" scoped>
+ .material-content {
+ display: flex;
+ flex-direction: column;
+ height: 1200rpx;
+ box-sizing: border-box;
+
+ .scroll-content {
+ height: calc(1100rpx - env(safe-area-inset-bottom));
+ overflow: scroll;
+ }
+ }
+
+ .content_total {
+ margin-top: 20rpx;
+ margin-bottom: 20rpx;
+ // padding: 24rpx 30rpx;
+ // background: #F7F7F7;
+ font-size: 24rpx;
+ font-weight: 400;
+ color: #666666;
+ }
+
+ .page_content_title_top {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+
+ span {
+ &:nth-child(1) {
+ font-size: 30rpx;
+ font-weight: 500;
+ color: #222222;
+ }
+
+ &:nth-child(2) {
+ flex-shrink: 0;
+ font-size: 24rpx;
+ font-weight: 400;
+ color: #333333;
+
+ // span {
+ // font-size: 24rpx;
+ // color: $nav-color;
+ // }
+ }
+ }
+ }
+
+ .page_content_title_bottom {
+ margin-top: 24rpx;
+
+ span {
+ font-size: 24rpx;
+ font-weight: 400;
+ color: #666666;
+ }
+ }
+
+ .page_content_title {
+ display: flex;
+ flex-direction: column;
+ margin-bottom: 10rpx;
+
+
+
+
+ }
+
+ .bottom {
+ height: 98rpx;
+
+ .submit {
+ width: 272rpx;
+ height: 98rpx;
+ line-height: 98rpx;
+ }
+ }
+</style>
\ No newline at end of file
diff --git a/minipro_standard/pages_adjust/pages/newTransfer/newTransfer.vue b/minipro_standard/pages_adjust/pages/newTransfer/newTransfer.vue
index 413f853..b7d0818 100644
--- a/minipro_standard/pages_adjust/pages/newTransfer/newTransfer.vue
+++ b/minipro_standard/pages_adjust/pages/newTransfer/newTransfer.vue
@@ -29,26 +29,25 @@
</view>
<view class="zk_wl">
<template v-if="view.MaterialList.length > 0">
- <van-swipe-cell v-for="(item, i) in view.MaterialList" :key="i">
- <view class="zk_wl_item">
- <text>{{item.materialName}}锝渰{item.materialCode}}</text>
- <text>
- <text class="green" v-if="item.qualityType === '0'">鍚堟牸</text>
- <text class="yellow" v-if="item.qualityType === '1'">涓嶈壇</text>
- <text class="red" v-if="item.qualityType === '2'">鎶ュ簾</text>
- | <text>{{item.procedureName ? item.procedureName : '-'}} | </text>
- <text>{{item.batch ? item.batch : '-'}}</text>
- </text>
+ <view class="zk_wl_item" v-for="(item, i) in view.MaterialList" :key="i">
+ <image class="shanchu" src="@/static/chuku_ic_delete@2x.png" mode="widthFix" @click="dele(i)"></image>
+ <text>{{item.materialName}}锝渰{item.materialCode}}</text>
+ <text>
+ <text class="green" v-if="item.qualityType === '0'">鍚堟牸 |</text>
+ <text class="yellow" v-if="item.qualityType === '1'">涓嶈壇 |</text>
+ <text class="red" v-if="item.qualityType === '2'">鎶ュ簾 |</text>
+ <text>{{item.procedureName ? item.procedureName : '-'}} | </text>
+ <text>{{item.batch ? item.batch : '-'}}</text>
+ </text>
+ <view class="zk_wl_item_num">
<text>璐т綅锛歿{item.locationName}}</text>
- <view class="zk_wl_item_num">
- <text>杞嚭鏁伴噺({{item.unitName}})锛�</text>
+ <view class="zk_wl_item_input">
+ <text>鏁伴噺锛�</text>
<input type="number" v-model="item.total" placeholder="0" />
+ <text>{{item.unitName}}</text>
</view>
</view>
- <template #right>
- <van-button square type="danger" style="height: 100%;" text="鍒犻櫎" @click="dele(i)" />
- </template>
- </van-swipe-cell>
+ </view>
</template>
<view class="zk_wl_w" v-else>
<text>鏆傛棤鏁版嵁</text>
@@ -63,7 +62,12 @@
<!-- 閫夋嫨浠撳簱 -->
<Warehouse :show="view.Warehouse" @close="view.Warehouse = false" @value="getValue" />
<!-- 閫夋嫨鐗╂枡 -->
- <SelectMultipleMaterial ref="SelectMultipleMaterial" />
+ <multipleMaterial
+ :warehouseId="data.exWarehouseId.toString()"
+ :warehouseQualityType="view.warehouseQualityType"
+ :selected="view.MaterialList.map(item => item.id)"
+ @value="getValueWL"
+ ref="multipleMaterial" />
<!-- 鍗曟嵁绫诲瀷 -->
<u-picker :show="view.type" :columns="view.documentTypeDate" keyName="name" @cancel="onCancel" @confirm="onConfirm"></u-picker>
</view>
@@ -72,13 +76,13 @@
<script>
import { setTime } from '@/util/utils.js'
import { documentType } from '@/util/constData.js'
- import SelectMultipleMaterial from '@/components/SelectMultipleMaterial.vue'
+ import multipleMaterial from '../../components/multipleMaterial.vue'
import Warehouse from '../../components/Warehouse.vue'
import { createZK } from '@/util/api/agencyAPI'
export default {
components: {
- SelectMultipleMaterial,
+ multipleMaterial,
Warehouse
},
data() {
@@ -117,17 +121,21 @@
{ name: '搴熷搧鍏ュ簱', id: 30 }
]
],
- warehouseQualityType: '',
- customFieldName: {
- text: 'name'
- }
+ warehouseQualityType: ''
}
};
},
methods: {
+ // 鍒犻櫎鐗╂枡
+ dele(i) {
+ this.view.MaterialList.splice(i, 1)
+ },
// 浠撳簱鍥炶皟
getValue(val) {
if (this.view.status === 'c') {
+ if (this.data.exWarehouseId !== val.id) {
+ this.view.MaterialList = []
+ }
this.data.exWarehouse = val.name
this.data.exWarehouseId = val.id
this.data.outUserId = val.managerId
@@ -138,6 +146,14 @@
this.view.warehouseQualityType = val.tmodel.label
}
this.view.Warehouse = false
+ },
+ // 鐗╂枡鍥炶皟
+ getValueWL(val) {
+ val.forEach(element => {
+ element.total = element.num
+ })
+ this.view.MaterialList.push(...val)
+ this.view.Material = false
},
// 纭鍗曟嵁绫诲瀷
onConfirm(val) {
@@ -178,8 +194,8 @@
proceduresId: element.procedureId,
inLocationId: null,
outLocationId: element.locationId,
- inWarehouseId: data.exWarehouseId,
- outWarehouseId: data.warehousingWarehouse
+ inWarehouseId: this.data.exWarehouseId,
+ outWarehouseId: this.data.warehousingWarehouse
})
})
createZK({
@@ -194,7 +210,7 @@
wtransferDetailBeanList
}).then(res => {
if (res.code === 200) {
- uni.showToast({ title: '鍒涘缓鎴愬姛锛�', icon: 'none', duration: 2000 });
+ uni.showToast({ title: '鍒涘缓鎴愬姛锛�', icon: 'success', duration: 2000 });
setTimeout(() => {
uni.navigateBack({ delta: 1 });
}, 2000)
@@ -221,7 +237,7 @@
// const { selected } = Material.value
// Material.value.selected = arr
// view.Material = true
- this.$refs.SelectMultipleMaterial.open({})
+ this.$refs.multipleMaterial.open()
} else {
uni.showToast({ title: '璇峰厛閫夋嫨鍏ュ簱浠撳簱', icon: 'none', duration: 2000 });
}
@@ -314,22 +330,43 @@
flex-direction: column;
padding: 30rpx;
border-bottom: 1rpx solid #e2e2e2;
+ position: relative;
+
+ .shanchu {
+ width: 48rpx;
+ height: 48rpx;
+ position: absolute;
+ top: 0;
+ right: 0;
+ }
.zk_wl_item_num {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 30rpx;
+
+ .zk_wl_item_input {
+ display: flex;
+ align-items: center;
+ text {
+ font-size: 26rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #666666;
+ }
+ }
text {
- font-size: 28rpx;
+ font-size: 26rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
- color: #222222;
+ color: #333333;
margin: 0 !important;
}
input {
- width: 180rpx;
+ width: 140rpx;
height: 60rpx;
background: #FFFFFF;
border-radius: 8rpx;
@@ -384,6 +421,7 @@
position: fixed;
bottom: 0;
left: 0;
+ z-index: 999;
padding-bottom: 68rpx;
display: flex;
align-items: center;
--
Gitblit v1.9.3