addStock.vue 27 KB

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