| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025 |
- <template>
- <uni-navbar-lite :showRight="showRightBtn" :title="getPageTitle()" :rightBtnText="rightBtnText" :rightBtnStyle="rightBtnStyle" @rightClick="handleDelete"></uni-navbar-lite>
- <view class="page-container">
- <scroll-view class="page-content" :scroll-y="true">
- <view class="section">
- <view class="section-header">
- <view class="section-indicator"></view>
- <text class="section-title">产品信息</text>
- </view>
- <view class="form-card">
- <view v-if="selectedProduct != null" class="selected-product-card" @click="openProductPicker">
- <view class="selected-product-info">
- <text class="selected-product-name">{{ selectedProduct.itemName }}</text>
- <text class="selected-product-code">编码: {{ selectedProduct.itemCode }}</text>
- <text class="selected-product-spec" v-if="selectedProduct.specification != null && selectedProduct.specification.length > 0">规格: {{ selectedProduct.specification }}</text>
- </view>
- <view class="change-product-btn" v-if="!isEdit">
- <text class="change-product-text">更换</text>
- </view>
- </view>
- <view v-else class="select-product-btn" @click="openProductPicker">
- <text class="select-product-text">+ 请选择产品</text>
- </view>
- </view>
- </view>
- <view class="section">
- <view class="section-header">
- <view class="section-indicator"></view>
- <text class="section-title">汇报信息</text>
- </view>
- <view class="form-card">
- <view class="form-row">
- <text class="form-label">汇报数量</text>
- <input class="form-input" :class="{ 'disabled': formStatus !== 'PREPARE' }" type="digit" placeholder="请输入数量" v-model="formData.quantity" :disabled="formStatus !== 'PREPARE'" />
- </view>
- <view class="form-row">
- <text class="form-label">单位</text>
- <view class="form-input-static">包</view>
- </view>
- <view class="form-row">
- <text class="form-label">报工日期</text>
- <view class="form-input disabled">{{ formData.reportDate || currentDate }}</view>
- </view>
- <view class="form-row">
- <text class="form-label">开始时间</text>
- <view class="input-with-btn">
- <input class="form-input" :class="{ 'disabled': formStatus !== 'PREPARE' }" type="text" :value="formData.startTime" placeholder="请输入时间" :disabled="formStatus !== 'PREPARE'" />
- <picker v-if="formStatus === 'PREPARE'" mode="time" :value="formData.startTime" @change="onStartTimeChange">
- <view class="picker-btn">选择</view>
- </picker>
- </view>
- </view>
- <view class="form-row">
- <text class="form-label">结束时间</text>
- <view class="input-with-btn">
- <input class="form-input" :class="{ 'disabled': formStatus !== 'PREPARE' }" type="text" :value="formData.endTime" placeholder="请输入时间" :disabled="formStatus !== 'PREPARE'" />
- <picker v-if="formStatus === 'PREPARE'" mode="time" :value="formData.endTime" @change="onEndTimeChange">
- <view class="picker-btn">选择</view>
- </picker>
- </view>
- </view>
- </view>
- </view>
- <view class="section">
- <view class="section-header">
- <view class="section-indicator"></view>
- <text class="section-title">备注</text>
- </view>
- <view class="form-card">
- <view class="form-row">
- <textarea class="form-textarea" placeholder="请输入备注" v-model="formData.remark" />
- </view>
- </view>
- </view>
- </scroll-view>
- <view class="bottom-buttons" v-if="formStatus === 'PREPARE'">
- <button class="save-btn" @click="handleSave">保存</button>
- <button class="confirm-btn" @click="handleSaveAndConfirm">保存&确认</button>
- </view>
- <view v-if="showProductPicker" class="picker-modal">
- <view class="modal-mask" @click="closeProductPicker"></view>
- <view class="modal-content">
- <view class="modal-header">
- <text class="modal-title">选择产品</text>
- <text class="modal-close" @click="closeProductPicker">取消</text>
- </view>
- <view class="search-bar">
- <view class="search-box">
- <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>
- <scroll-view class="product-list-scroll" :scroll-y="true">
- <view
- v-for="(item, index) in productList"
- :key="item.itemId + '_' + page"
- class="list-item"
- >
- <view class="item-header">
- <view class="item-info">
- <view class="item-name-row">
- <text class="item-name">{{ item.itemName }}</text>
- </view>
- <view class="item-sub-row">
- <text class="item-sub-title">{{ item.itemTypeName }}</text>
- <text class="item-code">{{ item.itemCode }}</text>
- </view>
- </view>
- <view class="add-btn" @click.stop="selectProduct(item)">
- <text class="add-icon">+</text>
- </view>
- </view>
- </view>
- <view v-if="productList.length === 0 && !loading" class="empty-tip">
- <text class="empty-tip-text">暂无产品</text>
- </view>
- </scroll-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>
- </view>
- </template>
- <script setup lang="uts">
- import { ref, computed } from 'vue'
- import { onLoad } from '@dcloudio/uni-app';
- import { getProReportById, addProReport, updateProReport, confirmProReport, delProReport, getProductList } from '../../api/pro/index'
- import { getUserInfo } from '../../utils/storage'
- type ProductItem = {
- itemId: string
- itemCode: string
- itemName: string
- itemTypeName: string
- specification: string
- measureName: string
- unitOfMeasure: string
- }
- const getTodayStr = (): string => {
- const d = new Date()
- const y = d.getFullYear()
- const m = (d.getMonth() + 1).toString().padStart(2, '0')
- const day = d.getDate().toString().padStart(2, '0')
- return `${y}-${m}-${day}`
- }
- const extractTime = (datetimeStr: string): string => {
- if (!datetimeStr) return ''
- const parts = datetimeStr.split(' ')
- if (parts.length >= 2) {
- return parts[1].substring(0, 5)
- }
- return ''
- }
- const isEdit = ref<boolean>(false)
- const reportId = ref<string>('')
- const formStatus = ref<string>('')
- const currentDate = ref<string>(getTodayStr())
- let searchTimer: number | null = null
- const getPageTitle = (): string => {
- if (!isEdit.value) {
- return '新增生产汇报'
- }
- if (formStatus.value === 'PREPARE') {
- return '编辑生产汇报'
- }
- return '查看生产汇报'
- }
- const showRightBtn = computed(() => {
- return isEdit.value && formStatus.value === 'PREPARE'
- })
- const rightBtnText = computed(() => {
- return isEdit.value && formStatus.value === 'PREPARE' ? '删除' : ''
- })
- const rightBtnStyle = computed(() => {
- return {
- backgroundColor: '#ff4d4f',
- color: '#ffffff',
- fontSize: '28rpx',
- padding: '8rpx 20rpx',
- borderRadius: '8rpx'
- }
- })
- const formData = ref<UTSJSONObject>({
- productCode: '',
- productName: '',
- specification: '',
- quantity: '',
- unitOfMeasure: '',
- unitName: '',
- reportDate: '',
- startTime: '',
- endTime: '',
- remark: ''
- })
- const selectedProduct = ref<ProductItem | null>(null)
- const showProductPicker = ref<boolean>(false)
- const keyword = ref<string>("")
- const onReportDateChange = (e: any): void => {
- formData.value['reportDate'] = e.detail.value as string
- }
- const onStartTimeChange = (e: any): void => {
- formData.value['startTime'] = e.detail.value as string
- }
- const onEndTimeChange = (e: any): void => {
- formData.value['endTime'] = e.detail.value as string
- }
- const productList = ref<ProductItem[]>([])
- const page = ref<number>(1)
- const pageSize: number = 10
- const total = ref<number>(0)
- const loading = ref<boolean>(false)
- const totalPages = computed((): number => {
- if (total.value <= 0) return 1
- return Math.ceil(total.value / pageSize)
- })
- const loadProducts = (): void => {
- loading.value = true
- getProductList(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[]
- const arr: ProductItem[] = []
- listData.forEach((item: UTSJSONObject) => {
- const it: ProductItem = {
- itemId: item['itemId'] != null ? item['itemId'].toString() : '',
- itemCode: item['itemCode'] != null ? item['itemCode'].toString() : '',
- itemName: item['itemName'] != null ? item['itemName'].toString() : '',
- itemTypeName: item['itemTypeName'] != null ? item['itemTypeName'].toString() : '',
- specification: item['specification'] != null ? item['specification'].toString() : '',
- measureName: item['measureName'] != null ? item['measureName'].toString() : '',
- unitOfMeasure: item['unitOfMeasure'] != null ? item['unitOfMeasure'].toString() : ''
- }
- arr.push(it)
- })
- productList.value = arr
- } else {
- productList.value = []
- }
- loading.value = false
- }).catch(() => {
- productList.value = []
- loading.value = false
- })
- }
- const selectProduct = (item: ProductItem): void => {
- selectedProduct.value = item
- formData.value['productCode'] = item.itemCode
- formData.value['productName'] = item.itemName
- formData.value['specification'] = item.specification
- formData.value['unitOfMeasure'] = item.unitOfMeasure || ''
- showProductPicker.value = false
- }
- const openProductPicker = (): void => {
- if (isEdit.value) return
- showProductPicker.value = true
- loadProducts()
- }
- const closeProductPicker = (): void => {
- showProductPicker.value = false
- keyword.value = ''
- page.value = 1
- }
- const prevPage = (): void => {
- if (page.value > 1) {
- page.value--
- loadProducts()
- }
- }
- const nextPage = (): void => {
- if (page.value < totalPages.value) {
- page.value++
- loadProducts()
- }
- }
- const handleSearch = (): void => {
- const timer = searchTimer
- if (timer != null) {
- clearTimeout(timer)
- }
- searchTimer = setTimeout(() => {
- page.value = 1
- loadProducts()
- }, 300)
- }
- const clearKeyword = (): void => {
- keyword.value = ''
- page.value = 1
- loadProducts()
- }
- const loadDetail = (): void => {
- if (reportId.value.length === 0) return
- getProReportById(reportId.value).then((response: any) => {
- const res = response as UTSJSONObject
- const data = res["data"] as UTSJSONObject
- formData.value['productCode'] = data['productCode'] != null ? data['productCode'].toString() : ''
- formData.value['productName'] = data['productName'] != null ? data['productName'].toString() : ''
- formData.value['specification'] = data['specification'] != null ? data['specification'].toString() : ''
- formData.value['quantity'] = data['quantity'] != null ? data['quantity'].toString() : ''
- formData.value['unitOfMeasure'] = data['unitOfMeasure'] != null ? data['unitOfMeasure'].toString() : ''
- formData.value['unitName'] = data['unitName'] != null ? data['unitName'].toString() : ''
- formData.value['reportDate'] = data['reportDate'] != null ? data['reportDate'].toString() : ''
- formData.value['startTime'] = data['startTime'] != null ? extractTime(data['startTime'].toString()) : ''
- formData.value['endTime'] = data['endTime'] != null ? extractTime(data['endTime'].toString()) : ''
- formData.value['remark'] = data['remark'] != null ? data['remark'].toString() : ''
- formStatus.value = data['status'] != null ? data['status'].toString() : ''
- const pc = formData.value['productCode'] as string
- const pn = formData.value['productName'] as string
- const spec = formData.value['specification'] as string
- selectedProduct.value = {
- itemId: data['productId'] != null ? data['productId'].toString() : '',
- itemCode: pc,
- itemName: pn,
- itemTypeName: '',
- specification: spec,
- measureName: ''
- }
- }).catch((e) => {
- const error = e as UTSError
- const errMsg = error?.message
- uni.showToast({ title: errMsg.toString(), icon: 'none' })
- })
- }
- const buildSubmitData = (): UTSJSONObject => {
- const data = new UTSJSONObject()
- if (isEdit.value && reportId.value.length > 0) {
- data['reportId'] = parseInt(reportId.value)
- }
- data['productId'] = selectedProduct.value?.itemId ? parseInt(selectedProduct.value.itemId) : null
- data['productCode'] = formData.value['productCode']
- data['productName'] = formData.value['productName']
- data['specification'] = formData.value['specification']
- data['quantity'] = formData.value['quantity']
- data['unitName'] = '包'
- data['attr1'] = 'APP'
-
- const userInfo = getUserInfo()
- if (userInfo != null) {
- data['reporter'] = userInfo['nickName'] || userInfo['userName'] || userInfo['name'] || ''
- data['reporterId'] = userInfo['userId'] || userInfo['id'] || ''
- }
-
- const reportDate = formData.value['reportDate'] || currentDate.value
- data['reportDate'] = reportDate
-
- const startTime = formData.value['startTime']
- data['startTime'] = startTime ? `${reportDate} ${startTime}:00` : ''
-
- const endTime = formData.value['endTime']
- data['endTime'] = endTime ? `${reportDate} ${endTime}:00` : ''
-
- const remark = formData.value['remark']
- if (remark && remark.trim().length > 0) {
- data['remark'] = remark.trim()
- }
- return data
- }
- const handleSave = (): void => {
- if (selectedProduct.value == null) {
- uni.showToast({ title: '请选择产品', icon: 'none' })
- return
- }
-
- const quantity = formData.value['quantity']
- const quantityStr = String(quantity).trim()
- if (!quantityStr) {
- uni.showToast({ title: '请输入汇报数量', icon: 'none' })
- return
- }
- const num = Number(quantityStr)
- if (isNaN(num) || num <= 0) {
- uni.showToast({ title: '汇报数量必须大于0', icon: 'none' })
- return
- }
-
- const startTime = formData.value['startTime']
- if (!startTime || String(startTime).trim().length === 0) {
- uni.showToast({ title: '请选择开始时间', icon: 'none' })
- return
- }
-
- const endTime = formData.value['endTime']
- if (!endTime || String(endTime).trim().length === 0) {
- uni.showToast({ title: '请选择结束时间', icon: 'none' })
- return
- }
-
- const data = buildSubmitData()
-
- const api = isEdit.value ? updateProReport : addProReport
- api(data).then((res: any) => {
- uni.showToast({ title: '保存成功', icon: 'success' })
- uni.setStorageSync('needRefresh', 'true')
- setTimeout(() => {
- uni.navigateBack()
- }, 1500)
- }).catch((e) => {
- const error = e as UTSError
- const errMsg = error?.message
- uni.showToast({ title: errMsg.toString(), icon: 'none' })
- })
- }
- const handleConfirm = (): void => {
- uni.showModal({
- title: '提示',
- content: '确认该生产汇报?',
- success: (res) => {
- if (res.confirm) {
- const data = new UTSJSONObject()
- data['reportId'] = parseInt(reportId.value)
- data['status'] = 'CONFIRMED'
- confirmProReport(data).then((res: any) => {
- uni.showToast({ title: '确认成功', icon: 'success' })
- uni.setStorageSync('needRefresh', 'true')
- setTimeout(() => {
- uni.navigateBack()
- }, 1500)
- }).catch((e) => {
- const error = e as UTSError
- const errMsg = error?.message
- uni.showToast({ title: errMsg.toString(), icon: 'none' })
- })
- }
- }
- })
- }
- const handleSaveAndConfirm = (): void => {
- if (selectedProduct.value == null) {
- uni.showToast({ title: '请选择产品', icon: 'none' })
- return
- }
-
- const quantity = formData.value['quantity']
- const quantityStr = String(quantity).trim()
- if (!quantityStr) {
- uni.showToast({ title: '请输入汇报数量', icon: 'none' })
- return
- }
- const num = Number(quantityStr)
- if (isNaN(num) || num <= 0) {
- uni.showToast({ title: '汇报数量必须大于0', icon: 'none' })
- return
- }
-
- const startTime = formData.value['startTime']
- if (!startTime || String(startTime).trim().length === 0) {
- uni.showToast({ title: '请选择开始时间', icon: 'none' })
- return
- }
-
- const endTime = formData.value['endTime']
- if (!endTime || String(endTime).trim().length === 0) {
- uni.showToast({ title: '请选择结束时间', icon: 'none' })
- return
- }
-
- const data = buildSubmitData()
- data['status'] = 'CONFIRMED'
-
- addProReport(data).then((res: any) => {
- uni.showToast({ title: '保存并确认成功', icon: 'success' })
- uni.setStorageSync('needRefresh', 'true')
- setTimeout(() => {
- uni.navigateBack()
- }, 1500)
- }).catch((e) => {
- const error = e as UTSError
- const errMsg = error?.message
- uni.showToast({ title: errMsg.toString(), icon: 'none' })
- })
- }
- const handleDelete = (): void => {
- uni.showModal({
- title: '提示',
- content: '确定要删除该生产汇报吗?',
- success: (res) => {
- if (res.confirm) {
- delProReport(reportId.value).then((res: any) => {
- uni.showToast({ title: '删除成功', icon: 'success' })
- uni.setStorageSync('needRefresh', 'true')
- setTimeout(() => {
- uni.navigateBack()
- }, 1500)
- }).catch((e) => {
- const error = e as UTSError
- const errMsg = error?.message
- uni.showToast({ title: errMsg.toString(), icon: 'none' })
- })
- }
- }
- })
- }
- onLoad((options: any) => {
- const params = options as UTSJSONObject
- if (params != null && params['id'] != null) {
- isEdit.value = true
- reportId.value = params['id'].toString()
- loadDetail()
- } else {
- formData.value['reportDate'] = getTodayStr()
- formStatus.value = 'PREPARE'
- }
- })
- </script>
- <style lang="scss">
- .page-container {
- flex: 1;
- background-color: #e8f0f9;
- }
- .page-content {
- flex: 1;
- padding: 20rpx;
- padding-bottom: 130rpx;
- }
- .section {
- margin-bottom: 20rpx;
- background: #ffffff;
- border-radius: 16rpx;
- padding: 20rpx;
- }
- .section-header {
- flex-direction: row;
- align-items: center;
- margin-bottom: 20rpx;
- }
- .section-indicator {
- width: 6rpx;
- height: 32rpx;
- background-color: #007aff;
- border-radius: 3rpx;
- margin-right: 12rpx;
- }
- .section-title {
- font-size: 32rpx;
- color: #333333;
- font-weight: bold;
- }
- .form-card {
- background-color: #f8f9fa;
- border-radius: 8rpx;
- padding: 20rpx;
- }
- .form-row {
- flex-direction: row;
- align-items: center;
- margin-bottom: 20rpx;
- &:last-child {
- margin-bottom: 0;
- }
- }
- .form-label {
- width: 140rpx;
- font-size: 28rpx;
- color: #666666;
- white-space: nowrap;
- }
- .form-input {
- flex: 1;
- height: 60rpx;
- padding: 0 16rpx;
- background-color: #ffffff;
- border-radius: 8rpx;
- font-size: 28rpx;
- color: #333333;
- border: 1rpx solid #e5e5e5;
- }
- .form-input-static {
- flex: 1;
- height: 60rpx;
- padding: 0 16rpx;
- background-color: #f0f0f0;
- border-radius: 8rpx;
- font-size: 28rpx;
- color: #666666;
- line-height: 60rpx;
- border: 1rpx solid #e5e5e5;
- }
- .form-input.disabled {
- background-color: #f0f0f0;
- color: #666666;
- line-height: 60rpx;
- }
- .input-with-btn {
- flex: 1;
- display: flex;
- flex-direction: row;
- align-items: center;
- }
- .input-with-btn .form-input {
- flex: 1;
- height: 60rpx;
- border-radius: 8rpx 0 0 8rpx;
- border-right: none;
- }
- .picker-btn {
- width: 100rpx;
- height: 60rpx;
- line-height: 60rpx;
- text-align: center;
- background-color: #409eff;
- color: #ffffff;
- font-size: 26rpx;
- border-radius: 0 8rpx 8rpx 0;
- }
- .datetime-pickers {
- flex: 1;
- flex-direction: row;
- gap: 12rpx;
- }
- .picker-input {
- line-height: 60rpx;
- }
- .date-part {
- flex: 2;
- }
- .time-part {
- flex: 1;
- }
- .form-textarea {
- flex: 1;
- min-height: 120rpx;
- padding: 16rpx;
- background-color: #ffffff;
- border-radius: 8rpx;
- font-size: 28rpx;
- color: #333333;
- border: 1rpx solid #e5e5e5;
- }
- .bottom-buttons {
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- padding: 20rpx 30rpx;
- background-color: #ffffff;
- border-top: 1rpx solid #e5e5e5;
- display: flex;
- flex-direction: row;
- gap: 20rpx;
- }
- .save-btn {
- flex: 1;
- height: 80rpx;
- line-height: 80rpx;
- background-color: #ffffff;
- color: #007aff;
- font-size: 28rpx;
- font-weight: 600;
- border-radius: 20rpx;
- border: 2rpx solid #007aff;
- }
- .delete-btn {
- flex: 1;
- height: 80rpx;
- line-height: 80rpx;
- background-color: #ff4d4f;
- color: #ffffff;
- font-size: 28rpx;
- font-weight: 600;
- border-radius: 20rpx;
- border: none;
- }
- .confirm-btn {
- flex: 1;
- height: 80rpx;
- line-height: 80rpx;
- background-color: #007aff;
- color: #ffffff;
- font-size: 28rpx;
- font-weight: 600;
- border-radius: 20rpx;
- border: none;
- }
- .select-product-btn {
- padding: 30rpx;
- align-items: center;
- justify-content: center;
- border: 2rpx dashed #007aff;
- border-radius: 12rpx;
- background-color: #f0f7ff;
- }
- .select-product-text {
- font-size: 28rpx;
- color: #007aff;
- font-weight: 500;
- }
- .selected-product-card {
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- padding: 20rpx;
- background-color: #ffffff;
- border-radius: 8rpx;
- border: 1rpx solid #e5e5e5;
- }
- .selected-product-info {
- flex: 1;
- flex-direction: column;
- }
- .selected-product-name {
- font-size: 28rpx;
- color: #333333;
- font-weight: bold;
- }
- .selected-product-code {
- font-size: 24rpx;
- color: #666666;
- margin-top: 6rpx;
- }
- .selected-product-spec {
- font-size: 24rpx;
- color: #999999;
- margin-top: 4rpx;
- }
- .change-product-btn {
- padding: 8rpx 20rpx;
- background-color: #007aff;
- border-radius: 8rpx;
- margin-left: 16rpx;
- }
- .change-product-text {
- color: #ffffff;
- font-size: 24rpx;
- }
- /* Product picker modal styles */
- .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-height: 80%;
- background-color: #ffffff;
- border-radius: 16rpx;
- padding: 30rpx;
- box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.15);
- display: flex;
- flex-direction: column;
- }
- .modal-header {
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 20rpx;
- 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;
- }
- .search-bar {
- padding: 10rpx 0;
- }
- .search-box {
- flex-direction: row;
- align-items: center;
- height: 72rpx;
- padding: 0 24rpx;
- background-color: #f5f5f5;
- border-radius: 16rpx;
- }
- .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;
- }
- .product-list-scroll {
- max-height: 500rpx;
- flex: 1;
- }
- .list-item {
- margin: 3rpx;
- padding: 10rpx 10rpx 0rpx 10rpx;
- border-bottom: 1px solid #f9f9f9;
- }
- .item-header {
- flex-direction: row;
- align-items: flex-start;
- margin-bottom: 10rpx;
- }
- .item-info {
- flex: 1;
- min-width: 0;
- }
- .item-name-row {
- flex-wrap: wrap;
- align-items: flex-start;
- }
- .item-name {
- font-size: 28rpx;
- color: #333333;
- font-weight: bold;
- word-break: break-all;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .item-sub-row {
- flex-direction: row;
- align-items: center;
- margin-top: 6rpx;
- }
- .item-sub-title {
- font-size: 23rpx;
- color: #797979;
- margin-right: 16rpx;
- }
- .item-code {
- font-size: 23rpx;
- color: #999999;
- }
- .add-btn {
- width: 44rpx;
- height: 44rpx;
- border-radius: 22rpx;
- background-color: #165DFF;
- color: #FFFFFF;
- align-items: center;
- justify-content: center;
- margin-left: 20rpx;
- flex-shrink: 0;
- }
- .add-icon {
- color: #ffffff;
- }
- .empty-tip {
- align-items: center;
- justify-content: center;
- padding: 40rpx;
- }
- .empty-tip-text {
- color: #999999;
- font-size: 28rpx;
- }
- .pagination {
- flex-direction: row;
- align-items: center;
- justify-content: center;
- padding: 20rpx;
- gap: 30rpx;
- }
- .page-btn {
- padding: 10rpx 20rpx;
- 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;
- }
- </style>
|