From ca27f46e204ee9772040b5b1170b0e2c1addc738 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期五, 18 八月 2023 23:26:01 +0800
Subject: [PATCH] 111
---
h5_standard/src/views/needToBeDealtWith/outbound.vue | 414 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 405 insertions(+), 9 deletions(-)
diff --git a/h5_standard/src/views/needToBeDealtWith/outbound.vue b/h5_standard/src/views/needToBeDealtWith/outbound.vue
index 5738353..a1d47d1 100644
--- a/h5_standard/src/views/needToBeDealtWith/outbound.vue
+++ b/h5_standard/src/views/needToBeDealtWith/outbound.vue
@@ -1,18 +1,414 @@
<template>
- <div class="page">
- 鏂板鍑哄簱
+ <div class="rework">
+ <div class="rework_list">
+ <div class="rework_list_item" @click="typeShow = true">
+ <span><b>*</b>鍗曟嵁绫诲瀷</span>
+ <div class="rework_list_item_right">
+ <span :class="form.typeName ? 'black' : ''">{{form.typeName ? form.typeName : '璇烽�夋嫨'}}</span>
+ <van-icon name="arrow" size="20" color="#999999" />
+ </div>
+ </div>
+ <div class="rework_list_item" @click="warehouseShow = true">
+ <span><b>*</b>鍑哄簱浠撳簱</span>
+ <div class="rework_list_item_right">
+ <span :class="form.warehouseName ? 'black' : ''">{{form.warehouseName ? form.warehouseName : '璇烽�夋嫨'}}</span>
+ <van-icon name="arrow" size="20" color="#999999" />
+ </div>
+ </div>
+ </div>
+ <div class="rework_qd">
+ <div class="rework_qd_title">
+ <div class="rework_qd_title_left">
+ <div class="x"></div>
+ <span>{{`鍑哄簱鐗╂枡娓呭崟${list.length}`}}</span>
+ </div>
+ <div class="rework_qd_title_right" @click="openMs">
+ <img src="@/assets/icon/gongdan_ic_shoudong@2x.png" alt="" />
+ <span>澧炲姞鍑哄簱</span>
+ </div>
+ </div>
+ <van-swipe-cell v-for="(item, index) in list" :key="index">
+ <div class="rework_qd_item">
+ <img class="rework_qd_item_dele" @click="dele(index)" src="@/assets/icon/chuku_ic_delete@2x.png" alt="" />
+ <div class="rework_qd_item_wl">
+ <span>{{ item.materialName }} | {{ item.materialCode }}</span>
+ </div>
+ <div class="rework_qd_item_cate">
+ <span class="green" v-if="item.qualityType === '0'">鍚堟牸 | </span>
+ <span class="yellow" v-if="item.qualityType === '1'">涓嶈壇 | </span>
+ <span class="red" v-if="item.qualityType === '2'">鎶ュ簾 | </span>
+ <span>{{ item.procedureName }} | </span>
+ <span>{{ item.batch }}</span>
+ </div>
+ <div class="rework_qd_item_hw">
+ <span>鍑哄簱璐т綅锛歿{ item.locationName }}</span>
+ <div class="rework_qd_item_hw_right">
+ <span>鏁伴噺锛�</span>
+ <input type="number" v-model="item.num" @input="changeNum(item)" placeholder="0" />
+ <span>{{ item.unitName }}</span>
+ </div>
+ </div>
+ </div>
+ <!-- <template #right>
+ <van-button style="height: 100%;" square type="danger" text="鍒犻櫎" @click="dele(index)" />
+ </template> -->
+ </van-swipe-cell>
+ </div>
+ <div class="rework_zw"></div>
+ <div class="rework_footer">
+ <button class="rework_footer_submit" @click="onConfirm">鎻愪氦</button>
+ </div>
+ <Warehouse :show="warehouseShow" @close="close" @value="getValue" />
+ <Materials ref="Material" :show="materialsShow" :id="form.warehouseId.toString()" @close="close1" @value="getValue1" />
+ <!-- 鍗曟嵁绫诲瀷 -->
+ <van-popup v-model:show="typeShow" round position="bottom" :style="{ height: '50%' }">
+ <van-picker
+ :columns="columns"
+ @confirm="onConfirm1"
+ @cancel="onCancel"
+ :columns-field-names="customFieldName"
+ />
+ </van-popup>
</div>
</template>
<script setup lang="ts">
+ import { onMounted, ref, reactive } from 'vue'
+ import { useRouter } from 'vue-router'
+ import { Toast } from 'vant'
+ import { createForStandard } from '@/apis/WorkOrderAPI'
+ import Warehouse from '@/components/common/Warehouse.vue'
+ import Materials from '@/components/common/Materials.vue'
+ const Material = ref(null)
+ const router = useRouter()
+ // 琛ㄥ崟鏁版嵁
+ let form = reactive({
+ warehouseName: '',
+ warehouseId: '',
+ type: '',
+ typeName: ''
+ })
+ let columns = ref([
+ { name: '閿�鍞嚭搴�', id: 18 },
+ { name: '搴撳瓨璋冩暣', id: 28 },
+ { name: '浠撳簱鎶ュ簾', id: 21 }
+ ])
+ const customFieldName = {
+ text: 'name'
+ };
+ let mIds = ref('')
+ let list = ref<Array<any>>([])
+ let warehouseShow = ref<boolean>(false)
+ let materialsShow = ref<boolean>(false)
+ let typeShow = ref<boolean>(false)
+
+ const onConfirm1 = (value: any) => {
+ form.typeName = value.name
+ form.type = value.id
+ typeShow.value = false
+ };
+ const onCancel = () => {
+ typeShow.value = false
+ }
+ const changeNum = (obj: any) => {
+ if (obj.num < 0) {
+ obj.num = ''
+ return Toast('鍑哄簱鐗╂枡鏁伴噺蹇呴』澶т簬0')
+ }
+ if (obj.num > obj.total) {
+ obj.num = ''
+ return Toast('鍑哄簱鐗╂枡鏁伴噺涓嶈兘澶т簬搴撳瓨鏁�')
+ }
+ }
+ // 鑾峰彇褰撳ぉ骞存湀鏃�
+ const getDay = () => {
+ var date = new Date();
+ var year = date.getFullYear();
+ var month = date.getMonth() + 1;
+ var day = date.getDate();
+ return `${year}-${month <= 9 ? `0${month}` : month}-${day <= 9 ? `0${day}` : day}`
+ }
+
+ // 鎻愪氦
+ const onConfirm = () => {
+ if (!form.type) return Toast('璇烽�夋嫨鍗曟嵁绫诲瀷')
+ if (!form.warehouseId) return Toast('璇烽�夋嫨鍑哄簱浠撳簱')
+ if (list.value.length === 0) return Toast('鑷冲皯閫夋嫨涓�鏉″嚭搴撶墿鏂�')
+ for (let i = 0; i < list.value.length; i++) {
+ if (!list.value[i].num || list.value[i].num == '' || list.value[i].num <= 0) {
+ return Toast(`绗�${i + 1}涓嚭搴撶墿鏂欐暟閲忓繀椤诲ぇ浜�0`)
+ }
+ if (list.value[i].num > list.value[i].total) {
+ return Toast(`绗�${i + 1}涓墿鏂欐暟閲忎笉鑳藉ぇ浜庡簱瀛橀噺锛乣)
+ }
+ }
+ createForStandard({
+ billType: form.type,
+ planDate: getDay(),
+ origin: 0,
+ type: 0,
+ warehouseId: form.warehouseId,
+ woutBoundDetailBeans: list.value
+ }).then(res => {
+ if (res.code === 200) {
+ Toast.success({message: '鍑哄簱鎴愬姛'})
+ setTimeout(() => {
+ router.go(-1)
+ }, 2000)
+ }
+ })
+ }
+
+ // 鎵撳紑閫夋嫨鐗╂枡
+ const openMs = () => {
+ if (!form.warehouseId) return Toast('璇峰厛閫夋嫨鍑哄簱浠撳簱')
+ const { selected }: any = Material.value
+ let ids = list.value.map(item => item.id)
+ Material.value.selected = ids
+ materialsShow.value = true
+ }
+
+ // 鍒犻櫎
+ const dele = (index: any) => {
+ if (list.value.length === 1) {
+ Toast('鑷冲皯淇濈暀涓�鏉″伐瑁呬俊鎭�')
+ return
+ }
+ list.value.splice(index, 1)
+ }
+ // 鍏抽棴浠撳簱閫夋嫨寮规
+ const close = (): void => {
+ warehouseShow.value = false
+ }
+ // 鍏抽棴浠撳簱閫夋嫨寮规
+ const close1 = (): void => {
+ materialsShow.value = false
+ }
+ // 閫夋嫨浠撳簱鍥炶皟
+ const getValue = (item: any): void => {
+ form.warehouseName = item.name
+ form.warehouseId = item.id
+ warehouseShow.value = false
+ }
+ const getValue1 = (item: any): void => {
+ item.forEach((row: any) => {
+ row.total = row.num
+ })
+ list.value = [...item, ...list.value]
+ materialsShow.value = false
+ console.log(list.value)
+ }
+
+ onMounted(() => {
+ // 鑾峰彇宸ヨ淇℃伅
+ // getLKInfo(route.query.id as string)
+ })
</script>
<style lang="scss" scoped>
-.page {
- width: 100%;
- height: 100%;
- position: absolute;
- background: #F7F7F7;
-}
-</style>
\ No newline at end of file
+ .rework {
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ .rework_list {
+ display: flex;
+ flex-direction: column;
+ background: white;
+ padding: 0 30px;
+ box-sizing: border-box;
+ .rework_list_item {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ height: 98px;
+ border-bottom: 1PX solid #E5E5E5;
+ &:last-child {
+ border: none;
+ }
+ span {
+ font-size: 30px;
+ font-weight: 400;
+ color: #222222;
+ flex-shrink: 0;
+ b {
+ font-size: 30px;
+ color: red;
+ margin-right: 5px;
+ }
+ }
+ .rework_list_item_right {
+ display: flex;
+ align-items: center;
+ span {
+ font-size: 28px;
+ font-weight: 400;
+ color: #999999;
+ }
+ .black {
+ color: black !important;
+ }
+ input {
+ width: 230px;
+ font-size: 28px;
+ border: none;
+ }
+ input::-webkit-input-placeholder { /* WebKit browsers */
+ font-size: 28px;
+ font-weight: 400;
+ color: #B2B2B2;
+ }
+ }
+ }
+ }
+ .rework_qd {
+ margin-top: 40px;
+ .rework_qd_title {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 0 30px 30px 30px;
+ .rework_qd_title_left {
+ display: flex;
+ align-items: center;
+ span {
+ font-size: 32px;
+ font-weight: 500;
+ color: #222222;
+ }
+ .x {
+ width: 8px;
+ height: 30px;
+ background: #4275FC;
+ border-radius: 2px;
+ margin-right: 12px;
+ }
+ }
+ .rework_qd_title_right {
+ display: flex;
+ align-items: center;
+ img {
+ width: 28px;
+ height: 28px;
+ margin-right: 12px;
+ }
+ span {
+ font-size: 28px;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #4275FC;
+ }
+ }
+ }
+ .rework_qd_item {
+ background: #ffffff;
+ padding: 30px;
+ display: flex;
+ flex-direction: column;
+ margin-bottom: 30px;
+ position: relative;
+ .rework_qd_item_dele {
+ position: absolute;
+ right: 0;
+ top: 0;
+ width: 48px;
+ height: 48px;
+ }
+ .rework_qd_item_wl {
+ span {
+ font-size: 30px;
+ font-family: PingFangSC-Medium, PingFang SC;
+ font-weight: 500;
+ color: #222222;
+ }
+ }
+ .rework_qd_item_cate {
+ margin-top: 18px;
+ span {
+ font-size: 24px;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #666666;
+ }
+ }
+ .rework_qd_item_hw {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-top: 24px;
+ span {
+ font-size: 26px;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #333333;
+ }
+ .rework_qd_item_hw_right {
+ display: flex;
+ align-items: center;
+ span {
+ font-size: 26px;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #666666;
+ }
+ input {
+ width: 140px;
+ height: 60px;
+ font-size: 28px;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #333333;
+ background: #FFFFFF;
+ border-radius: 8px;
+ border: 1PX solid #CCCCCC;
+ margin: 0 20px;
+ padding: 0 30px;
+ box-sizing: border-box;
+ text-align: right;
+ }
+ }
+ }
+ }
+ }
+ .rework_zw {
+ height: 168px;
+ }
+ .rework_footer {
+ width: calc(100% - 60px);
+ position: fixed;
+ bottom: 0;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 0 30px 68px 30px;
+ .rework_footer_add {
+ flex: 1;
+ height: 88px;
+ font-size: 30px;
+ font-weight: 500;
+ color: $nav-color;
+ background: #FFFFFF;
+ box-shadow: 0 0 12px 0 rgba(0,0,0,0.0800);
+ border-radius: 8px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+ .rework_footer_submit {
+ flex: 1;
+ height: 88px;
+ font-size: 30px;
+ font-weight: 500;
+ color: #ffffff;
+ background: $nav-color;
+ box-shadow: 0 0 12px 0 rgba(0,0,0,0.0800);
+ border-radius: 8px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border: none;
+ }
+ }
+ }
+</style>
--
Gitblit v1.9.3