Browse Source

fix: [SBBJ-971]手填库位移动代码

master
zengqinyuan 2 months ago
parent
commit
635eb02ac9
  1. 16
      src/api/costCenterMapping/index.ts
  2. 378
      src/components/costCenter/index.vue
  3. 455
      src/pages/outLocation/addForm.vue

16
src/api/costCenterMapping/index.ts

@ -0,0 +1,16 @@
import http from '@/api/http'
export interface CostCenterMappingVO {
id: number
warehouseArea: string
department: string
creditAccount: string
ccAccount: string
siteId: string
available: string
concurrencyStamp: number
}
// 根据库区编号获取成本中心
export function findList(data) {
console.log('findList.data',data)
return http.get({ url: `/eam/cost-center-mapping/findList`, data })
}

378
src/components/costCenter/index.vue

@ -0,0 +1,378 @@
<template>
<!-- 选择备件 -->
<u-popup v-model="isShowSelectItem" mode="center" border-radius="14">
<view class="popup-title">成本中心</view>
<view class="popup">
<u-search placeholder="搜索" v-model="form1.warehouseArea" @change="searchItem" clearabled="false"></u-search>
<scroll-view class="list" scroll-y="true" style="max-height: 800rpx">
<view class="item" v-for="(item, index) in singleColumnList" :key="index" @click="chooseItem(item)">
<u-checkbox v-model="item.checked" shape="circle" style="margin-top: 8rpx"></u-checkbox>
<view class="right">
<view class="item-name">
库区: <span>{{ item.warehouseArea }}</span>
</view>
<view class="item-dec">
部门: <span>{{ item.department }}</span>
</view>
<view class="item-dec">
科目: <span>{{ item.creditAccount }}</span>
</view>
<view class="item-dec">
成本中心: <span>{{ item.ccAccount }}</span>
</view>
<view class="item-dec">
库位移动代码: <span>{{ item.moveCode }}</span>
</view>
</view>
</view>
</scroll-view>
</view>
<view class="popup-footer">
<view @click="chooseItem1(0)">取消</view>
<view class="sure" @click="chooseItem1(1)">确认</view>
</view>
</u-popup>
<!-- 全屏图片弹窗 -->
<u-popup v-model="isImagePopupVisible" mode="center" border-radius="0">
<view class="image-popup">
<view class="close-btn" @click="closeImagePopup">X</view>
<img :src="currentImagePath" class="full-image" />
</view>
</u-popup>
<!-- 长按显示完整内容的浮窗 -->
<div v-if="showTooltip" class="tooltip" :style="{ top: tooltipPosition.top, left: tooltipPosition.left }">
{{ tooltipContent }}
</div>
</template>
<script setup lang="ts">
import { defineEmits, defineProps, getCurrentInstance, ref, watch } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
const props = defineProps({
singleColumnList: {
type: Array,
default: () => {
return []
},
require: false
}
})
// isShowSelectItem
// watch(
// () => props.isShowSelectItem,
// (newValue, oldValue) => {
// if (newValue) {
// form1.value.ccAccount = ''
// form1.value.creditAccount = ''
// form1.value.department = ''
// form1.value.moveCode = ''
// form1.value.warehouseArea = ''
// }
// }
// )
const type = ref('')
const isShowSelectItem = ref(false)
const selectVal = ref(null)
const emits = defineEmits(['searchItem', 'chooseItem1'])
const form1 = ref({
ccAccount: '',
creditAccount: '',
department: '',
moveCode: '',
warehouseArea: ''
})
//
const isImagePopupVisible = ref(false)
const currentImagePath = ref('')
//
const showTooltip = ref(false)
const tooltipContent = ref('')
const tooltipPosition = ref({ top: '0px', left: '0px' })
//
function closeImagePopup() {
uni.hideLoading()
isImagePopupVisible.value = false
}
//
function showFullText(text) {
tooltipContent.value = text
showTooltip.value = true
//
tooltipPosition.value = { top: '50px', left: '50px' }
}
// onLoad((option) => {
// if (option.type) type.value = option.type
// if (option.type) isShowSelectItem.value = option.isShowSelectItem
// if (option.selectVal) selectVal.value = option.selectVal
// })
//
function chooseItem1(type) {
if (type == 1) {
// form1.value.number = form1.value.temporarilyNumber
// form1.value.name = form1.value.temporarilyName
// form1.value.specifications = form1.value.temporarilySpecifications
// form1.value.specifications = form1.value.temporarilySpecifications
}
emits('chooseItem1', type, form1)
}
function searchItem() {
emits('searchItem', form1.value.moveCode)
}
function chooseItem(item) {
let arr = props.singleColumnList.filter((cur) => cur.warehouseArea != item.warehouseArea)
arr.forEach((item) => {
item.checked = false
})
item.checked = !item.checked
let arr1 = props.singleColumnList.filter((cur) => cur.warehouseArea == item.warehouseArea)
form1.value.ccAccount = arr1[0].ccAccount
form1.value.creditAccount = arr1[0].creditAccount
form1.value.department = arr1[0].department
form1.value.moveCode = arr1[0].moveCode
form1.value.warehouseArea = arr1[0].warehouseArea
}
defineExpose({
isShowSelectItem
})
</script>
<style lang="scss" scoped>
.add-form-container {
min-height: calc(100vh - 140rpx);
background: white;
padding: 0px 30rpx 140rpx;
}
.footer {
position: fixed;
bottom: 0px;
left: 0px;
width: 100%;
z-index: 22;
}
.btns {
display: flex;
button {
flex: 1;
}
.sure {
background: #409eff;
color: white;
border-radius: 0px;
&::after {
border: 1px solid #409eff;
border-radius: 0px;
}
}
.reset {
background: #f5f5f5;
border-radius: 0px;
&::after {
border-radius: 0px;
}
}
}
.right-button {
background: #409eff;
color: white;
padding: 0rpx 30rpx;
border-radius: 16rpx;
text-align: center;
font-size: 28rpx;
}
.select {
display: flex;
align-items: center;
height: 72rpx;
width: 100%;
.input {
flex: 1;
font-size: 28rpx;
color: #000000;
}
.placeholder {
flex: 1;
font-size: 28rpx;
color: rgb(192, 196, 204);
}
}
.title {
padding: 32rpx 0px;
position: relative;
span {
position: absolute;
left: -16rpx;
color: #fa3534;
padding-top: 6rpx;
}
}
.list {
// overflow-y: auto; /* */
// max-height: 500px; /* */
.item {
display: flex;
margin-bottom: 20rpx;
.item-box {
background: #f5f5f5;
border-radius: 12rpx;
flex: 1;
width: 0rpx;
}
.spare-title {
padding: 20rpx 30rpx;
border-bottom: 1px solid #e4e4e4;
.title-txt {
color: #409eff;
font-size: 30rpx;
font-weight: bold;
}
}
.dec {
color: #9c9c9c;
padding: 20rpx 30rpx 20rpx;
}
}
}
.add-btn {
display: flex;
justify-content: flex-start;
align-items: center;
}
.popup-title {
text-align: center;
font-size: 32rpx;
font-weight: bold;
color: #409eff;
padding: 30rpx 30rpx 0px;
}
.popup {
width: 600rpx;
padding: 30rpx 60rpx 30rpx;
}
.popup-footer {
display: flex;
border-top: 1px solid #e4e4e4;
view {
line-height: 100rpx;
flex: 1;
text-align: center;
&.sure {
color: #409eff;
}
}
}
::v-deep .u-checkbox-group {
display: grid !important;
}
.image-popup {
position: relative;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: rgba(0, 0, 0, 0.8);
}
.close-btn {
position: absolute;
top: 10px;
right: 10px;
color: white;
font-size: 24px;
cursor: pointer;
}
.full-image {
max-width: 100%;
max-height: 100%;
}
.item-dec {
display: flex;
align-items: flex-start;
}
.image-link {
cursor: pointer;
color: blue;
text-decoration: underline;
margin-bottom: 5px;
overflow: hidden; /* 隐藏超出部分 */
text-overflow: ellipsis; /* 显示省略号 */
white-space: nowrap; /* 不换行 */
max-width: 150px; /* 根据需要设置最大宽度 */
}
.image-popup {
position: relative;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: rgba(0, 0, 0, 0.8);
}
.close-btn {
position: absolute;
top: 10px;
right: 10px;
color: white;
font-size: 24px;
cursor: pointer;
}
.full-image {
max-width: 100%;
max-height: 100%;
}
.tooltip {
position: absolute;
background-color: #f9f9f9;
border: 1px solid #ccc;
padding: 10px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
z-index: 1000;
white-space: normal;
}
</style>

