create.uvue 25 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025
  1. <template>
  2. <uni-navbar-lite :showRight="showRightBtn" :title="getPageTitle()" :rightBtnText="rightBtnText" :rightBtnStyle="rightBtnStyle" @rightClick="handleDelete"></uni-navbar-lite>
  3. <view class="page-container">
  4. <scroll-view class="page-content" :scroll-y="true">
  5. <view class="section">
  6. <view class="section-header">
  7. <view class="section-indicator"></view>
  8. <text class="section-title">产品信息</text>
  9. </view>
  10. <view class="form-card">
  11. <view v-if="selectedProduct != null" class="selected-product-card" @click="openProductPicker">
  12. <view class="selected-product-info">
  13. <text class="selected-product-name">{{ selectedProduct.itemName }}</text>
  14. <text class="selected-product-code">编码: {{ selectedProduct.itemCode }}</text>
  15. <text class="selected-product-spec" v-if="selectedProduct.specification != null && selectedProduct.specification.length > 0">规格: {{ selectedProduct.specification }}</text>
  16. </view>
  17. <view class="change-product-btn" v-if="!isEdit">
  18. <text class="change-product-text">更换</text>
  19. </view>
  20. </view>
  21. <view v-else class="select-product-btn" @click="openProductPicker">
  22. <text class="select-product-text">+ 请选择产品</text>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="section">
  27. <view class="section-header">
  28. <view class="section-indicator"></view>
  29. <text class="section-title">汇报信息</text>
  30. </view>
  31. <view class="form-card">
  32. <view class="form-row">
  33. <text class="form-label">汇报数量</text>
  34. <input class="form-input" :class="{ 'disabled': formStatus !== 'PREPARE' }" type="digit" placeholder="请输入数量" v-model="formData.quantity" :disabled="formStatus !== 'PREPARE'" />
  35. </view>
  36. <view class="form-row">
  37. <text class="form-label">单位</text>
  38. <view class="form-input-static">包</view>
  39. </view>
  40. <view class="form-row">
  41. <text class="form-label">报工日期</text>
  42. <view class="form-input disabled">{{ formData.reportDate || currentDate }}</view>
  43. </view>
  44. <view class="form-row">
  45. <text class="form-label">开始时间</text>
  46. <view class="input-with-btn">
  47. <input class="form-input" :class="{ 'disabled': formStatus !== 'PREPARE' }" type="text" :value="formData.startTime" placeholder="请输入时间" :disabled="formStatus !== 'PREPARE'" />
  48. <picker v-if="formStatus === 'PREPARE'" mode="time" :value="formData.startTime" @change="onStartTimeChange">
  49. <view class="picker-btn">选择</view>
  50. </picker>
  51. </view>
  52. </view>
  53. <view class="form-row">
  54. <text class="form-label">结束时间</text>
  55. <view class="input-with-btn">
  56. <input class="form-input" :class="{ 'disabled': formStatus !== 'PREPARE' }" type="text" :value="formData.endTime" placeholder="请输入时间" :disabled="formStatus !== 'PREPARE'" />
  57. <picker v-if="formStatus === 'PREPARE'" mode="time" :value="formData.endTime" @change="onEndTimeChange">
  58. <view class="picker-btn">选择</view>
  59. </picker>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="section">
  65. <view class="section-header">
  66. <view class="section-indicator"></view>
  67. <text class="section-title">备注</text>
  68. </view>
  69. <view class="form-card">
  70. <view class="form-row">
  71. <textarea class="form-textarea" placeholder="请输入备注" v-model="formData.remark" />
  72. </view>
  73. </view>
  74. </view>
  75. </scroll-view>
  76. <view class="bottom-buttons" v-if="formStatus === 'PREPARE'">
  77. <button class="save-btn" @click="handleSave">保存</button>
  78. <button class="confirm-btn" @click="handleSaveAndConfirm">保存&确认</button>
  79. </view>
  80. <view v-if="showProductPicker" class="picker-modal">
  81. <view class="modal-mask" @click="closeProductPicker"></view>
  82. <view class="modal-content">
  83. <view class="modal-header">
  84. <text class="modal-title">选择产品</text>
  85. <text class="modal-close" @click="closeProductPicker">取消</text>
  86. </view>
  87. <view class="search-bar">
  88. <view class="search-box">
  89. <input class="search-input" type="text" placeholder="请输入关键字查询" v-model="keyword" @input="handleSearch" />
  90. <view v-if="keyword.length > 0" class="clear-btn" @tap="clearKeyword">
  91. <text class="clear-btn-text">×</text>
  92. </view>
  93. <view class="search-btn" @tap="handleSearch">
  94. <text class="search-btn-text">搜索</text>
  95. </view>
  96. </view>
  97. </view>
  98. <scroll-view class="product-list-scroll" :scroll-y="true">
  99. <view
  100. v-for="(item, index) in productList"
  101. :key="item.itemId + '_' + page"
  102. class="list-item"
  103. >
  104. <view class="item-header">
  105. <view class="item-info">
  106. <view class="item-name-row">
  107. <text class="item-name">{{ item.itemName }}</text>
  108. </view>
  109. <view class="item-sub-row">
  110. <text class="item-sub-title">{{ item.itemTypeName }}</text>
  111. <text class="item-code">{{ item.itemCode }}</text>
  112. </view>
  113. </view>
  114. <view class="add-btn" @click.stop="selectProduct(item)">
  115. <text class="add-icon">+</text>
  116. </view>
  117. </view>
  118. </view>
  119. <view v-if="productList.length === 0 && !loading" class="empty-tip">
  120. <text class="empty-tip-text">暂无产品</text>
  121. </view>
  122. </scroll-view>
  123. <view class="pagination">
  124. <view class="page-btn" :class="{disabled: page <= 1}" @click="prevPage">
  125. <text class="page-btn-text"><</text>
  126. </view>
  127. <text class="page-info">第{{ page }}页 / 共{{ totalPages }}页</text>
  128. <view class="page-btn" :class="{disabled: page >= totalPages}" @click="nextPage">
  129. <text class="page-btn-text">></text>
  130. </view>
  131. </view>
  132. </view>
  133. </view>
  134. </view>
  135. </template>
  136. <script setup lang="uts">
  137. import { ref, computed } from 'vue'
  138. import { onLoad } from '@dcloudio/uni-app';
  139. import { getProReportById, addProReport, updateProReport, confirmProReport, delProReport, getProductList } from '../../api/pro/index'
  140. import { getUserInfo } from '../../utils/storage'
  141. type ProductItem = {
  142. itemId: string
  143. itemCode: string
  144. itemName: string
  145. itemTypeName: string
  146. specification: string
  147. measureName: string
  148. unitOfMeasure: string
  149. }
  150. const getTodayStr = (): string => {
  151. const d = new Date()
  152. const y = d.getFullYear()
  153. const m = (d.getMonth() + 1).toString().padStart(2, '0')
  154. const day = d.getDate().toString().padStart(2, '0')
  155. return `${y}-${m}-${day}`
  156. }
  157. const extractTime = (datetimeStr: string): string => {
  158. if (!datetimeStr) return ''
  159. const parts = datetimeStr.split(' ')
  160. if (parts.length >= 2) {
  161. return parts[1].substring(0, 5)
  162. }
  163. return ''
  164. }
  165. const isEdit = ref<boolean>(false)
  166. const reportId = ref<string>('')
  167. const formStatus = ref<string>('')
  168. const currentDate = ref<string>(getTodayStr())
  169. let searchTimer: number | null = null
  170. const getPageTitle = (): string => {
  171. if (!isEdit.value) {
  172. return '新增生产汇报'
  173. }
  174. if (formStatus.value === 'PREPARE') {
  175. return '编辑生产汇报'
  176. }
  177. return '查看生产汇报'
  178. }
  179. const showRightBtn = computed(() => {
  180. return isEdit.value && formStatus.value === 'PREPARE'
  181. })
  182. const rightBtnText = computed(() => {
  183. return isEdit.value && formStatus.value === 'PREPARE' ? '删除' : ''
  184. })
  185. const rightBtnStyle = computed(() => {
  186. return {
  187. backgroundColor: '#ff4d4f',
  188. color: '#ffffff',
  189. fontSize: '28rpx',
  190. padding: '8rpx 20rpx',
  191. borderRadius: '8rpx'
  192. }
  193. })
  194. const formData = ref<UTSJSONObject>({
  195. productCode: '',
  196. productName: '',
  197. specification: '',
  198. quantity: '',
  199. unitOfMeasure: '',
  200. unitName: '',
  201. reportDate: '',
  202. startTime: '',
  203. endTime: '',
  204. remark: ''
  205. })
  206. const selectedProduct = ref<ProductItem | null>(null)
  207. const showProductPicker = ref<boolean>(false)
  208. const keyword = ref<string>("")
  209. const onReportDateChange = (e: any): void => {
  210. formData.value['reportDate'] = e.detail.value as string
  211. }
  212. const onStartTimeChange = (e: any): void => {
  213. formData.value['startTime'] = e.detail.value as string
  214. }
  215. const onEndTimeChange = (e: any): void => {
  216. formData.value['endTime'] = e.detail.value as string
  217. }
  218. const productList = ref<ProductItem[]>([])
  219. const page = ref<number>(1)
  220. const pageSize: number = 10
  221. const total = ref<number>(0)
  222. const loading = ref<boolean>(false)
  223. const totalPages = computed((): number => {
  224. if (total.value <= 0) return 1
  225. return Math.ceil(total.value / pageSize)
  226. })
  227. const loadProducts = (): void => {
  228. loading.value = true
  229. getProductList(page.value, pageSize, keyword.value).then((res: any) => {
  230. const data = res as UTSJSONObject
  231. const rows = data['rows']
  232. const totalNum = data['total']
  233. if (totalNum != null) {
  234. total.value = totalNum as number
  235. }
  236. if (rows != null) {
  237. const listData = rows as UTSJSONObject[]
  238. const arr: ProductItem[] = []
  239. listData.forEach((item: UTSJSONObject) => {
  240. const it: ProductItem = {
  241. itemId: item['itemId'] != null ? item['itemId'].toString() : '',
  242. itemCode: item['itemCode'] != null ? item['itemCode'].toString() : '',
  243. itemName: item['itemName'] != null ? item['itemName'].toString() : '',
  244. itemTypeName: item['itemTypeName'] != null ? item['itemTypeName'].toString() : '',
  245. specification: item['specification'] != null ? item['specification'].toString() : '',
  246. measureName: item['measureName'] != null ? item['measureName'].toString() : '',
  247. unitOfMeasure: item['unitOfMeasure'] != null ? item['unitOfMeasure'].toString() : ''
  248. }
  249. arr.push(it)
  250. })
  251. productList.value = arr
  252. } else {
  253. productList.value = []
  254. }
  255. loading.value = false
  256. }).catch(() => {
  257. productList.value = []
  258. loading.value = false
  259. })
  260. }
  261. const selectProduct = (item: ProductItem): void => {
  262. selectedProduct.value = item
  263. formData.value['productCode'] = item.itemCode
  264. formData.value['productName'] = item.itemName
  265. formData.value['specification'] = item.specification
  266. formData.value['unitOfMeasure'] = item.unitOfMeasure || ''
  267. showProductPicker.value = false
  268. }
  269. const openProductPicker = (): void => {
  270. if (isEdit.value) return
  271. showProductPicker.value = true
  272. loadProducts()
  273. }
  274. const closeProductPicker = (): void => {
  275. showProductPicker.value = false
  276. keyword.value = ''
  277. page.value = 1
  278. }
  279. const prevPage = (): void => {
  280. if (page.value > 1) {
  281. page.value--
  282. loadProducts()
  283. }
  284. }
  285. const nextPage = (): void => {
  286. if (page.value < totalPages.value) {
  287. page.value++
  288. loadProducts()
  289. }
  290. }
  291. const handleSearch = (): void => {
  292. const timer = searchTimer
  293. if (timer != null) {
  294. clearTimeout(timer)
  295. }
  296. searchTimer = setTimeout(() => {
  297. page.value = 1
  298. loadProducts()
  299. }, 300)
  300. }
  301. const clearKeyword = (): void => {
  302. keyword.value = ''
  303. page.value = 1
  304. loadProducts()
  305. }
  306. const loadDetail = (): void => {
  307. if (reportId.value.length === 0) return
  308. getProReportById(reportId.value).then((response: any) => {
  309. const res = response as UTSJSONObject
  310. const data = res["data"] as UTSJSONObject
  311. formData.value['productCode'] = data['productCode'] != null ? data['productCode'].toString() : ''
  312. formData.value['productName'] = data['productName'] != null ? data['productName'].toString() : ''
  313. formData.value['specification'] = data['specification'] != null ? data['specification'].toString() : ''
  314. formData.value['quantity'] = data['quantity'] != null ? data['quantity'].toString() : ''
  315. formData.value['unitOfMeasure'] = data['unitOfMeasure'] != null ? data['unitOfMeasure'].toString() : ''
  316. formData.value['unitName'] = data['unitName'] != null ? data['unitName'].toString() : ''
  317. formData.value['reportDate'] = data['reportDate'] != null ? data['reportDate'].toString() : ''
  318. formData.value['startTime'] = data['startTime'] != null ? extractTime(data['startTime'].toString()) : ''
  319. formData.value['endTime'] = data['endTime'] != null ? extractTime(data['endTime'].toString()) : ''
  320. formData.value['remark'] = data['remark'] != null ? data['remark'].toString() : ''
  321. formStatus.value = data['status'] != null ? data['status'].toString() : ''
  322. const pc = formData.value['productCode'] as string
  323. const pn = formData.value['productName'] as string
  324. const spec = formData.value['specification'] as string
  325. selectedProduct.value = {
  326. itemId: data['productId'] != null ? data['productId'].toString() : '',
  327. itemCode: pc,
  328. itemName: pn,
  329. itemTypeName: '',
  330. specification: spec,
  331. measureName: ''
  332. }
  333. }).catch((e) => {
  334. const error = e as UTSError
  335. const errMsg = error?.message
  336. uni.showToast({ title: errMsg.toString(), icon: 'none' })
  337. })
  338. }
  339. const buildSubmitData = (): UTSJSONObject => {
  340. const data = new UTSJSONObject()
  341. if (isEdit.value && reportId.value.length > 0) {
  342. data['reportId'] = parseInt(reportId.value)
  343. }
  344. data['productId'] = selectedProduct.value?.itemId ? parseInt(selectedProduct.value.itemId) : null
  345. data['productCode'] = formData.value['productCode']
  346. data['productName'] = formData.value['productName']
  347. data['specification'] = formData.value['specification']
  348. data['quantity'] = formData.value['quantity']
  349. data['unitName'] = '包'
  350. data['attr1'] = 'APP'
  351. const userInfo = getUserInfo()
  352. if (userInfo != null) {
  353. data['reporter'] = userInfo['nickName'] || userInfo['userName'] || userInfo['name'] || ''
  354. data['reporterId'] = userInfo['userId'] || userInfo['id'] || ''
  355. }
  356. const reportDate = formData.value['reportDate'] || currentDate.value
  357. data['reportDate'] = reportDate
  358. const startTime = formData.value['startTime']
  359. data['startTime'] = startTime ? `${reportDate} ${startTime}:00` : ''
  360. const endTime = formData.value['endTime']
  361. data['endTime'] = endTime ? `${reportDate} ${endTime}:00` : ''
  362. const remark = formData.value['remark']
  363. if (remark && remark.trim().length > 0) {
  364. data['remark'] = remark.trim()
  365. }
  366. return data
  367. }
  368. const handleSave = (): void => {
  369. if (selectedProduct.value == null) {
  370. uni.showToast({ title: '请选择产品', icon: 'none' })
  371. return
  372. }
  373. const quantity = formData.value['quantity']
  374. const quantityStr = String(quantity).trim()
  375. if (!quantityStr) {
  376. uni.showToast({ title: '请输入汇报数量', icon: 'none' })
  377. return
  378. }
  379. const num = Number(quantityStr)
  380. if (isNaN(num) || num <= 0) {
  381. uni.showToast({ title: '汇报数量必须大于0', icon: 'none' })
  382. return
  383. }
  384. const startTime = formData.value['startTime']
  385. if (!startTime || String(startTime).trim().length === 0) {
  386. uni.showToast({ title: '请选择开始时间', icon: 'none' })
  387. return
  388. }
  389. const endTime = formData.value['endTime']
  390. if (!endTime || String(endTime).trim().length === 0) {
  391. uni.showToast({ title: '请选择结束时间', icon: 'none' })
  392. return
  393. }
  394. const data = buildSubmitData()
  395. const api = isEdit.value ? updateProReport : addProReport
  396. api(data).then((res: any) => {
  397. uni.showToast({ title: '保存成功', icon: 'success' })
  398. uni.setStorageSync('needRefresh', 'true')
  399. setTimeout(() => {
  400. uni.navigateBack()
  401. }, 1500)
  402. }).catch((e) => {
  403. const error = e as UTSError
  404. const errMsg = error?.message
  405. uni.showToast({ title: errMsg.toString(), icon: 'none' })
  406. })
  407. }
  408. const handleConfirm = (): void => {
  409. uni.showModal({
  410. title: '提示',
  411. content: '确认该生产汇报?',
  412. success: (res) => {
  413. if (res.confirm) {
  414. const data = new UTSJSONObject()
  415. data['reportId'] = parseInt(reportId.value)
  416. data['status'] = 'CONFIRMED'
  417. confirmProReport(data).then((res: any) => {
  418. uni.showToast({ title: '确认成功', icon: 'success' })
  419. uni.setStorageSync('needRefresh', 'true')
  420. setTimeout(() => {
  421. uni.navigateBack()
  422. }, 1500)
  423. }).catch((e) => {
  424. const error = e as UTSError
  425. const errMsg = error?.message
  426. uni.showToast({ title: errMsg.toString(), icon: 'none' })
  427. })
  428. }
  429. }
  430. })
  431. }
  432. const handleSaveAndConfirm = (): void => {
  433. if (selectedProduct.value == null) {
  434. uni.showToast({ title: '请选择产品', icon: 'none' })
  435. return
  436. }
  437. const quantity = formData.value['quantity']
  438. const quantityStr = String(quantity).trim()
  439. if (!quantityStr) {
  440. uni.showToast({ title: '请输入汇报数量', icon: 'none' })
  441. return
  442. }
  443. const num = Number(quantityStr)
  444. if (isNaN(num) || num <= 0) {
  445. uni.showToast({ title: '汇报数量必须大于0', icon: 'none' })
  446. return
  447. }
  448. const startTime = formData.value['startTime']
  449. if (!startTime || String(startTime).trim().length === 0) {
  450. uni.showToast({ title: '请选择开始时间', icon: 'none' })
  451. return
  452. }
  453. const endTime = formData.value['endTime']
  454. if (!endTime || String(endTime).trim().length === 0) {
  455. uni.showToast({ title: '请选择结束时间', icon: 'none' })
  456. return
  457. }
  458. const data = buildSubmitData()
  459. data['status'] = 'CONFIRMED'
  460. addProReport(data).then((res: any) => {
  461. uni.showToast({ title: '保存并确认成功', icon: 'success' })
  462. uni.setStorageSync('needRefresh', 'true')
  463. setTimeout(() => {
  464. uni.navigateBack()
  465. }, 1500)
  466. }).catch((e) => {
  467. const error = e as UTSError
  468. const errMsg = error?.message
  469. uni.showToast({ title: errMsg.toString(), icon: 'none' })
  470. })
  471. }
  472. const handleDelete = (): void => {
  473. uni.showModal({
  474. title: '提示',
  475. content: '确定要删除该生产汇报吗?',
  476. success: (res) => {
  477. if (res.confirm) {
  478. delProReport(reportId.value).then((res: any) => {
  479. uni.showToast({ title: '删除成功', icon: 'success' })
  480. uni.setStorageSync('needRefresh', 'true')
  481. setTimeout(() => {
  482. uni.navigateBack()
  483. }, 1500)
  484. }).catch((e) => {
  485. const error = e as UTSError
  486. const errMsg = error?.message
  487. uni.showToast({ title: errMsg.toString(), icon: 'none' })
  488. })
  489. }
  490. }
  491. })
  492. }
  493. onLoad((options: any) => {
  494. const params = options as UTSJSONObject
  495. if (params != null && params['id'] != null) {
  496. isEdit.value = true
  497. reportId.value = params['id'].toString()
  498. loadDetail()
  499. } else {
  500. formData.value['reportDate'] = getTodayStr()
  501. formStatus.value = 'PREPARE'
  502. }
  503. })
  504. </script>
  505. <style lang="scss">
  506. .page-container {
  507. flex: 1;
  508. background-color: #e8f0f9;
  509. }
  510. .page-content {
  511. flex: 1;
  512. padding: 20rpx;
  513. padding-bottom: 130rpx;
  514. }
  515. .section {
  516. margin-bottom: 20rpx;
  517. background: #ffffff;
  518. border-radius: 16rpx;
  519. padding: 20rpx;
  520. }
  521. .section-header {
  522. flex-direction: row;
  523. align-items: center;
  524. margin-bottom: 20rpx;
  525. }
  526. .section-indicator {
  527. width: 6rpx;
  528. height: 32rpx;
  529. background-color: #007aff;
  530. border-radius: 3rpx;
  531. margin-right: 12rpx;
  532. }
  533. .section-title {
  534. font-size: 32rpx;
  535. color: #333333;
  536. font-weight: bold;
  537. }
  538. .form-card {
  539. background-color: #f8f9fa;
  540. border-radius: 8rpx;
  541. padding: 20rpx;
  542. }
  543. .form-row {
  544. flex-direction: row;
  545. align-items: center;
  546. margin-bottom: 20rpx;
  547. &:last-child {
  548. margin-bottom: 0;
  549. }
  550. }
  551. .form-label {
  552. width: 140rpx;
  553. font-size: 28rpx;
  554. color: #666666;
  555. white-space: nowrap;
  556. }
  557. .form-input {
  558. flex: 1;
  559. height: 60rpx;
  560. padding: 0 16rpx;
  561. background-color: #ffffff;
  562. border-radius: 8rpx;
  563. font-size: 28rpx;
  564. color: #333333;
  565. border: 1rpx solid #e5e5e5;
  566. }
  567. .form-input-static {
  568. flex: 1;
  569. height: 60rpx;
  570. padding: 0 16rpx;
  571. background-color: #f0f0f0;
  572. border-radius: 8rpx;
  573. font-size: 28rpx;
  574. color: #666666;
  575. line-height: 60rpx;
  576. border: 1rpx solid #e5e5e5;
  577. }
  578. .form-input.disabled {
  579. background-color: #f0f0f0;
  580. color: #666666;
  581. line-height: 60rpx;
  582. }
  583. .input-with-btn {
  584. flex: 1;
  585. display: flex;
  586. flex-direction: row;
  587. align-items: center;
  588. }
  589. .input-with-btn .form-input {
  590. flex: 1;
  591. height: 60rpx;
  592. border-radius: 8rpx 0 0 8rpx;
  593. border-right: none;
  594. }
  595. .picker-btn {
  596. width: 100rpx;
  597. height: 60rpx;
  598. line-height: 60rpx;
  599. text-align: center;
  600. background-color: #409eff;
  601. color: #ffffff;
  602. font-size: 26rpx;
  603. border-radius: 0 8rpx 8rpx 0;
  604. }
  605. .datetime-pickers {
  606. flex: 1;
  607. flex-direction: row;
  608. gap: 12rpx;
  609. }
  610. .picker-input {
  611. line-height: 60rpx;
  612. }
  613. .date-part {
  614. flex: 2;
  615. }
  616. .time-part {
  617. flex: 1;
  618. }
  619. .form-textarea {
  620. flex: 1;
  621. min-height: 120rpx;
  622. padding: 16rpx;
  623. background-color: #ffffff;
  624. border-radius: 8rpx;
  625. font-size: 28rpx;
  626. color: #333333;
  627. border: 1rpx solid #e5e5e5;
  628. }
  629. .bottom-buttons {
  630. position: fixed;
  631. bottom: 0;
  632. left: 0;
  633. right: 0;
  634. padding: 20rpx 30rpx;
  635. background-color: #ffffff;
  636. border-top: 1rpx solid #e5e5e5;
  637. display: flex;
  638. flex-direction: row;
  639. gap: 20rpx;
  640. }
  641. .save-btn {
  642. flex: 1;
  643. height: 80rpx;
  644. line-height: 80rpx;
  645. background-color: #ffffff;
  646. color: #007aff;
  647. font-size: 28rpx;
  648. font-weight: 600;
  649. border-radius: 20rpx;
  650. border: 2rpx solid #007aff;
  651. }
  652. .delete-btn {
  653. flex: 1;
  654. height: 80rpx;
  655. line-height: 80rpx;
  656. background-color: #ff4d4f;
  657. color: #ffffff;
  658. font-size: 28rpx;
  659. font-weight: 600;
  660. border-radius: 20rpx;
  661. border: none;
  662. }
  663. .confirm-btn {
  664. flex: 1;
  665. height: 80rpx;
  666. line-height: 80rpx;
  667. background-color: #007aff;
  668. color: #ffffff;
  669. font-size: 28rpx;
  670. font-weight: 600;
  671. border-radius: 20rpx;
  672. border: none;
  673. }
  674. .select-product-btn {
  675. padding: 30rpx;
  676. align-items: center;
  677. justify-content: center;
  678. border: 2rpx dashed #007aff;
  679. border-radius: 12rpx;
  680. background-color: #f0f7ff;
  681. }
  682. .select-product-text {
  683. font-size: 28rpx;
  684. color: #007aff;
  685. font-weight: 500;
  686. }
  687. .selected-product-card {
  688. flex-direction: row;
  689. align-items: center;
  690. justify-content: space-between;
  691. padding: 20rpx;
  692. background-color: #ffffff;
  693. border-radius: 8rpx;
  694. border: 1rpx solid #e5e5e5;
  695. }
  696. .selected-product-info {
  697. flex: 1;
  698. flex-direction: column;
  699. }
  700. .selected-product-name {
  701. font-size: 28rpx;
  702. color: #333333;
  703. font-weight: bold;
  704. }
  705. .selected-product-code {
  706. font-size: 24rpx;
  707. color: #666666;
  708. margin-top: 6rpx;
  709. }
  710. .selected-product-spec {
  711. font-size: 24rpx;
  712. color: #999999;
  713. margin-top: 4rpx;
  714. }
  715. .change-product-btn {
  716. padding: 8rpx 20rpx;
  717. background-color: #007aff;
  718. border-radius: 8rpx;
  719. margin-left: 16rpx;
  720. }
  721. .change-product-text {
  722. color: #ffffff;
  723. font-size: 24rpx;
  724. }
  725. /* Product picker modal styles */
  726. .picker-modal {
  727. position: fixed;
  728. top: 0;
  729. left: 0;
  730. right: 0;
  731. bottom: 0;
  732. z-index: 1000;
  733. display: flex;
  734. align-items: center;
  735. justify-content: center;
  736. }
  737. .modal-mask {
  738. position: absolute;
  739. top: 0;
  740. left: 0;
  741. right: 0;
  742. bottom: 0;
  743. background-color: rgba(0, 0, 0, 0.5);
  744. }
  745. .modal-content {
  746. position: relative;
  747. width: 90%;
  748. max-height: 80%;
  749. background-color: #ffffff;
  750. border-radius: 16rpx;
  751. padding: 30rpx;
  752. box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.15);
  753. display: flex;
  754. flex-direction: column;
  755. }
  756. .modal-header {
  757. flex-direction: row;
  758. justify-content: space-between;
  759. align-items: center;
  760. margin-bottom: 20rpx;
  761. padding-bottom: 20rpx;
  762. border-bottom: 1rpx solid #e5e5e5;
  763. }
  764. .modal-title {
  765. font-size: 32rpx;
  766. font-weight: bold;
  767. color: #333333;
  768. }
  769. .modal-close {
  770. font-size: 28rpx;
  771. color: #999999;
  772. padding: 8rpx 16rpx;
  773. border-radius: 8rpx;
  774. background-color: #f5f5f5;
  775. }
  776. .search-bar {
  777. padding: 10rpx 0;
  778. }
  779. .search-box {
  780. flex-direction: row;
  781. align-items: center;
  782. height: 72rpx;
  783. padding: 0 24rpx;
  784. background-color: #f5f5f5;
  785. border-radius: 16rpx;
  786. }
  787. .search-input {
  788. flex: 1;
  789. font-size: 28rpx;
  790. color: #333333;
  791. }
  792. .search-btn {
  793. padding: 10rpx 20rpx;
  794. background-color: #007aff;
  795. border-radius: 8rpx;
  796. margin-left: 10rpx;
  797. }
  798. .search-btn-text {
  799. color: #ffffff;
  800. font-size: 24rpx;
  801. }
  802. .clear-btn {
  803. width: 36rpx;
  804. height: 36rpx;
  805. border-radius: 18rpx;
  806. background-color: #cccccc;
  807. align-items: center;
  808. justify-content: center;
  809. margin-left: 10rpx;
  810. }
  811. .clear-btn-text {
  812. color: #ffffff;
  813. font-size: 24rpx;
  814. font-weight: bold;
  815. }
  816. .product-list-scroll {
  817. max-height: 500rpx;
  818. flex: 1;
  819. }
  820. .list-item {
  821. margin: 3rpx;
  822. padding: 10rpx 10rpx 0rpx 10rpx;
  823. border-bottom: 1px solid #f9f9f9;
  824. }
  825. .item-header {
  826. flex-direction: row;
  827. align-items: flex-start;
  828. margin-bottom: 10rpx;
  829. }
  830. .item-info {
  831. flex: 1;
  832. min-width: 0;
  833. }
  834. .item-name-row {
  835. flex-wrap: wrap;
  836. align-items: flex-start;
  837. }
  838. .item-name {
  839. font-size: 28rpx;
  840. color: #333333;
  841. font-weight: bold;
  842. word-break: break-all;
  843. overflow: hidden;
  844. text-overflow: ellipsis;
  845. display: -webkit-box;
  846. -webkit-line-clamp: 2;
  847. -webkit-box-orient: vertical;
  848. }
  849. .item-sub-row {
  850. flex-direction: row;
  851. align-items: center;
  852. margin-top: 6rpx;
  853. }
  854. .item-sub-title {
  855. font-size: 23rpx;
  856. color: #797979;
  857. margin-right: 16rpx;
  858. }
  859. .item-code {
  860. font-size: 23rpx;
  861. color: #999999;
  862. }
  863. .add-btn {
  864. width: 44rpx;
  865. height: 44rpx;
  866. border-radius: 22rpx;
  867. background-color: #165DFF;
  868. color: #FFFFFF;
  869. align-items: center;
  870. justify-content: center;
  871. margin-left: 20rpx;
  872. flex-shrink: 0;
  873. }
  874. .add-icon {
  875. color: #ffffff;
  876. }
  877. .empty-tip {
  878. align-items: center;
  879. justify-content: center;
  880. padding: 40rpx;
  881. }
  882. .empty-tip-text {
  883. color: #999999;
  884. font-size: 28rpx;
  885. }
  886. .pagination {
  887. flex-direction: row;
  888. align-items: center;
  889. justify-content: center;
  890. padding: 20rpx;
  891. gap: 30rpx;
  892. }
  893. .page-btn {
  894. padding: 10rpx 20rpx;
  895. background-color: #165DFF;
  896. border-radius: 8rpx;
  897. }
  898. .page-btn.disabled {
  899. background-color: #cccccc;
  900. }
  901. .page-btn-text {
  902. color: #FFFFFF;
  903. font-size: 26rpx;
  904. }
  905. .page-info {
  906. font-size: 26rpx;
  907. color: #666666;
  908. }
  909. </style>