addStock.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="新增出库单" @clickLeft="back">
  4. <!-- @clickRight="handleScan"
  5. right-icon="scan"
  6. > -->
  7. <!--右菜单-->
  8. <template slot="float">
  9. <!-- <view class="nav-icon-caozuo rightNav" @click="getsure">
  10. <u-button type="success" size="small" class="u-reset-button" text="确定"></u-button>
  11. </view> -->
  12. </template>
  13. </uni-nav-bar>
  14. <u-form labelPosition="left" :model="formData" :rules="rules" ref="formRef" labelWidth="260" labelAlign="right" class="baseForm">
  15. <u-form-item label="物品类型" class="required-form" borderBottom prop="assetType">
  16. <view class="assetType_box" @click="openPicker">{{ assetTypeName ? assetTypeName : '请选择产品类型' }}</view>
  17. </u-form-item>
  18. <u-form-item label="出库场景" class="required-form" prop="bizType" borderBottom>
  19. <picker :disabled="!!(productList && productList.length)" @change="e => handlePicker(e, outputSceneState, 'bizType')" :value="pickerIndex" :range="outputSceneState" range-key="text">
  20. <u-input :value="sceneStateFilter(formData.bizType)" :disableColor="!!(productList && productList.length) ? '#F5F7FA' : '#fff'" placeholder="请选择" disabled type="select" />
  21. </picker>
  22. <u-icon slot="right" name="arrow-right"></u-icon>
  23. </u-form-item>
  24. <u-form-item label="来源单据" prop="documentSource" borderBottom>
  25. <u-input type="text" placeholder="请输入" v-model="formData.sourceBizNo" @click.native="goToRequisition" />
  26. </u-form-item>
  27. <u-form-item label="出库登记人" prop="createUserName" borderBottom>
  28. <u-input disableColor="#ffffff" :value="formData.createUserName" placeholder="请选择" disabled type="text" />
  29. </u-form-item>
  30. <u-form-item class="required-form" label="领料部门" prop="deliveryName" borderBottom>
  31. <view class="assetType_box" @click="openDepartmentPicker">{{ formData.extInfo.verifyDeptName ? formData.extInfo.verifyDeptName : '请选择领料部门' }}</view>
  32. </u-form-item>
  33. <u-form-item class="required-form" label="领料人" prop="deliveryPhone" borderBottom>
  34. <view class="assetType_box" @click="openUserPicker">{{ formData.fromUser ? formData.fromUser : '请选择领料人' }}</view>
  35. </u-form-item>
  36. <u-form-item label="备注" prop="remark" borderBottom>
  37. <u-input disableColor="#ffffff" :value="formData.remark" placeholder="请输入内容" type="text" />
  38. </u-form-item>
  39. </u-form>
  40. <uni-collapse ref="collapse" v-model="collapseOpen">
  41. <uni-collapse-item :typeOpen="1" title="" name="collapse1" :open="true" :key="detailOpen" :show-animation="true">
  42. <template v-slot:title>
  43. <view class="detail-box">
  44. <view data-v-41027c34="" class="uni-collapse-item__title-wrap">
  45. <view data-v-41027c34="" class="uni-collapse-item__title-box uni-collapse-item__title-box-base">
  46. <text data-v-41027c34="" class="tag tag-base"><text></text></text>
  47. <text data-v-41027c34="" class="uni-collapse-item__title-text"><text>出库明细</text></text>
  48. </view>
  49. </view>
  50. <!-- <u-button type="primary" size="small" text="扫码添加" @click.native.stop="selectType"></u-button> -->
  51. <u-button type="success" size="small" class="selectEnterType" text="手动添加" @click.native.stop="selectType"></u-button>
  52. </view>
  53. </template>
  54. <u-form
  55. labelPosition="left"
  56. :model="{ productList: productList }"
  57. ref="lisrFormRef"
  58. labelWidth="150"
  59. :rules="listRules"
  60. errorType="none"
  61. labelAlign="right"
  62. :labelStyle="{
  63. fontSize: '28rpx'
  64. }">
  65. <view class="listContent">
  66. <view class="listBox" v-for="(item, index) in productList" :key="index">
  67. <view class="listTit">
  68. <view class="name">{{ item.categoryCode }}</view>
  69. </view>
  70. <view class="listCont" :class="{ save: item.isSave }">
  71. <view class="item w100">
  72. <u-form-item :label="`物品名称`">
  73. {{ item.categoryName }}
  74. </u-form-item>
  75. </view>
  76. <view class="item w100">
  77. <u-form-item label="包装规格" prop="packingSpecificationLabel">
  78. <u-tag style="margin-right: 5rpx" v-for="ite in item.packingSpecificationLabel" :text="ite"></u-tag>
  79. </u-form-item>
  80. </view>
  81. <view class="item">
  82. <u-form-item label="批次号" :prop="`productList.${index}.batchNo`">
  83. {{ item.batchNo }}
  84. </u-form-item>
  85. </view>
  86. <view class="item">
  87. <u-form-item label="是否拆包" prop="isUnpack">{{ item.isUnpack ? '是' : '否' }}</u-form-item>
  88. </view>
  89. <view class="item">
  90. <u-form-item label="数量" :prop="`productList.${index}.packingQuantity`">
  91. {{ item.packingQuantity }}
  92. </u-form-item>
  93. </view>
  94. <view class="item">
  95. <u-form-item label="包装单位" :prop="`productList.${index}.packingUnit`">
  96. {{ item.packingUnit }}
  97. </u-form-item>
  98. </view>
  99. <view class="item w100">
  100. <u-form-item label="供应商" :prop="`productList.${index}.supplierName`">
  101. {{ item.supplierName }}
  102. </u-form-item>
  103. </view>
  104. <view class="item">
  105. <u-form-item label="计量数量" prop="measureQuantity">{{ item.measureQuantity }}</u-form-item>
  106. </view>
  107. <view class="item">
  108. <u-form-item label="计量单位" prop="measureUnit">{{ item.measureUnit }}</u-form-item>
  109. </view>
  110. <view class="item">
  111. <u-form-item label="重量" prop="weight">{{ item.weight }}</u-form-item>
  112. </view>
  113. <view class="item">
  114. <u-form-item label="重量单位" prop="weightUnit">{{ item.weightUnit }}</u-form-item>
  115. </view>
  116. <view class="item w100">
  117. <u-form-item label="仓库" :prop="`productList.${index}.warehouseId`">
  118. {{ item.warehouseName }}
  119. </u-form-item>
  120. </view>
  121. </view>
  122. <u-list @scrolltolower="scrolltolower" class="z_list" style="height: 100% !important">
  123. <view class="material rx-ss" v-for="(ite, idx) in item.outInDetailRecordRequestList" :key="idx">
  124. <view class="content_table">
  125. <view class="item">
  126. <view class="lable rx-cc">序号</view>
  127. <view class="content">{{ idx + 1 }}</view>
  128. </view>
  129. <view class="item">
  130. <view class="lable rx-cc">包装编码</view>
  131. <view class="content">{{ ite.packageNo }}</view>
  132. </view>
  133. <view class="item">
  134. <view class="lable rx-cc">包装数量({{ ite.packingUnit }})</view>
  135. <view class="content">{{ ite.packingQuantity }}</view>
  136. </view>
  137. <view class="item">
  138. <view class="lable rx-cc">计量数量({{ ite.measureUnit }})</view>
  139. <view class="content">{{ ite.measureQuantity }}</view>
  140. </view>
  141. <view class="item">
  142. <view class="lable rx-cc">物料代号</view>
  143. <view class="content">{{ ite.materielDesignation }}</view>
  144. </view>
  145. <view class="item">
  146. <view class="lable rx-cc">客户代号</view>
  147. <view class="content">{{ ite.clientCode }}</view>
  148. </view>
  149. <view class="item">
  150. <view class="lable rx-cc">刻码</view>
  151. <view class="content">{{ ite.engrave }}</view>
  152. </view>
  153. <view class="item">
  154. <view class="lable rx-cc">重量({{ ite.weightUnit }})</view>
  155. <view class="content">
  156. {{ ite.weight }}
  157. </view>
  158. </view>
  159. <view class="item">
  160. <view class="lable rx-cc">质检状态</view>
  161. <view class="content">
  162. {{ qualityResults[ite.status] }}
  163. </view>
  164. </view>
  165. <view class="item">
  166. <view class="lable rx-cc">采购日期</view>
  167. <view class="content">
  168. {{ ite.purchaseDate }}
  169. </view>
  170. </view>
  171. <view class="item">
  172. <view class="lable rx-cc">生产日期</view>
  173. <view class="content">
  174. {{ ite.productionDate }}
  175. </view>
  176. </view>
  177. </view>
  178. </view>
  179. </u-list>
  180. </view>
  181. </view>
  182. </u-form>
  183. </uni-collapse-item>
  184. </uni-collapse>
  185. <view class="footBox">
  186. <view class="reg" @click="submit">
  187. <uni-icons custom-prefix="iconfont" size="20" color="#fff"></uni-icons>
  188. 提交
  189. </view>
  190. </view>
  191. <!-- 选择物品类型 -->
  192. <ba-tree-picker ref="treePicker" :multiple="true" @select-change="confirm" title="选择物品类型" :localdata="goodsLists" valueKey="id" textKey="name" childrenKey="child" />
  193. <!-- 选择领料部门 -->
  194. <ba-tree-picker
  195. ref="departmentPicker"
  196. :multiple="false"
  197. @select-change="departmentConfirm"
  198. title="选择领料部门"
  199. :localdata="departmentOption"
  200. valueKey="id"
  201. textKey="name"
  202. childrenKey="children" />
  203. <!-- 选择领料人 -->
  204. <ba-tree-picker ref="userPicker" :multiple="false" @select-change="userConfirm" title="选择领料人" :localdata="userOption" valueKey="id" textKey="name" childrenKey="children" />
  205. </view>
  206. </template>
  207. <script>
  208. // import ScanCode from '@/components/ScanCode.vue'
  209. import { toTreeData } from '@/utils/utils.js'
  210. import { getTreeByGroup, submitInsideTwo, outStorage } from '@/api/warehouseManagement'
  211. import { listOrganizations, getUserPage } from '@/api/common'
  212. import { getByCode } from '@/api/pda/common'
  213. import dayjs from 'dayjs'
  214. import { outputSceneState } from '../common'
  215. import { post, postJ, get, getJ } from '@/utils/api.js'
  216. import WarehouseChoose from '@/components/WarehouseChoose'
  217. import { warehousingType, inputStatus, emergencyState, warehousingMaterialListTable, getDictName, materialType } from '../enum.js'
  218. import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
  219. // import addDetails from '@/components/addDetails'
  220. import UploadFileNew from '@/components/UploadFileNew'
  221. // import dictMixins from '@/mixins/dictMixins.js'
  222. export default {
  223. components: {
  224. WarehouseChoose,
  225. baTreePicker,
  226. UploadFileNew
  227. },
  228. data() {
  229. return {
  230. userOption: [], // 用户列表
  231. departmentOption: [], // 部门列表
  232. goodsLists: [], // 物品类型
  233. assetTypeName: '', // 物品类型名称
  234. timeShow: false,
  235. packingSpecificationOption: [], // 包装规格
  236. currentPackingSpecificationOption: [], // 当前包装规格
  237. currentSupplierListOption: [], // 当前供货商
  238. warehouseListOption: [], // 仓库列表
  239. currentTypeTime: Number(new Date()), // 当前时间类型的时间
  240. storageTime: '', // 入库时间
  241. currentProductIndex: null, // 当前产品索引
  242. currentPackingIndex: null, // 当前包装索引
  243. packingUnitsShow: false,
  244. typeTimeShow: false,
  245. suppliersShow: false,
  246. warehouseShow: false,
  247. timeTypeShow: false,
  248. statusShow: false,
  249. dictCodeList: [], // 字典列表
  250. curDateType: 'purchaseDate',
  251. qualityResultsOption: [
  252. [
  253. {
  254. label: '合格',
  255. value: 1
  256. },
  257. {
  258. label: '不合格',
  259. value: 2
  260. }
  261. ]
  262. ], // 质检状态 0未检 1已检
  263. qualityResults: {
  264. 1: '合格',
  265. 2: '不合格'
  266. }, // 质检结果 1合格 2不合格
  267. curDateTypeLabel: {
  268. purchaseDate: '采购日期',
  269. productionDate: '生产日期'
  270. },
  271. timeTypeOption: [
  272. [
  273. {
  274. name: '采购日期',
  275. prop: 'purchaseDate'
  276. },
  277. {
  278. name: '生产日期',
  279. prop: 'productionDate'
  280. }
  281. ]
  282. ], // 时间类型
  283. collapseOpen: 'collapse1',
  284. emergencyState,
  285. warehousingType,
  286. materialType,
  287. outputSceneState,
  288. inputStatus,
  289. getDictName,
  290. detailOpen: false,
  291. codeOpen: false,
  292. deptList: [], //部门
  293. supplierList: [], //供应商
  294. formData: {
  295. type: 1, // 入库
  296. bizType: '1', // 入库场景
  297. storageTime: '', // 入库时间
  298. extInfo: {}, // 扩展信息
  299. sourceBizNo: '', // 来源单据编号
  300. fromUser: '', // 送货人
  301. remark: '' // 备注
  302. },
  303. statusList: [
  304. {
  305. id: 1,
  306. name: '紧急'
  307. },
  308. {
  309. id: 2,
  310. name: '中等'
  311. },
  312. {
  313. id: 1,
  314. name: '普通'
  315. }
  316. ], //紧急状态
  317. pickerIndex: 0,
  318. productList: [],
  319. userList: [],
  320. rules: {
  321. assetType: {
  322. type: 'number',
  323. required: true,
  324. message: '请选择入库产品类型',
  325. trigger: ['blur', 'change']
  326. },
  327. bizType: {
  328. type: 'number',
  329. required: true,
  330. message: '请选择入库场景',
  331. trigger: ['blur', 'change']
  332. }
  333. // contentImage: {
  334. // type: 'array',
  335. // required: true,
  336. // message: '请上传附件',
  337. // trigger: ['blur', 'change']
  338. // }
  339. },
  340. settingIndex: 0
  341. }
  342. },
  343. onShow() {
  344. this.collapseOpen = 'collapse1'
  345. },
  346. beforeDestroy() {
  347. uni.$off('setSelectList')
  348. uni.$off('requisitionSelect')
  349. },
  350. onLoad() {
  351. this.getListItems() // 物品类型
  352. this.initDeptData() // 部门列表
  353. const userInfo = uni.getStorageSync('userInfo')
  354. this.formData.createUserName = userInfo.name
  355. uni.$on('setSelectList', async data => {
  356. if (data?.length) {
  357. console.log('data------------', data)
  358. this.formData.sourceBizNo = ''
  359. this.productList = data.map(item => {
  360. return {
  361. ...item,
  362. packingSpecificationLabel: item.extField.packingSpecification ? item.extField.packingSpecification.split(',') : []
  363. }
  364. })
  365. this.formData.outInDetailList = data
  366. setTimeout(() => {
  367. this.detailOpen = !this.detailOpen
  368. this.$refs.collapse && this.$refs.collapse.resize()
  369. }, 0)
  370. }
  371. })
  372. uni.$on('requisitionSelect', async (data, query) => {
  373. this.formData.sourceBizNo = query.sourceBizNo
  374. this.formData.bizType = query.bizType
  375. this.formData.extInfo.assetType = query.assetType.split(',')
  376. let filterArray = this.formData.extInfo.assetType.map(item => {
  377. return this.goodsLists.find(ite => ite.id == item).name
  378. })
  379. this.assetTypeName = Array.from(new Set(filterArray)).join('/')
  380. this.formData.outInDetailList = data
  381. this.productList = data.map(productItem => {
  382. return {
  383. ...productItem,
  384. packingSpecificationLabel: productItem.extField.packingSpecification.split(','),
  385. outInDetailRecordRequestList: productItem.outInDetailRecordRequestList.map(packingItem => {
  386. return {
  387. ...packingItem,
  388. categoryName: productItem.categoryName,
  389. categoryCode: productItem.categoryCode,
  390. materialDetailList: packingItem.materialDetailList.map(materialItem => {
  391. return {
  392. ...materialItem,
  393. categoryName: productItem.categoryName,
  394. categoryCode: productItem.categoryCode
  395. }
  396. })
  397. }
  398. })
  399. }
  400. })
  401. setTimeout(() => {
  402. this.detailOpen = !this.detailOpen
  403. this.$refs.collapse && this.$refs.collapse.resize()
  404. }, 0)
  405. })
  406. // 明细信息填写
  407. uni.$on('batchNumBack', productList => {
  408. if (productList?.length) {
  409. this.productList = productList
  410. }
  411. })
  412. },
  413. mounted() {
  414. // this.getAddDetails();
  415. },
  416. computed: {
  417. listRules() {
  418. return this.productList.reduce((cur, pre, index) => {
  419. return {
  420. ...cur,
  421. [`productList.${index}.batchNo`]: {
  422. type: 'string',
  423. required: true,
  424. trigger: ['blur', 'change']
  425. },
  426. [`productList.${index}.packingQuantity`]: {
  427. type: 'number',
  428. required: true,
  429. trigger: ['blur', 'change']
  430. },
  431. [`productList.${index}.packingUnit`]: {
  432. type: 'string',
  433. required: true,
  434. trigger: ['blur', 'change']
  435. },
  436. [`productList.${index}.warehouseId`]: {
  437. type: 'string',
  438. required: true,
  439. trigger: ['blur', 'change']
  440. }
  441. }
  442. }, {})
  443. }
  444. },
  445. methods: {
  446. goToRequisition() {
  447. uni.navigateTo({
  448. url: '/pages/warehouse/components/requisitionList?type=' + 2
  449. })
  450. },
  451. scrolltolower() {
  452. console.log('滑动了~~~')
  453. },
  454. async submit() {
  455. if (this.productList.length <= 0) {
  456. uni.showToast({
  457. title: '请添加出库明细',
  458. icon: 'none'
  459. })
  460. return
  461. }
  462. if (!this.formData.extInfo.verifyDeptName) {
  463. uni.showToast({
  464. title: '请选择领料部门',
  465. icon: 'none'
  466. })
  467. return
  468. }
  469. if (!this.formData.fromUser) {
  470. uni.showToast({
  471. title: '请选择领料人',
  472. icon: 'none'
  473. })
  474. return
  475. }
  476. console.log(this.formData)
  477. let obj = uni.$u.deepClone({ ...this.formData, type: 2 })
  478. obj.extInfo.sourceBizNo = obj.sourceBizNo
  479. obj.fromType = obj.type
  480. this.saveLoading = true
  481. // 处理物品类型assetType
  482. obj.extInfo.assetType = obj.extInfo.assetType.join(',')
  483. // 处理仓库id
  484. let warehouseId = []
  485. let warehouseName = []
  486. let warehouseIds = this.productList.map(item => item.warehouseId).flat()
  487. let warehouseNames = this.productList.map(item => item.warehouseName).flat()
  488. warehouseIds.forEach((item, index) => {
  489. if (!warehouseId.includes(item)) {
  490. warehouseId.push(item)
  491. warehouseName.push(warehouseNames[index])
  492. }
  493. })
  494. obj.warehouseIds = warehouseId
  495. obj.warehouseNames = warehouseName
  496. console.log('2222', obj)
  497. uni.showLoading({
  498. title: '保存中...'
  499. })
  500. try {
  501. const res = await outStorage(obj)
  502. if (res.code == 0) {
  503. await submitInsideTwo({ outInIds: res.data })
  504. uni.hideLoading()
  505. uni.showToast({
  506. icon: 'none',
  507. title: '出库成功',
  508. duration: 1500
  509. })
  510. setTimeout(() => {
  511. uni.navigateBack({
  512. delta: 1
  513. })
  514. }, 1500)
  515. }
  516. } catch (error) {
  517. console.log('出库失败', err)
  518. uni.hideLoading()
  519. uni.showToast({
  520. icon: 'none',
  521. title: '出库失败',
  522. duration: 2000
  523. })
  524. }
  525. },
  526. // 部门列表
  527. async initDeptData() {
  528. let deptTreeList = await listOrganizations()
  529. this.departmentOption = toTreeData({
  530. data: deptTreeList,
  531. idField: 'id',
  532. parentIdField: 'parentId'
  533. })
  534. },
  535. async getStaffList(id) {
  536. uni.showLoading({
  537. title: '加载中',
  538. mask: true
  539. })
  540. let res = await getUserPage({
  541. groupId: id,
  542. size: 9999,
  543. page: 1
  544. })
  545. uni.hideLoading()
  546. this.userOption = res.list
  547. },
  548. // 打开领料部门选择器
  549. openDepartmentPicker() {
  550. this.$refs.departmentPicker._show()
  551. },
  552. // 打开领料人选择器
  553. openUserPicker() {
  554. this.$refs.userPicker._show()
  555. },
  556. sceneStateFilter(bizType) {
  557. if (bizType) {
  558. return this.outputSceneState.filter(item => item.value == bizType)[0].text
  559. }
  560. },
  561. formatter(dataTime) {
  562. return dayjs(dataTime).format('YYYY-MM-DD HH:mm:ss')
  563. },
  564. openPicker() {
  565. this.$refs.treePicker._show()
  566. },
  567. // 获取物品列表
  568. getListItems() {
  569. getTreeByGroup({ type: 2 }).then(res => {
  570. this.goodsLists = res
  571. })
  572. },
  573. selectType() {
  574. if (!this.formData.extInfo.assetType) {
  575. uni.showToast({
  576. title: '请选择出库类型',
  577. icon: 'none'
  578. })
  579. return
  580. }
  581. if (!this.formData.bizType) {
  582. uni.showToast({
  583. title: '请选择出库场景',
  584. icon: 'none'
  585. })
  586. return
  587. }
  588. // const storageKey = Date.now() + ''
  589. // uni.setStorageSync(storageKey, this.warehousingMaterialList)
  590. uni.navigateTo({
  591. url: '/pages/warehouse/outHouse/selectOutType?assetType=' + this.formData.extInfo.assetType
  592. })
  593. },
  594. userConfirm(data, name) {
  595. this.formData.fromId = data[0]
  596. this.formData.fromUser = name
  597. },
  598. departmentConfirm(data, name, allList) {
  599. this.formData.extInfo.verifyDeptCode = data[0]
  600. this.formData.extInfo.verifyDeptName = name
  601. this.formData.fromId = ''
  602. this.formData.fromUser = ''
  603. this.getStaffList(data[0])
  604. },
  605. confirm(data, name, allList) {
  606. this.assetTypeName = name
  607. this.formData.extInfo.assetType = allList.map(item => item.id)
  608. },
  609. // 抬头下拉信息保存
  610. handlePicker(e, list, idKey, nameKey) {
  611. if (idKey) {
  612. this.formData[idKey] = list[e?.detail.value]?.value
  613. }
  614. if (nameKey) {
  615. this.formData[nameKey] = list[e?.detail.value]?.text
  616. }
  617. this.$nextTick(() => {
  618. if (idKey === 'assetType' || idKey === 'bizType') {
  619. this.$refs.formRef.validateField(idKey)
  620. }
  621. })
  622. },
  623. // 部门确认
  624. deptConfirm(data, name) {
  625. this.formData.deptName = name
  626. this.formData.deptCode = data[0]
  627. },
  628. // 部门确认
  629. verifyDeptConfirm(data, name) {
  630. this.formData.verifyDeptCode = data[0]
  631. this.formData.verifyDeptName = name
  632. this.formData.verifyId = ''
  633. this.formData.verifyName = ''
  634. this.getUser(data[0])
  635. }
  636. }
  637. }
  638. </script>
  639. <style lang="scss" scoped>
  640. .mainBox {
  641. padding-bottom: 120rpx;
  642. /deep/.required-form .u-form-item__body__left__content__label::before {
  643. content: '*';
  644. color: red;
  645. }
  646. }
  647. .required-form-text {
  648. /deep/ .u-form-item__body__right {
  649. overflow: hidden;
  650. .u-form-item__body__right__content {
  651. width: 100%;
  652. display: inline-block !important;
  653. width: 100%;
  654. }
  655. }
  656. }
  657. .picList {
  658. display: flex;
  659. align-items: center;
  660. justify-items: flex-start;
  661. flex-wrap: wrap;
  662. }
  663. /deep/.baseForm {
  664. .u-form-item__body {
  665. padding: 0px !important;
  666. }
  667. .assetType_box {
  668. padding: 12rpx 18rpx;
  669. width: 100%;
  670. overflow: hidden;
  671. white-space: nowrap;
  672. text-overflow: ellipsis;
  673. }
  674. }
  675. /deep/.picList .u-image {
  676. margin-right: 10rpx;
  677. margin-bottom: 10rpx;
  678. }
  679. /deep/.cLine .u-line:nth-child(1) {
  680. border-bottom: none !important;
  681. }
  682. .detail-box {
  683. position: relative;
  684. display: flex;
  685. justify-content: space-between;
  686. align-items: center;
  687. /deep/uni-button {
  688. margin: 0 !important;
  689. width: 180rpx;
  690. }
  691. .selectEnterType {
  692. margin-left: 10rpx !important;
  693. }
  694. }
  695. .footBox {
  696. position: fixed;
  697. left: 0px;
  698. bottom: 0px;
  699. height: 100rpx;
  700. width: 100%;
  701. display: flex;
  702. align-items: center;
  703. justify-content: space-between;
  704. view {
  705. width: 100%;
  706. height: 100%;
  707. text-align: center;
  708. color: #fff;
  709. display: flex;
  710. align-items: center;
  711. justify-content: center;
  712. }
  713. .reg {
  714. background: $u-success-dark;
  715. }
  716. .add {
  717. background: $uni-color-primary;
  718. }
  719. .uni-icons {
  720. margin-right: 8rpx !important;
  721. }
  722. }
  723. .listBox {
  724. padding: 20rpx 10rpx;
  725. border-bottom: 1px #f2f2f2 solid;
  726. position: relative;
  727. &.code {
  728. .label {
  729. width: 120rpx !important;
  730. }
  731. }
  732. .listTit {
  733. width: 100%;
  734. display: flex;
  735. justify-content: space-between;
  736. align-items: center;
  737. /deep/uni-button {
  738. margin-right: 20rpx;
  739. width: 100rpx;
  740. &.assets {
  741. width: 180rpx;
  742. }
  743. }
  744. .name {
  745. width: 50%;
  746. margin-left: 10px;
  747. overflow: hidden;
  748. white-space: nowrap;
  749. -o-text-overflow: ellipsis;
  750. text-overflow: ellipsis;
  751. font-size: 30rpx;
  752. }
  753. .btn {
  754. display: flex;
  755. justify-content: flex-end;
  756. }
  757. .weight {
  758. width: 30%;
  759. font-size: 30rpx;
  760. margin-left: auto;
  761. margin-right: 60rpx;
  762. position: relative;
  763. display: flex;
  764. input {
  765. margin-right: 10rpx;
  766. border: 1px solid black;
  767. width: 40%;
  768. height: 20rpx;
  769. }
  770. }
  771. .weight::after {
  772. position: absolute;
  773. right: -30rpx;
  774. top: 50%;
  775. content: '';
  776. background: #eee;
  777. width: 1px;
  778. height: 28rpx;
  779. margin-top: -14rpx;
  780. }
  781. }
  782. .z_list {
  783. max-height: 500rpx;
  784. .material {
  785. margin-top: 10rpx;
  786. .left {
  787. width: 40rpx;
  788. }
  789. .zdy_check {
  790. width: 30rpx;
  791. height: 30rpx;
  792. border: 2rpx solid #c8c9cc;
  793. border-radius: 4rpx;
  794. }
  795. .check_active {
  796. background: $theme-color;
  797. border: 2rpx solid $theme-color;
  798. /deep/ .u-icon__icon {
  799. color: #fff !important;
  800. }
  801. }
  802. .content_table {
  803. width: 670rpx;
  804. border: 2rpx solid $border-color;
  805. .item {
  806. display: flex;
  807. border-bottom: 2rpx solid $border-color;
  808. .lable {
  809. width: 200rpx;
  810. text-align: center;
  811. background-color: #f7f9fa;
  812. font-size: 26rpx;
  813. border-right: 2rpx solid $border-color;
  814. flex-shrink: 0;
  815. }
  816. .ww80 {
  817. width: 80rpx;
  818. }
  819. .content {
  820. width: 500rpx;
  821. min-height: 64rpx;
  822. font-size: 28rpx;
  823. line-height: 28rpx;
  824. font-style: normal;
  825. font-weight: 400;
  826. padding: 18rpx 8rpx;
  827. box-sizing: border-box;
  828. word-wrap: break-word;
  829. flex-grow: 1 !important;
  830. }
  831. .input_box {
  832. padding: 0 !important;
  833. }
  834. .content_num {
  835. display: flex;
  836. align-items: center;
  837. padding: 0 4rpx;
  838. /deep/ .uni-input-input {
  839. width: 200rpx;
  840. border: 2rpx solid #f0f8f2;
  841. background: #f0f8f2;
  842. color: $theme-color;
  843. }
  844. .unit {
  845. padding: 0 4rpx;
  846. font-size: 24rpx;
  847. color: #404446;
  848. }
  849. }
  850. .ww400 {
  851. /deep/ .uni-input-input {
  852. width: 400rpx;
  853. }
  854. }
  855. .pd4 {
  856. padding: 4rpx 8rpx;
  857. }
  858. &:last-child {
  859. border-bottom: none;
  860. }
  861. }
  862. .ww55 {
  863. width: 55%;
  864. }
  865. .ww45 {
  866. width: 45%;
  867. }
  868. .ww50 {
  869. width: 50%;
  870. }
  871. .ww30 {
  872. width: 30%;
  873. }
  874. .ww70 {
  875. width: 70%;
  876. }
  877. .ww80 {
  878. width: 80%;
  879. }
  880. .ww20 {
  881. width: 20%;
  882. }
  883. .check {
  884. width: 30rpx;
  885. height: 30rpx;
  886. }
  887. .tag_box {
  888. padding: 2rpx 10rpx;
  889. margin-right: 12rpx;
  890. background: #e6a23c;
  891. font-size: 22rpx;
  892. color: #fff;
  893. border-radius: 4rpx;
  894. }
  895. }
  896. }
  897. }
  898. .more {
  899. position: absolute;
  900. bottom: 26rpx;
  901. right: 30rpx;
  902. font-size: 28rpx;
  903. color: #666;
  904. }
  905. }
  906. .listCont {
  907. display: flex;
  908. align-items: center;
  909. flex-wrap: wrap;
  910. margin-top: 20rpx;
  911. margin-left: 10rpx;
  912. &.save {
  913. .u-input {
  914. border: none;
  915. }
  916. }
  917. .u-input {
  918. border: 1px solid rgb(229, 229, 229);
  919. height: 15rpx !important;
  920. }
  921. .item {
  922. width: 47%;
  923. font-size: 28rpx;
  924. margin-bottom: 10rpx;
  925. margin-right: 3%;
  926. // line-height: 45rpx;
  927. // overflow: hidden;
  928. // white-space: nowrap;
  929. // text-overflow: ellipsis;
  930. // -o-text-overflow: ellipsis;
  931. // color: #000;
  932. // display: flex;
  933. /deep/.u-form-item__body {
  934. padding: 0 !important;
  935. }
  936. /deep/.u-input__content__field-wrapper__field,
  937. /deep/.u-form-item {
  938. font-size: 28rpx !important;
  939. }
  940. text.label {
  941. width: 120rpx;
  942. display: inline-block;
  943. text-align: right;
  944. margin-right: 20rpx;
  945. margin-bottom: 20rpx;
  946. }
  947. /deep/.uni-date__x-input {
  948. height: 40rpx;
  949. font-size: 28rpx;
  950. }
  951. /deep/.uni-date {
  952. width: 48%;
  953. display: inline-block;
  954. .uni-icons {
  955. display: none !important;
  956. }
  957. .uni-date-x {
  958. padding: 0 !important;
  959. }
  960. }
  961. }
  962. .item text {
  963. color: #666;
  964. }
  965. }
  966. .selectTime {
  967. display: flex;
  968. justify-content: flex-end;
  969. margin-bottom: 10rpx;
  970. .timeBox {
  971. display: flex;
  972. width: 500rpx;
  973. .firstBtn {
  974. margin-right: 10rpx;
  975. }
  976. }
  977. }
  978. .listBox:last-child {
  979. border: none !important;
  980. }
  981. .textBox {
  982. border: 1px #f2f2f2 solid;
  983. height: 160px;
  984. display: block;
  985. width: auto !important;
  986. }
  987. .saveBtn {
  988. width: 50%;
  989. margin: 40rpx auto;
  990. }
  991. .top-css {
  992. border-bottom: 1px solid rgb(207, 204, 204);
  993. }
  994. </style>