| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039 |
- <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 startStr = String(startTime).trim()
- const endStr = String(endTime).trim()
- if (startStr > endStr) {
- 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 startStr = String(startTime).trim()
- const endStr = String(endTime).trim()
- if (startStr > endStr) {
- 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>
|