| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211 |
- <template>
- <uni-navbar-lite :showRight=false title="物料申请"></uni-navbar-lite>
- <view class="page-container">
- <scroll-view class="page-content">
- <view class="section">
- <view class="search-bar">
- <view class="search-box">
- <image class="search-icon" src="/static/images/workbench/list/1.png" mode="aspectFit"></image>
- <input class="search-input" type="text" placeholder="请输入关键字查询" v-model="keyword" @input="handleSearch" />
- <view v-if="keyword.length > 0" class="clear-btn" @tap="clearKeyword">
- <text class="clear-btn-text">×</text>
- </view>
- <view class="search-btn" @tap="handleSearch">
- <text class="search-btn-text">搜索</text>
- </view>
- </view>
- </view>
-
- <view class="status-tabs">
- <scroll-view class="scroll-view_H" direction="horizontal" :show-scrollbar="false">
- <view
- v-for="(cat, idx) in categories"
- :key="idx"
- class="status-tab"
- :class="{ 'active': currentStatus === cat.id }"
- @click="switchStatus(cat.id)"
- >
- <text class="status-tab-text" :class="{ 'active-text': currentStatus === cat.id }">{{ cat.name }}</text>
- </view>
- </scroll-view>
- </view>
- </view>
- <view class="section">
- <view class="section-header">
- <view class="section-header-left">
- <view class="section-indicator"></view>
- <text class="section-title">物料列表</text>
- </view>
- <view class="add-material-btn" @click="showAddMaterialModal = true">
- <text class="add-material-text">新物料</text>
- </view>
- </view>
- <view class="material-list">
- <view
- v-for="(item, index) in dataList"
- :key="item.itemId + '_' + page"
- class="list-item"
- >
- <view class="item-header">
- <view class="item-info">
- <view class="item-name-row">
- <text class="item-name" :class="{'status-0': getAuditStatus(item) == 0, 'status-2': getAuditStatus(item) == 3}">{{ getItemName(item) }}</text>
- <text class="item-measure">{{ getMeasureName(item) }}</text>
- </view>
- <text class="item-sub-title">{{ getItemTypeName(item) }}</text>
- </view>
- <view v-if="item.isSelected" class="added-btn">
- <text class="added-icon">已选</text>
- </view>
- <view v-else-if="isItemDisabled(item)" class="add-btn disabled">
- <text class="add-icon">+</text>
- </view>
- <view v-else class="add-btn" @click.stop="addToSelected(item)">
- <text class="add-icon">+</text>
- </view>
- </view>
- </view>
- </view>
- <!-- 手动分页 -->
- <view class="pagination">
- <view class="page-btn" :class="{disabled: page <= 1}" @click="prevPage">
- <text class="page-btn-text"><</text>
- </view>
- <text class="page-info">第{{ page }}页 / 共{{ totalPages }}页</text>
- <view class="page-btn" :class="{disabled: page >= totalPages}" @click="nextPage">
- <text class="page-btn-text">></text>
- </view>
- </view>
- </view>
- <view class="section">
- <view class="section-header">
- <view class="section-header-left">
- <view class="section-indicator"></view>
- <text class="section-title">已选列表</text>
- </view>
- </view>
- <view class="selected-list">
- <view v-if="selectedItems.length === 0" class="empty-tip">
- <text class="empty-tip-text">请选择物料</text>
- </view>
- <view
- v-else
- v-for="(selItem, selIndex) in selectedItems"
- :key="selIndex"
- class="selected-item"
- >
- <text class="selected-item-name">{{ selItem.itemName }}</text>
- <text class="selected-item-measure">{{ selItem.measureName }}</text>
- <view class="quantity-control">
- <view class="qty-btn" @click="decreaseQty(selIndex)">
- <text class="qty-btn-text">-</text>
- </view>
- <input
- class="quantity-input"
- type="digit"
- v-model="selItem.qty"
- placeholder="数量"
- />
- <view class="qty-btn" @click="increaseQty(selIndex)">
- <text class="qty-btn-text">+</text>
- </view>
- </view>
- <view class="delete-btn" @click="removeSelected(selIndex)">
- <text class="delete-icon">×</text>
- </view>
- </view>
- </view>
- </view>
- </scroll-view>
-
- <!-- 底部按钮 -->
- <view class="bottom-buttons">
- <view class="btn-row">
- <button class="save-btn" @click="saveApplication">保存</button>
- <button class="confirm-btn" @click="confirmApplication">确认申请</button>
- </view>
- </view>
-
- <!-- 新增物料弹窗 -->
- <view v-if="showAddMaterialModal" class="picker-modal">
- <view class="modal-mask" @click="showAddMaterialModal = false"></view>
- <view class="modal-content">
- <view class="modal-header">
- <text class="modal-title">新增物料</text>
- <text class="modal-close" @click="showAddMaterialModal = false">取消</text>
- </view>
- <view class="form-item-input">
- <text class="label-picker">物料名称</text>
- <view class="view-input-picker">
- <input class="input-picker" type="text" placeholder="请输入物料名称" v-model="newMaterial.itemName" />
- </view>
- </view>
- <view class="form-item-input">
- <text class="label-picker">规格型号</text>
- <view class="view-input-picker">
- <input class="input-picker" type="text" placeholder="请输入规格型号" v-model="newMaterial.specification" />
- </view>
- </view>
- <view class="form-item-input">
- <text class="label-picker">单位</text>
- <view class="view-input-picker measure-input-row">
- <input class="input-picker" type="text" placeholder="请输入或选择单位" v-model="newMaterial.measureName" />
- <view class="pick-btn" @click="showMeasurePicker = true">
- <text class="pick-btn-text">选择</text>
- </view>
- </view>
- </view>
- <view class="form-item-btn">
- <button class="btn-primary" @click="handleAddMaterial">
- 保存
- </button>
- </view>
- </view>
- </view>
-
- <!-- 单位选择弹窗 -->
- <view v-if="showMeasurePicker" class="picker-modal">
- <view class="modal-mask" @click="showMeasurePicker = false"></view>
- <view class="modal-content">
- <view class="modal-header">
- <text class="modal-title">选择单位</text>
- <text class="modal-close" @click="showMeasurePicker = false">取消</text>
- </view>
- <scroll-view class="measure-list" :scroll-y="true">
- <view
- v-for="(item, index) in measureList"
- :key="index"
- class="measure-item"
- @click="selectMeasure(item)"
- >
- <text class="measure-name">{{ item['measureName'] }}</text>
- </view>
- <view v-if="measureList.length === 0" class="empty-tip">
- <text class="empty-tip-text">暂无单位数据</text>
- </view>
- </scroll-view>
- </view>
- </view>
- </view>
- </template>
- <script setup lang="uts">
- import { ref, computed, onBeforeUnmount, onMounted } from 'vue'
- import { getItemTypeListByParentId, getItemList, savePurchaseApply, confirmPurchaseApply, addMaterial, getMeasureList } from '../../api/apply/index'
- let searchTimer: number | null = null
-
- type CategoryItem = { id: string; name: string; code: string }
- type Item = { itemId: string; itemName: string; itemTypeName: string; measureName: string; isSelected?: boolean; auditStatus?: number }
- type SelectedItem = { itemId: string; itemName: string; itemTypeName: string; measureName: string; qty: string }
-
- const keyword = ref<string>("")
-
- const dataList = ref<Item[]>([])
- const selectedItems = ref<SelectedItem[]>([])
- const page = ref<number>(1)
- const pageSize: number = 10
- const total = ref<number>(0)
- const totalPages = computed((): number => {
- if (total.value <= 0) return 1
- return Math.ceil(total.value / pageSize)
- })
- const hasMore = ref<boolean>(true)
- const loading = ref<boolean>(false)
- const refreshing = ref<boolean>(false)
-
- const categories = ref<CategoryItem[]>([])
-
- const dealLoad = ref<boolean>(false)
- let currentStatus = ref<string>('')
- const isSearching = ref<boolean>(false)
- // 新增物料相关
- const showAddMaterialModal = ref<boolean>(false)
- const showMeasurePicker = ref<boolean>(false)
- const measureList = ref<UTSJSONObject[]>([])
- type NewMaterial = {
- itemName: string
- specification: string
- measureName: string
- }
- const newMaterial = ref<NewMaterial>({
- itemName: '',
- specification: '',
- measureName: ''
- })
- // 加载单位列表
- const loadMeasureList = (): void => {
- getMeasureList().then((res: any) => {
- const data = res as UTSJSONObject
- const list = data['data']
- if (list != null) {
- measureList.value = list as UTSJSONObject[]
- }
- }).catch(() => {
- measureList.value = []
- })
- }
- // 选择单位
- const selectMeasure = (item: UTSJSONObject): void => {
- const measureName = item['measureName'] != null ? item['measureName'].toString() : ''
- newMaterial.value.measureName = measureName
- showMeasurePicker.value = false
- }
-
- // 获取当前选中的分类code
- const getCurrentCategoryCode = (): string => {
- const currentCat = categories.value.find((c: CategoryItem) => c.id === currentStatus.value)
- return currentCat != null ? currentCat.code : ''
- }
-
- // 加载物料列表
- const loadItems = (): void => {
- loading.value = true
- const itemTypeCode = getCurrentCategoryCode()
- getItemList(itemTypeCode, page.value, pageSize, keyword.value).then((res: any) => {
- const data = res as UTSJSONObject
- const rows = data['rows']
- const totalNum = data['total']
- if (totalNum != null) {
- total.value = totalNum as number
- }
- if (rows != null) {
- const listData = rows as UTSJSONObject[]
- if (listData.length > 0) {
- const arr: Item[] = []
- const selectedIds = selectedItems.value.map((s: SelectedItem) => s.itemId)
- listData.forEach((item: UTSJSONObject) => {
- const itemId = item['itemId'] != null ? item['itemId'].toString() : ''
- let auditStatus = -1
- const auditStatusVal = item['auditStatus']
- if (auditStatusVal != null) {
- if (typeof auditStatusVal === 'number') {
- auditStatus = auditStatusVal as number
- } else {
- auditStatus = parseInt(auditStatusVal.toString())
- }
- }
- const it: Item = {
- itemId: itemId,
- itemName: item['itemName'] != null ? item['itemName'].toString() : '',
- itemTypeName: item['itemTypeName'] != null ? item['itemTypeName'].toString() : '',
- measureName: item['measureName'] != null ? item['measureName'].toString() : '',
- isSelected: selectedIds.includes(itemId),
- auditStatus: auditStatus
- }
- arr.push(it)
- })
- dataList.value = arr
- loading.value = false
- return
- }
- }
- dataList.value = []
- loading.value = false
- }).catch(() => {
- dataList.value = []
- loading.value = false
- })
- }
-
- // 上一页
- const prevPage = (): void => {
- if (page.value > 1) {
- page.value--
- loadItems()
- }
- }
-
- // 下一页
- const nextPage = (): void => {
- if (page.value < totalPages.value) {
- page.value++
- loadItems()
- }
- }
-
- const loadCategories = (): void => {
- getItemTypeListByParentId(200).then((res: any) => {
- const data = res as UTSJSONObject
- const list = data['data']
- if (list != null) {
- const listData = list as UTSJSONObject[]
- if (listData.length > 0) {
- const arr: CategoryItem[] = []
- listData.forEach((item: UTSJSONObject) => {
- const idVal = item['itemTypeId']
- const nameVal = item['itemTypeName']
- const codeVal = item['itemTypeCode']
- const cat: CategoryItem = {
- id: idVal != null ? idVal.toString() : '',
- name: nameVal != null ? nameVal.toString() : '',
- code: codeVal != null ? codeVal.toString() : ''
- }
- arr.push(cat)
- })
- const allItem: CategoryItem = {id: '', name: '全部', code: ''}
- arr.unshift(allItem)
- categories.value = arr
- // 加载第一个分类的物料
- if (arr.length > 0) {
- currentStatus.value = arr[0].id
- loadItems()
- }
- return
- }
- }
- const defaultArr: CategoryItem[] = []
- const defaultItem: CategoryItem = {id: '', name: '全部', code: ''}
- defaultArr.push(defaultItem)
- categories.value = defaultArr
- }).catch(() => {
- const defaultArr: CategoryItem[] = []
- const defaultItem: CategoryItem = {id: '', name: '全部', code: ''}
- defaultArr.push(defaultItem)
- categories.value = defaultArr
- })
- }
-
- // 添加到已选列表
- const addToSelected = (item: any | null): void => {
- if (item == null) return
- const mdItem = item as Item
- // 检查审核状态
- if (mdItem.auditStatus != null && mdItem.auditStatus === 2) {
- uni.showToast({ title: '该物料已禁用,无法添加', icon: 'none' })
- return
- }
- // 检查是否已存在
- const exists = selectedItems.value.find((s: SelectedItem) => s.itemId === mdItem.itemId)
- if (exists != null) {
- uni.showToast({ title: '该物料已在选择列表中', icon: 'none' })
- return
- }
- const selItem: SelectedItem = {
- itemId: mdItem.itemId,
- itemName: mdItem.itemName,
- itemTypeName: mdItem.itemTypeName,
- measureName: mdItem.measureName,
- qty: '1'
- }
- selectedItems.value.push(selItem)
- // 更新 dataList 中的选中状态
- const idx = dataList.value.findIndex((d: Item) => d.itemId === mdItem.itemId)
- if (idx >= 0) {
- dataList.value[idx].isSelected = true
- }
- }
-
- // 删除已选
- const removeSelected = (index: number): void => {
- const removedItem = selectedItems.value[index]
- selectedItems.value.splice(index, 1)
- // 重新加载当前页数据以更新选中状态
- loadItems()
- }
-
- // 增加数量
- const increaseQty = (index: number): void => {
- const currentQty = parseInt(selectedItems.value[index].qty)
- selectedItems.value[index].qty = (currentQty + 1).toString()
- }
-
- // 减少数量
- const decreaseQty = (index: number): void => {
- const currentQty = parseInt(selectedItems.value[index].qty)
- if (currentQty > 1) {
- selectedItems.value[index].qty = (currentQty - 1).toString()
- }
- }
-
- const handleItemClick = (item: any | null, index: number): void => {
- if (item == null) return
- const mdItem = item as Item
- uni.navigateTo({
- url: `/pages/item/itemDetail?id=${mdItem.itemId}`
- })
- }
- const getItemName = (item: any | null): string => {
- if (item == null) return ''
- const mdItem = item as Item
- return mdItem.itemName
- }
- const getItemTypeName = (item: any | null): string => {
- if (item == null) return ''
- const mdItem = item as Item
- return mdItem.itemTypeName
- }
- const getMeasureName = (item: any | null): string => {
- if (item == null) return ''
- const mdItem = item as Item
- return mdItem.measureName
- }
-
- const getAuditStatus = (item: any | null): number => {
- if (item == null) return -1
- const mdItem = item as Item
- return mdItem.auditStatus != null ? mdItem.auditStatus : -1
- }
-
- const isItemDisabled = (item: any | null): boolean => {
- if (item == null) return false
- const mdItem = item as Item
- const status = mdItem.auditStatus != null ? mdItem.auditStatus : -1
- return status == 3
- }
-
- // 检查物料是否已被选择
- const isItemSelected = (item: any | null): boolean => {
- if (item == null) return false
- const mdItem = item as Item
- return selectedItems.value.find((s: SelectedItem) => s.itemId === mdItem.itemId) != null
- }
- const handleSearch = (): void => {
- const timer = searchTimer
- if (timer != null) {
- clearTimeout(timer)
- }
- searchTimer = setTimeout(() => {
- page.value = 1
- loadItems()
- }, 300)
- }
-
- const clearKeyword = (): void => {
- keyword.value = ''
- page.value = 1
- loadItems()
- }
-
- const switchStatus = (status: string): void => {
- if (loading.value) {
- return;
- }
- if (isSearching.value) {
- return
- }
- isSearching.value = true
- currentStatus.value = status
- page.value = 1
- loadItems()
- setTimeout(() => {
- isSearching.value = false
- }, 100)
- }
- // 构建申请单数据
- const buildApplyData = (status: string): UTSJSONObject => {
- const applyLines: UTSJSONObject[] = []
- selectedItems.value.forEach((item: SelectedItem) => {
- const lineObj = new UTSJSONObject()
- lineObj['itemId'] = parseInt(item.itemId)
- lineObj['itemCode'] = ''
- lineObj['itemName'] = item.itemName
- lineObj['specification'] = ''
- lineObj['unitOfMeasure'] = ''
- lineObj['quantityApply'] = parseInt(item.qty)
- applyLines.push(lineObj)
- })
- const result = new UTSJSONObject()
- result['applyCode'] = ''
- result['applyName'] = '物料申请'
- result['status'] = status
- result['wmPurchaseApplyLineList'] = applyLines
- return result
- }
- // 来源页面
- const fromIndexPage = ref<boolean>(false)
- // 保存申请
- const saveApplication = (): void => {
- if (selectedItems.value.length === 0) {
- uni.showToast({ title: '请选择物料', icon: 'none' })
- return
- }
- // 构建申请单数据
- const applyData = buildApplyData('PREPARE')
- savePurchaseApply(applyData).then((res: any) => {
- uni.showToast({ title: '保存成功', icon: 'success' })
- // 清空已选列表
- selectedItems.value = []
- loadItems()
- // 如果从index.uvue跳转过来,返回index.uvue
- if (fromIndexPage.value) {
- setTimeout(() => {
- uni.navigateBack()
- }, 1000)
- }else{
- uni.navigateTo({
- url: `/pages/apply/index?from=new`
- })
- }
- }).catch((e) => {
- console.log(e)
- const error = e as UTSError
- const errMsg = error?.message
- uni.showToast({ title: errMsg.toString(), icon: 'none' })
- })
- }
- // 确认申请
- const confirmApplication = (): void => {
- if (selectedItems.value.length === 0) {
- uni.showToast({ title: '请选择物料', icon: 'none' })
- return
- }
- // 验证所有数量都大于0
- for (let i = 0; i < selectedItems.value.length; i++) {
- const qty = parseFloat(selectedItems.value[i].qty)
- if (qty <= 0) {
- uni.showToast({ title: '所有物料数量必须大于0', icon: 'none' })
- return
- }
- }
- // 构建申请单数据
- const applyData = buildApplyData('CONFIRMED')
- savePurchaseApply(applyData).then((res: any) => {
- uni.showToast({ title: '确认申请成功', icon: 'success' })
- // 清空已选列表
- selectedItems.value = []
- loadItems()
- // 如果从index.uvue跳转过来,返回index.uvue
- if (fromIndexPage.value) {
- setTimeout(() => {
- uni.navigateBack()
- }, 1000)
- }else{
- uni.navigateTo({
- url: `/pages/apply/index?from=new`
- })
- }
- }).catch((e) => {
- const error = e as UTSError
- const errMsg = error?.message
- uni.showToast({ title: errMsg.toString(), icon: 'none' })
- })
- }
- // 处理新增物料
- const handleAddMaterial = async (): Promise<void> => {
- // 验证输入
- if (newMaterial.value.itemName.length == 0) {
- uni.showToast({ title: '请输入物料名称', icon: 'none' })
- return
- }
- if (newMaterial.value.measureName.length == 0) {
- uni.showToast({ title: '请输入单位', icon: 'none' })
- return
- }
-
- try {
- // 构建物料数据
- const materialData = new UTSJSONObject()
- materialData['itemShortName'] = newMaterial.value.itemName
- materialData['itemName'] = newMaterial.value.itemName + "("+newMaterial.value.specification+")"
- materialData['specification'] = newMaterial.value.specification
- materialData['measureName'] = newMaterial.value.measureName
- materialData['auditStatus'] = 0 // 审核状态为0
-
- // 调用接口保存物料
- await addMaterial(materialData)
-
- // 保存成功
- uni.showToast({ title: '物料新增成功', icon: 'success' })
-
- // 关闭弹窗
- showAddMaterialModal.value = false
-
- // 清空表单
- newMaterial.value = {
- itemName: '',
- specification: '',
- measureName: ''
- } as NewMaterial
-
- // 重新加载物料列表
- loadItems()
- } catch (e: any) {
- uni.showToast({ title: e.message ?? '物料新增失败', icon: 'none' })
- }
- }
- onMounted(() => {
- loadCategories()
- loadMeasureList()
- // 获取页面参数,判断是否从index.uvue跳转过来
- const pages = getCurrentPages()
- const currentPage = pages[pages.length - 1]
- const options = currentPage.options
- if (options != null && options.from == 'index') {
- fromIndexPage.value = true
- }
- })
- </script>
- <style lang="scss">
- .page-container {
- flex: 1;
- background-color: #f5f8fe;
- padding-top: env(safe-area-inset-top);
- background-color: #e8f0f9;
- padding: 0rpx 20rpx 0rpx 20rpx;
- }
- .page-content {
- flex: 1;
- padding: 0rpx;
- padding-bottom: 150rpx;
- box-sizing: border-box;
- }
- .section {
- margin-top: 10rpx;
- padding: 0 10rpx 10rpx;
-
- background: #ffffff;
- border-radius: 16rpx;
-
- .section-header {
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- padding: 30rpx 10rpx 20rpx;
- }
-
- .section-header-left {
- flex-direction: row;
- align-items: center;
- }
-
- .add-material-btn {
- padding: 8rpx 16rpx;
- background-color: #007aff;
- border-radius: 8rpx;
- }
-
- .add-material-text {
- color: #ffffff;
- font-size: 24rpx;
- font-weight: bold;
- }
-
- &-indicator {
- width: 6rpx;
- height: 32rpx;
- background-color: #007aff;
- border-radius: 3rpx;
- margin-right: 12rpx;
- }
-
- &-title {
- font-size: 36rpx;
- color: #333333;
- font-weight: bold;
- }
- }
- .search-bar {
- padding: 10rpx 3rpx;
- }
- .search-box {
- flex-direction: row;
- align-items: center;
- height: 72rpx;
- padding: 0 24rpx;
- background-color: #f5f5f5;
- border-radius: 16rpx;
-
- .search-icon {
- width: 32rpx;
- height: 32rpx;
- margin-right: 12rpx;
- }
-
- .search-input {
- flex: 1;
- font-size: 28rpx;
- color: #333333;
- }
-
- .search-btn {
- padding: 10rpx 20rpx;
- background-color: #007aff;
- border-radius: 8rpx;
- margin-left: 10rpx;
- }
- .search-btn-text {
- color: #ffffff;
- font-size: 24rpx;
- }
- .clear-btn {
- width: 36rpx;
- height: 36rpx;
- border-radius: 18rpx;
- background-color: #cccccc;
- align-items: center;
- justify-content: center;
- margin-left: 10rpx;
- }
- .clear-btn-text {
- color: #ffffff;
- font-size: 24rpx;
- font-weight: bold;
- }
- }
- .status-tabs {
- padding: 20rpx 30rpx;
- background-color: #ffffff;
- border-bottom: 1rpx solid #eeeeee;
- }
- .scroll-view_H {
- width: 100%;
- flex-direction: row;
- }
- .status-tab {
- padding: 16rpx 24rpx;
- text-align: center;
- margin-right: 16rpx;
- border-radius: 8rpx;
- background-color: #f5f5f5;
- flex-shrink: 0;
- &:last-child {
- margin-right: 0;
- }
- &.active {
- background-color: #007aff;
- }
- .status-tab-text {
- font-size: 26rpx;
- color: #666666;
- &.active-text {
- color: #ffffff;
- font-weight: bold;
- }
- }
- }
- .list-item {
- margin: 3rpx;
- padding: 10rpx 10rpx 0rpx 10rpx;
- border-bottom: 1px solid #f9f9f9;
- }
- .item-header {
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 10rpx;
- }
- .item-title {
- flex: 1;
- }
- .item-name {
- font-size: 28rpx;
- color: #333333;
- font-weight: bold;
-
- &.status-0 {
- color: #ff4d4f;
- }
-
- &.status-2 {
- color: #999999;
- }
- }
- .item-name-row {
- flex-direction: row;
- align-items: center;
- }
- .item-measure {
- font-size: 24rpx;
- color: #999999;
- margin-left: 10rpx;
- }
- .item-sub-title {
- flex: 1;
- font-size: 23rpx;
- color: #797979;
- margin-left: 10rpx;
- }
- .item-measure {
- font-size: 23rpx;
- color: #999999;
- margin-left: 10rpx;
- }
- .add-btn {
- width: 44rpx;
- height: 44rpx;
- border-radius: 22rpx;
- background-color: #165DFF;
- color: #FFFFFF;
- align-items: center;
- justify-content: center;
- }
-
- .add-btn.disabled {
- background-color: #cccccc;
- }
-
- .added-btn {
- padding: 8rpx 16rpx;
- border-radius: 8rpx;
- align-items: center;
- justify-content: center;
- }
-
- .added-icon {
- color: #ff4d4f;
- font-size: 24rpx;
- }
-
- .detail-link {
- font-size: 21rpx;
- color: #999999;
- }
-
- .material-list {
- max-height: 720rpx;
- overflow-y: auto;
- }
-
- .pagination {
- flex-direction: row;
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 20rpx;
- gap: 30rpx;
- }
-
- .page-btn {
- padding: 10rpx 20rpx;
- margin: 5px;
- background-color: #165DFF;
- border-radius: 8rpx;
- }
-
- .page-btn.disabled {
- background-color: #cccccc;
- }
-
- .page-btn-text {
- color: #FFFFFF;
- font-size: 26rpx;
- }
-
- .page-info {
- font-size: 26rpx;
- color: #666666;
- }
-
- .selected-list {
- padding: 20rpx;
- background-color: #ffffff;
- min-height: 150rpx;
- display: flex;
- flex-direction: column;
- gap: 15rpx;
- }
- .empty-tip {
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 40rpx;
- }
- .empty-tip-text {
- color: #999999;
- font-size: 28rpx;
- }
- .selected-item {
- display: flex;
- flex-direction: row;
- align-items: center;
- background-color: #ffffff;
- border-radius: 10rpx;
- padding: 20rpx;
- border: 1rpx solid #e5e5e5;
- box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.05);
- white-space: nowrap;
- }
- .selected-item-name {
- font-size: 26rpx;
- color: #333333;
- margin-right: 20rpx;
- font-weight: 500;
- // white-space: nowrap;
- max-width: 180rpx;
- // overflow: hidden;
- // text-overflow: ellipsis;
- flex-shrink: 0;
- }
- .selected-item-measure {
- font-size: 24rpx;
- color: #999999;
- margin-right: 20rpx;
- flex-shrink: 0;
- }
- .quantity-control {
- display: flex;
- flex-direction: row;
- align-items: center;
- margin-left: auto;
- margin-right: 20rpx;
- flex-shrink: 0;
- }
- .qty-btn {
- width: 44rpx;
- height: 44rpx;
- background-color: #f5f5f5;
- border-radius: 6rpx;
- align-items: center;
- justify-content: center;
- border: 1rpx solid #e5e5e5;
- }
- .qty-btn-text {
- color: #333333;
- font-size: 28rpx;
- font-weight: bold;
- }
- .quantity-input {
- width: 160rpx;
- height: 44rpx;
- background-color: #f5f5f5;
- border-radius: 6rpx;
- font-size: 24rpx;
- padding: 0 10rpx;
- border: 1rpx solid #e5e5e5;
- text-align: center;
- margin: 0 10rpx;
- }
- .quantity-input:focus {
- outline: none;
- border-color: #007aff;
- background-color: #ffffff;
- }
- .delete-btn {
- width: 40rpx;
- height: 40rpx;
- border-radius: 20rpx;
- background-color: #ff4d4f;
- align-items: center;
- justify-content: center;
- display: flex;
- flex-shrink: 0; // 防止删除按钮被压缩
- }
- .delete-icon {
- color: #ffffff;
- font-size: 30rpx;
- font-weight: bold;
- }
- /* 底部按钮 */
- .bottom-buttons {
- padding: 20rpx;
- background-color: #ffffff;
- border-top: 1rpx solid #e5e5e5;
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- z-index: 100;
- box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
- }
- .btn-row {
- flex-direction: row;
- display: flex;
- gap: 20rpx;
- }
- .save-btn {
- width: 180rpx;
- height: 80rpx;
- background-color: #f5f5f5;
- color: #333333;
- font-size: 28rpx;
- font-weight: 500;
- border-radius: 20rpx;
- border: 1rpx solid #e5e5e5;
- }
- .confirm-btn {
- flex: 1;
- height: 80rpx;
- background-color: #007aff;
- color: #ffffff;
- font-size: 28rpx;
- font-weight: 600;
- border-radius: 20rpx;
- margin-left: 10rpx;
- border: none;
- box-shadow: 0 2rpx 8rpx rgba(0, 122, 255, 0.3);
- }
- /* 新增物料弹窗样式 */
- .picker-modal {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- z-index: 1000;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .modal-mask {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: rgba(0, 0, 0, 0.5);
- }
- .modal-content {
- position: relative;
- width: 90%;
- // max-width: 500rpx;
- background-color: #ffffff;
- border-radius: 16rpx;
- padding: 30rpx;
- box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.15);
- }
- .modal-header {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 30rpx;
- padding-bottom: 20rpx;
- border-bottom: 1rpx solid #e5e5e5;
- }
- .modal-title {
- font-size: 32rpx;
- font-weight: bold;
- color: #333333;
- }
- .modal-close {
- font-size: 28rpx;
- color: #999999;
- padding: 8rpx 16rpx;
- border-radius: 8rpx;
- background-color: #f5f5f5;
- }
- .form-item-input {
- display: flex;
- flex-direction: column;
- margin-bottom: 24rpx;
- }
- .label-picker {
- font-size: 28rpx;
- color: #333333;
- margin-bottom: 12rpx;
- font-weight: 500;
- }
- .view-input-picker {
- position: relative;
- width: 100%;
- }
- .input-picker {
- width: 100%;
- height: 80rpx;
- padding: 0 24rpx;
- background-color: #f5f5f5;
- border-radius: 12rpx;
- font-size: 28rpx;
- color: #333333;
- border: 1rpx solid #e5e5e5;
- }
- .input-picker:focus {
- outline: none;
- border-color: #007aff;
- background-color: #ffffff;
- }
- .form-item-btn {
- margin-top: 30rpx;
- display: flex;
- justify-content: center;
- }
- .btn-primary {
- width: 100%;
- height: 80rpx;
- background-color: #007aff;
- color: #ffffff;
- font-size: 28rpx;
- font-weight: 600;
- border-radius: 12rpx;
- border: none;
- box-shadow: 0 2rpx 8rpx rgba(0, 122, 255, 0.3);
- }
- .add-icon{
- color: #ffffff;
- }
-
- .measure-list {
- max-height: 500rpx;
- overflow-y: auto;
- }
-
- .measure-item {
- padding: 24rpx;
- border-bottom: 1rpx solid #f0f0f0;
- }
-
- .measure-name {
- font-size: 28rpx;
- color: #333333;
- }
-
- .measure-input-row {
- flex-direction: row;
- align-items: center;
- }
-
- .measure-input-row .input-picker {
- flex: 1;
- margin-right: 16rpx;
- }
-
- .pick-btn {
- padding: 16rpx 24rpx;
- background-color: #007aff;
- border-radius: 8rpx;
- }
-
- .pick-btn-text {
- color: #ffffff;
- font-size: 26rpx;
- }
- </style>
|