455
src/pages/outLocation/addForm.vue

@ -2,26 +2,22 @@
<!-- 添加维修工单 -->
<view class="add-form-container">
<u-form :model="form" ref="formRef" label-width="160rpx">
<u-form-item label="申请人" prop="applyName" required class='disabled'>
<u-form-item label="申请人" prop="applyName" required class="disabled">
<u-input v-model="form.applyName" placeholder="请输入申请人" disabled />
</u-form-item>
<u-form-item label="申请部门" prop="applyDeptName" required class='disabled'>
<u-form-item label="申请部门" prop="applyDeptName" required class="disabled">
<u-input v-model="form.applyDeptName" placeholder="请输入申请部门" disabled />
</u-form-item>
<u-form-item label="审批人" prop="approveName" required class='disabled'>
<u-form-item label="审批人" prop="approveName" required class="disabled">
<u-input v-model="form.approveName" placeholder="请输入审批人" disabled />
</u-form-item>
</u-form>
<view class="list">
<view class="title">
<span>*</span>申领信息
</view>
<view class="item " v-for="(item,index) in form.subList" :key="index">
<view class="title"><span>*</span>申领信息</view>
<view class="item" v-for="(item, index) in form.subList" :key="index">
<view class="item-box">
<view class="spare-title">
<view class="title-txt">
备件名称{{item.itemName}}
</view>
<view class="title-txt"> 备件名称{{ item.itemName }}</view>
</view>
<u-row gutter="16">
<!-- <u-col :span="24">
@ -31,34 +27,22 @@
</u-col> -->
<u-col :span="24">
<view class="dec">
已出库数量:{{item.receiveQty}}
</view>
<view class="dec"> 已出库数量:{{ item.receiveQty }}</view>
</u-col>
<u-col :span="24">
<view class="dec">
申请数量:{{item.qty}}
</view>
<view class="dec"> 申请数量:{{ item.qty }}</view>
</u-col>
<u-col :span="24" v-if="item.outSite">
<view class="dec">
账外库位:{{item.outSite}}
</view>
<view class="dec"> 账外库位:{{ item.outSite }}</view>
</u-col>
<u-col :span="24" v-if="item.outSite">
<view class="dec">
账外数量:{{item.outQty}}
</view>
<view class="dec"> 账外数量:{{ item.outQty }}</view>
</u-col>
<u-col :span="24" v-if="item.inSite">
<view class="dec">
账内库位:{{item.inSite}}
</view>
<view class="dec"> 账内库位:{{ item.inSite }}</view>
</u-col>
<u-col :span="24" v-if="item.inSite">
<view class="dec">
账内数量:{{item.inQty}}
</view>
<view class="dec"> 账内数量:{{ item.inQty }}</view>
</u-col>
</u-row>
</view>
@ -66,31 +50,21 @@
</view>
<view class="list">
<view class="title">
<span>*</span>出库信息
</view>
<view class="item " v-for="(item,index) in form.itemNumbers" :key="index">
<view class="title"><span>*</span>出库信息</view>
<view class="item" v-for="(item, index) in form.itemNumbers" :key="index">
<view class="item-box">
<view class="spare-title">
<view class="title-txt">
备件名称{{item.itemName}}
</view>
<view class="title-txt"> 备件名称{{ item.itemName }}</view>
</view>
<u-row gutter="16">
<u-col :span="24">
<view class="dec">
出库数量{{item.qty}}
</view>
<view class="dec"> 出库数量{{ item.qty }}</view>
</u-col>
<u-col :span="24">
<view class="dec">
申请数量{{item.applyQty}}
</view>
<view class="dec"> 申请数量{{ item.applyQty }}</view>
</u-col>
<u-col :span="24">
<view class="dec">
库位编码{{item.locationNumber}}
</view>
<view class="dec"> 库位编码{{ item.locationNumber }}</view>
</u-col>
<!-- <u-col :span="24">
<view class="dec">
@ -98,37 +72,51 @@
</view>
</u-col> -->
<u-col :span="24">
<view class="dec">
库位类型{{item.isInAccount == 'FALSE'?'帐外库' :'帐内库'}}
</view>
<view class="dec"> 库位类型{{ item.isInAccount == 'FALSE' ? '帐外库' : '帐内库' }}</view>
</u-col>
</u-row>
</view>
<u-icon name="minus-circle" color="#aaaaaa" size="60" @click="delSpareParts(item,index)"></u-icon>
<u-icon name="minus-circle" color="#aaaaaa" size="60" @click="delSpareParts(item, index)"></u-icon>
</view>
<view class="add-btn">
<u-button type="primary" @click="open"><u-icon name="plus-circle" color="#ffffff"
size="36"></u-icon>添加备件</u-button>
<u-button type="primary" @click="open">
<u-icon name="plus-circle" color="#ffffff" size="36"></u-icon>
添加备件
</u-button>
</view>
</view>
<view class="footer">
<view class="btns">
<button class="reset" @click="reset">重置</button>
<button class="sure" @click="submit" :loading='loading' :disabled='loading'>确定</button>
<button class="sure" @click="submit" :loading="loading" :disabled="loading">确定</button>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom)"></view>
</view>
<!-- 添加备件 -->
<u-popup v-model="isPopupShow" mode="center" border-radius="14">
<view class="popup-title">添加备件</view>
<scroll-view scroll-y="true" style="max-height:60vh;">
<scroll-view scroll-y="true" style="max-height: 60vh">
<view class="popup">
<u-form :model="form1" ref="form1Ref" label-width="180rpx">
<u-form-item label="库位" prop="locationNumber" required>
<u-input v-model="form1.locationNumber" placeholder="请输入库位" @blur="blur()"
@confirm="handelScanMsg" :focus='isFocus' />
<u-input v-model="form1.locationNumber" placeholder="请输入库位" @blur="blur()" @confirm="handelScanMsg" :focus="isFocus" />
</u-form-item>
<!-- <u-form-item label="库位移动代码" prop="moveCode" required class="disabled">-->
<!-- <view class="select">-->
<!-- <u-input v-model="form1.moveCode" placeholder="请选择库位移动代码" />-->
<!-- </view>-->
<!-- </u-form-item>-->
<u-form-item :label="`库位移动代码`" prop="moveCode" required>
<view class="select" @click="openSingleNewColumn('moveCode', form1.moveCode, sparePartsList)">
<view class="input" v-if="form1.moveCode">
{{ form1.moveCode }}
</view>
<view class="placeholder" v-else> 请选择备件</view>
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view>
</u-form-item>
<u-form-item :label="`备件名称`" prop="itemNumber" required class="disabled">
<view class="select">
<u-input v-model="form1.itemName" placeholder="请选择备件" disabled />
@ -161,57 +149,66 @@
</view>
</u-popup>
</view>
<CostCenter ref="costCenterRef" :singleColumnList="singleColumnList" @searchItem="searchItem" />
</template>
<script setup lang="ts">
import {
onLoad
} from '@dcloudio/uni-app'
import {
ref,
getCurrentInstance
} from 'vue'
import * as outLocationApi from "@/api/outLocation"
import * as locationApi from "@/api/location"
const { proxy } = getCurrentInstance()
const loading = ref(false)
const orderList = ref([])//
//
const isPopupShow = ref(false)
const form = ref({
import { onLoad } from '@dcloudio/uni-app'
import { getCurrentInstance, ref } from 'vue'
import * as outLocationApi from '@/api/outLocation'
import * as locationApi from '@/api/location'
import CostCenter from '@/components/costCenter'
import * as costCenterMappingApi from '@/api/costCenterMapping'
const { proxy } = getCurrentInstance()
const loading = ref(false)
const orderList = ref([]) //
const costCenterRef = ref(false)
//
const isPopupShow = ref(false)
const form = ref({
id: '',
number: '',
supplierName: '',
itemNumbers: [],
subList: [],
costCenter:''
})
const form1 = ref({
itemNumber: "",
costCenter: '',
applyName: '',
approveName: '',
applyDeptName: ''
})
const form1 = ref({
itemNumber: '',
itemName: '',
locationNumber: '',
applyQty: '',
receiveQty: '',
stockQty: '',
totalReception:'',
qty: ''
})
const isShow = ref(false)
const isInAccount = ref('FALSE')
const isFocus = ref(false)
const msg = ref('')
//
function submit() {
totalReception: '',
qty: '',
moveCode: '',
areaNumber: '',
isInAccount: ''
})
const isShow = ref(false)
const isInAccount = ref('FALSE')
const isFocus = ref(false)
const msg = ref('')
//
function submit() {
if (form.value.itemNumbers.length === 0) {
proxy.$modal.showToast('请添加出库信息')
return;
return
}
proxy.$modal.confirm('是否添加出库信息').then(() => {
proxy.$modal.loading('加载中')
loading.value = true
outLocationApi.outLocationCreat(form.value).then((res) => {
outLocationApi
.outLocationCreat(form.value)
.then((res) => {
proxy.$modal.closeLoading()
if (res.data) {
proxy.$modal.showToast('添加成功')
@ -223,19 +220,21 @@
proxy.$modal.showToast('添加失败')
loading.value = false
}
}).catch(() => {
})
.catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
})
}
}
//
function reset() {
//
function reset() {
form.value.itemNumbers = []
}
//
async function getInLocationDetail() {
}
//
async function getInLocationDetail() {
// let itemNumbers = form.value.itemNumbers.map(item=>{
// return {
// itemNumber:item.itemNumber,
@ -243,21 +242,25 @@
// locationNumber:item.locationNumber,
// }
// })
await outLocationApi.getOutLocationDetail({
await outLocationApi
.getOutLocationDetail({
id: form.value.id,
number: form.value.number,
number: form.value.number
// itemNumbers:itemNumbers || []
}).then(res => {
})
.then((res) => {
form.value.applyName = res.data.applyName
form.value.approveName = res.data.approveName
form.value.applyDeptName = res.data.applyDeptName
form.value.subList = res.data.subList
}).catch(() => { })
}
//
function open() {
})
.catch(() => {})
}
//
function open() {
form1.value = {
itemNumber: "",
itemNumber: '',
itemName: '',
locationNumber: '',
applyQty: '',
@ -268,114 +271,122 @@
isPopupShow.value = true
isShow.value = false
isFocus.value = true
}
//
function addSpare() {
}
//
function addSpare() {
//
if (!form1.value.locationNumber) {
proxy.$modal.showToast('请选择库位')
return;
return
}
if (!form1.value.itemNumber) {
proxy.$modal.showToast(msg.value)
return;
return
}
if (!form1.value.qty) {
proxy.$modal.showToast(`请输入数量`)
return;
return
}
if (Number(form1.value.qty) + Number(form1.value.receiveQty) > Number(form1.value.applyQty)) {
proxy.$modal.showToast('已出库数量和出库数量不可大于申请数量')
return;
return
}
if (Number(form1.value.qty) > Number(form1.value.totalReception)) {
proxy.$modal.showToast('出库数量不可大于剩余出库数量')
return;
return
}
if (form.value.itemNumbers && form.value.itemNumbers.length > 0) {
let arr = form.value.itemNumbers.filter(item => item.locationNumber == form1.value.locationNumber)
let arr = form.value.itemNumbers.filter((item) => item.locationNumber == form1.value.locationNumber)
if (arr && arr.length > 0) {
proxy.$modal.showToast('该库位已添加')
return;
return
}
let arr1 = form.value.subList.filter(item => item.itemNumber == form1.value.itemNumber)
let arr1 = form.value.subList.filter((item) => item.itemNumber == form1.value.itemNumber)
if (!arr1 || (arr1 && arr1.length == 0)) {
proxy.$modal.showToast('申领信息没有该备件')
return;
return
}
}
form.value.itemNumbers.push(form1.value)
isPopupShow.value = false
}
//
function delSpareParts(item,index) {
let bol = form.value.itemNumbers.some(cur=>cur.itemNumber == item.itemNumber&&item.isInAccount == 'FALSE'&&cur.isInAccount == 'TRUE')
if(bol){
}
//
function delSpareParts(item, index) {
let bol = form.value.itemNumbers.some((cur) => cur.itemNumber == item.itemNumber && item.isInAccount == 'FALSE' && cur.isInAccount == 'TRUE')
if (bol) {
proxy.$modal.showToast('请先删除该备件得帐内库')
return;
return
}
form.value.itemNumbers.splice(index, 1)
}
function getLocation() {
let itemNumbers = form.value.itemNumbers.map(item=>{
}
function getLocation() {
let itemNumbers = form.value.itemNumbers.map((item) => {
return {
itemNumber:item.itemNumber,
qty:item.qty,
locationNumber:item.locationNumber,
itemNumber: item.itemNumber,
qty: item.qty,
locationNumber: item.locationNumber
}
})
locationApi.getOutLocation({
locationApi
.getOutLocation({
number: form1.value.locationNumber,
id: form.value.id,
itemNumbers:itemNumbers
}).then(res => {
itemNumbers: itemNumbers
})
.then((res) => {
if (!res.data) {
msg.value = res.msg
form1.value.areaNumber = '';
form1.value.itemName = '';
form1.value.itemNumber = '';
form1.value.receiveQty ='';
form1.value.applyQty ='';
form1.value.stockQty = '';
form1.value.totalReception ='';
form1.value.isInAccount ='';
isInAccount.value ='';
return;
}
form1.value.areaNumber = res.data.areaNumber;
form1.value.itemName = res.data.itemName;
form1.value.itemNumber = res.data.itemNumber;
form1.value.receiveQty = res.data.receiveQty || 0;
form1.value.applyQty = res.data.applyQty || 0;
form1.value.stockQty = res.data.qty || 0;
form1.value.totalReception = res.data.totalReception || 0;
form1.value.isInAccount = res.data.isInAccount;
form1.value.areaNumber = ''
form1.value.itemName = ''
form1.value.itemNumber = ''
form1.value.receiveQty = ''
form1.value.applyQty = ''
form1.value.stockQty = ''
form1.value.totalReception = ''
form1.value.isInAccount = ''
isInAccount.value = ''
return
}
form1.value.areaNumber = res.data.areaNumber
form1.value.itemName = res.data.itemName
form1.value.itemNumber = res.data.itemNumber
form1.value.receiveQty = res.data.receiveQty || 0
form1.value.applyQty = res.data.applyQty || 0
form1.value.stockQty = res.data.qty || 0
form1.value.totalReception = res.data.totalReception || 0
form1.value.isInAccount = res.data.isInAccount
isInAccount.value = res.data.isInAccount || ''
// this.itemNumber = res.data.itemNumber || ''
}).catch((error) => {
})
.catch((error) => {
msg.value = error.msg
form1.value.areaNumber = '';
form1.value.itemName = '';
form1.value.itemNumber = '';
form1.value.receiveQty = '';
form1.value.applyQty = '';
form1.value.stockQty = '';
isInAccount.value = '';
form1.value.areaNumber = ''
form1.value.itemName = ''
form1.value.itemNumber = ''
form1.value.receiveQty = ''
form1.value.applyQty = ''
form1.value.stockQty = ''
isInAccount.value = ''
})
}
function blur() {
}
function blur() {
if (form1.value.locationNumber) {
getLocation()
}
}
function handelScanMsg() {
}
function handelScanMsg() {
getLocation()
}
onLoad(async (option) => {
if (option.data && JSON.parse(decodeURIComponent(option.data)) && JSON.parse(decodeURIComponent(option
.data)).id) {
}
onLoad(async (option) => {
if (option.data && JSON.parse(decodeURIComponent(option.data)) && JSON.parse(decodeURIComponent(option.data)).id) {
let formData = JSON.parse(decodeURIComponent(option.data))
form.value.supplierName = formData.supplierName
form.value.number = formData.number
@ -383,36 +394,83 @@
form.value.costCenter = formData.costCenter
}
await getInLocationDetail()
})
const singleColumnList = ref([])
const field = ref('')
const singleColumnDefaultValue = ref([])
const isShowSelectItem = ref(false)
const sparePartsList = ref([])
//
function openSingleNewColumn(fieldName, val, list) {
if (!form1.value.areaNumber) {
proxy.$modal.showToast('请选择库位信息')
return
}
singleColumnList.value = []
field.value = fieldName
if (val) {
singleColumnDefaultValue.value = [list.findIndex((item) => item.value == val)]
} else {
singleColumnDefaultValue.value = []
}
costCenterRef.value.isShowSelectItem = true
}
async function searchItem(warehouseArea) {
proxy.$modal.loading('加载中')
await getSparePartsList(warehouseArea)
}
//
async function getSparePartsList(warehouseArea) {
let param = {
ccAccount: form.value.costCenter,
warehouseArea: warehouseArea ? warehouseArea : form1.value.areaNumber
}
await costCenterMappingApi
.findList(param)
.then((res) => {
res.data.map((item) => {
item.value = item.number
item.label = item.name
})
sparePartsList.value = res.data
singleColumnList.value = sparePartsList.value
proxy.$modal.closeLoading()
})
.catch(() => {
proxy.$modal.closeLoading()
})
}
</script>
<style lang="scss" scoped>
.add-form-container {
.add-form-container {
min-height: calc(100vh - 140rpx);
background: white;
padding: 0px 0rpx 140rpx;
}
}
.u-form-item {
.u-form-item {
padding: 20rpx 30rpx;
}
}
.disabled {
.disabled {
background: #f5f5f5;
}
}
.footer {
.footer {
position: fixed;
bottom: 0px;
left: 0px;
width: 100%;
z-index: 22;
}
}
.btns {
.btns {
display: flex;
button {
flex: 1;
}
@ -429,25 +487,25 @@
}
.reset {
background: #F5F5F5;
background: #f5f5f5;
border-radius: 0px;
&::after {
border-radius: 0px;
}
}
}
}
.right-button {
.right-button {
background: #409eff;
color: white;
padding: 0rpx 30rpx;
border-radius: 16rpx;
text-align: center;
font-size: 28rpx;
}
}
.select {
.select {
display: flex;
align-items: center;
height: 72rpx;
@ -463,11 +521,10 @@
flex: 1;
font-size: 28rpx;
color: rgb(192, 196, 204);
}
}
}
.title {
.title {
padding: 32rpx 0rpx;
position: relative;
@ -477,9 +534,9 @@
color: #fa3534;
top: 19px;
}
}
}
.list {
.list {
padding: 0rpx 30rpx;
.item {
@ -487,7 +544,7 @@
margin-bottom: 20rpx;
.item-box {
background: #F5F5F5;
background: #f5f5f5;
border-radius: 12rpx;
flex: 1;
width: 0rpx;
@ -508,31 +565,29 @@
color: #9c9c9c;
padding: 20rpx 30rpx 20rpx;
}
}
}
}
.add-btn {
.add-btn {
display: flex;
justify-content: flex-start;
align-items: center;
}
}
.popup-title {
.popup-title {
text-align: center;
font-size: 32rpx;
font-weight: bold;
color: #409eff;
padding: 30rpx 30rpx 0px
}
padding: 30rpx 30rpx 0px;
}
.popup {
.popup {
width: 600rpx;
padding: 30rpx 0rpx 30rpx;
}
}
.popup-footer {
.popup-footer {
display: flex;
border-top: 1px solid #e4e4e4;
@ -545,9 +600,9 @@
color: #409eff;
}
}
}
}
::v-deep .u-checkbox-group {
::v-deep .u-checkbox-group {
display: grid !important;
}
}
</style>
Loading…
Cancel
Save