warehouseManagementPerfectDelivery.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077
  1. // 完善出库信息
  2. <template>
  3. <div class="container">
  4. <el-row>
  5. <el-col :span="20">
  6. <h2 class="bg-left title">完善出库登记</h2>
  7. </el-col>
  8. <el-col :span="4" class="bg-right">
  9. <el-button
  10. class="bg-bottom"
  11. type="primary"
  12. size="small"
  13. @click="revert()"
  14. ><img
  15. width="6"
  16. height="10"
  17. style="vertical-align: bottom; margin-right: 3px"
  18. src="../../../public/img/lujing.png"
  19. alt=""
  20. />返回</el-button
  21. >
  22. </el-col>
  23. </el-row>
  24. <ws-form ref="dataList" :model="dataList" :rules="rules">
  25. <div class="basicInformation">
  26. <h2>
  27. {{ this.deptBudgetList1.warehouseName }}库
  28. <span class="position" v-show="this.$route.query.warehouseType == 1">
  29. {{ this.deptBudgetList1.binNumber }}仓位
  30. </span>
  31. <span v-show="this.$route.query.warehouseType == 2"> (临) </span>
  32. </h2>
  33. <div class="small-title">基本信息</div>
  34. <ws-info-table>
  35. <!-- 货名 -->
  36. <ws-form-item label="货名" span="1">
  37. <ws-select
  38. v-model="dataList.goodsName"
  39. placeholder=""
  40. class="typeselect"
  41. @change="selectgoodsName"
  42. >
  43. <ws-option
  44. v-for="item in goodnameList"
  45. :key="item.constKey"
  46. :label="item.constValue"
  47. :value="item.constValue"
  48. />
  49. </ws-select>
  50. </ws-form-item>
  51. <!--毛重(吨)-->
  52. <ws-form-item label="毛重(吨)" span="1" prop="grossWeight">
  53. <ws-input
  54. @input="grossWeightchange"
  55. v-model="dataList.grossWeight"
  56. placeholder="请输入毛重"
  57. maxlength="20"
  58. size="small"
  59. />
  60. </ws-form-item>
  61. <!--皮重(吨)-->
  62. <ws-form-item
  63. label="皮重(吨)"
  64. span="1"
  65. prop="tare"
  66. class="readonly"
  67. >
  68. <ws-input
  69. @input="tarechange"
  70. v-model="dataList.tare"
  71. placeholder="请输入皮重"
  72. maxlength="100"
  73. size="small"
  74. />
  75. </ws-form-item>
  76. <!--净重(吨)-->
  77. <ws-form-item label="净重(吨)" span="1" prop="netWeight">
  78. <ws-input
  79. :readonly="readonly"
  80. v-model.number="dataList.netWeight"
  81. placeholder="不可编辑,自动计算"
  82. type="number"
  83. maxlength="120"
  84. size="small"
  85. />
  86. </ws-form-item>
  87. <!-- 品级 -->
  88. <ws-form-item label="品级" span="1" class="readonly">
  89. <ws-select
  90. v-model="dataList.grade"
  91. placeholder=""
  92. class="typeselect"
  93. @change="selectpackingMethod"
  94. >
  95. <ws-option
  96. v-for="item in gradeList"
  97. :key="item.constKey"
  98. :label="item.constValue"
  99. :value="item.constValue"
  100. />
  101. </ws-select>
  102. </ws-form-item>
  103. <!--经办人-->
  104. <ws-form-item label="经办人" span="1" prop="agent">
  105. <el-select
  106. v-model="dataList.agent"
  107. placeholder="请选择经办人"
  108. filterable
  109. :filter-method="dataFilter"
  110. @change="selectstaff"
  111. >
  112. <el-option
  113. v-for="item in options"
  114. :key="item.value"
  115. :label="item.staffName"
  116. :value="item.staffName"
  117. />
  118. </el-select>
  119. </ws-form-item>
  120. <!--出库日期-->
  121. <ws-form-item
  122. label="出库日期"
  123. span="1"
  124. prop="inOutDate"
  125. class="deliverydate"
  126. >
  127. <ws-date-picker
  128. v-model="dataList.inOutDate"
  129. type="date"
  130. placeholder="请选择出库日期"
  131. value-format="yyyy-MM-dd"
  132. />
  133. </ws-form-item>
  134. <!-- 出库类型 -->
  135. <ws-form-item label="出库类型" span="1">
  136. <ws-select
  137. v-model="dataList.inOutType"
  138. placeholder=""
  139. class="typeselect"
  140. @change="selectstorageType"
  141. >
  142. <ws-option
  143. v-for="item in deliveryType"
  144. :key="item.constKey"
  145. :label="item.constValue"
  146. :value="item.constValue"
  147. />
  148. </ws-select>
  149. </ws-form-item>
  150. <!--车牌号-->
  151. <ws-form-item label="车牌号" span="1" prop="sourceGoods">
  152. <ws-input
  153. v-model="dataList.carNo"
  154. placeholder="请输入车牌号"
  155. maxlength="20"
  156. size="small"
  157. />
  158. </ws-form-item>
  159. <ws-form-item label="合同编号" span="1">
  160. <ws-select
  161. v-model="dataList.contractNo"
  162. placeholder="请选择合同编号"
  163. class="typeselect"
  164. >
  165. <ws-option
  166. v-for="item in outContractNo"
  167. :key="item.constKey"
  168. :label="item.contractNo"
  169. :value="item.contractNo"
  170. />
  171. </ws-select>
  172. </ws-form-item>
  173. </ws-info-table>
  174. </div>
  175. <div class="small-title">上传仓库照片</div>
  176. <ws-upload
  177. ref="upload"
  178. table-name="maintain_work_order"
  179. oss-key="mainPlan"
  180. :comp-id="compId"
  181. :appendix-ids="appendixIdsAdd"
  182. :vesselId="dataList.addressUrl"
  183. :size-limit="size"
  184. @uploadSuccess="uploadSuccess"
  185. @onChange="onChange"
  186. accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
  187. />
  188. <div class="small-title">化验数据(选填)</div>
  189. <div class="inspector">
  190. <!--质检员-->
  191. <ws-form-item label="质检员" span="1" prop="qualityInspector">
  192. <ws-input
  193. v-model="dataList.warehouseInOutDetail.qualityInspector"
  194. placeholder="请输入质检员姓名"
  195. maxlength="120"
  196. size="small"
  197. />
  198. </ws-form-item>
  199. </div>
  200. <div class="neifor">
  201. <ws-info-table>
  202. <!--水分(%)<=-->
  203. <ws-form-item label="水分(%)<=" span="1" prop="waterContent">
  204. <ws-input
  205. v-model="dataList.warehouseInOutDetail.waterContent"
  206. placeholder="请输入水分占比"
  207. maxlength="120"
  208. size="small"
  209. />
  210. </ws-form-item>
  211. <!--杂质(%)<=-->
  212. <ws-form-item label="杂质(%)<=" span="1" prop="impurity">
  213. <ws-input
  214. v-model="dataList.warehouseInOutDetail.impurity"
  215. placeholder="请输入杂质占比"
  216. maxlength="120"
  217. size="small"
  218. />
  219. </ws-form-item>
  220. <!--容重(克/升)>=-->
  221. <ws-form-item label="容重(克/升)>=" span="1" prop="bulkDensity">
  222. <ws-input
  223. v-model="dataList.warehouseInOutDetail.bulkDensity"
  224. placeholder="请输入容重"
  225. maxlength="120"
  226. size="small"
  227. />
  228. </ws-form-item>
  229. <!--霉变粒(%)<=-->
  230. <ws-form-item label="霉变粒(%)<=" span="1" prop="mildewGrain">
  231. <ws-input
  232. v-model="dataList.warehouseInOutDetail.mildewGrain"
  233. placeholder="请输入霉变粒占比"
  234. maxlength="120"
  235. size="small"
  236. />
  237. </ws-form-item>
  238. <!--热损伤(%)<=-->
  239. <ws-form-item label="热损伤(%)<=" span="1" prop="jiaorenli">
  240. <ws-input
  241. v-model="dataList.warehouseInOutDetail.jiaorenli"
  242. placeholder="请输入热损伤占比"
  243. maxlength="120"
  244. size="small"
  245. />
  246. </ws-form-item>
  247. <!--不完整粒(%)<=-->
  248. <ws-form-item label="不完整粒(%)<=" span="1" prop="imperfectGrain">
  249. <ws-input
  250. v-model="dataList.warehouseInOutDetail.imperfectGrain"
  251. placeholder="请输入不完整粒占比"
  252. maxlength="120"
  253. size="small"
  254. />
  255. </ws-form-item>
  256. </ws-info-table>
  257. </div>
  258. <div style="text-align: right; padding: 10px">
  259. <el-button
  260. class="bg-bottom-up"
  261. type="primary"
  262. size="small"
  263. @click="temporaryStorage()"
  264. >暂存</el-button
  265. >
  266. <el-button
  267. class="bg-bottom-up"
  268. type="primary"
  269. size="small"
  270. @click="submit()"
  271. >提交</el-button
  272. >
  273. </div>
  274. </ws-form>
  275. </div>
  276. </template>
  277. <script>
  278. import {
  279. pullDown,
  280. addstorageputList,
  281. xialaNo,
  282. getstaff,
  283. } from '@/model/warehouse/index'
  284. import { downloadFile } from '@/utils/batchDown'
  285. import Pagination from '@/components/Pagination'
  286. import WsUpload from '@/components/WsUpload'
  287. import { mapActions, mapGetters, mapState } from 'vuex'
  288. // import { dayjs, fmoney, EventBus } from 'base-core-lib'
  289. import { dayjs, EventBus } from 'base-core-lib'
  290. export default {
  291. name: 'viewSpareMoney',
  292. components: {
  293. WsUpload,
  294. Pagination,
  295. },
  296. watch: {
  297. isShow(val) {
  298. this.showType = val
  299. },
  300. },
  301. computed: {
  302. ...mapGetters(['deptBudgetList']),
  303. },
  304. data() {
  305. return {
  306. //弹出框
  307. dialogViewSpareMoney: false,
  308. dialogApproveFormVisible: false,
  309. // 船舶类型
  310. monetaryKey: null,
  311. // 表格显示数据
  312. tableDate: [],
  313. // 是否显示
  314. showType: true,
  315. // 年
  316. year: '',
  317. readonly: true,
  318. deptBudgetTotal: 0,
  319. currentPage: 1,
  320. pageSize: 10,
  321. searchType: 1,
  322. searchKeyWord: '',
  323. contractType: 2,
  324. startDate: null,
  325. endDate: null,
  326. goodnameList: {},
  327. staffList: [],
  328. options: [],
  329. storageType: [],
  330. deliveryType: [],
  331. outContractNo: [],
  332. // 提交类型
  333. submitType: true,
  334. storageType: [],
  335. appendixIdsAdd: '',
  336. uploadSuccess: {},
  337. onChange: {},
  338. deptBudgetList1: [],
  339. gradeList: [],
  340. rules: {
  341. netWeight: [
  342. {
  343. required: true,
  344. type: 'number',
  345. message: '请输入活动名称',
  346. trigger: 'blur',
  347. },
  348. ],
  349. },
  350. size: 10,
  351. compId: sessionStorage.getItem('ws-pf_compId'),
  352. deptCircularPage: {},
  353. packtypeList: {},
  354. date: {
  355. year: dayjs().format('YYYY'),
  356. month: dayjs().format('MM'),
  357. },
  358. contractList: [],
  359. dataList: {
  360. id: '',
  361. grossWeight: '',
  362. contractNo: '',
  363. tare: '',
  364. netWeight: '',
  365. grade: '',
  366. agent: '',
  367. carNo: '',
  368. inOutDate: '',
  369. inOutType: '',
  370. goodsName: '',
  371. warehouseInOutDetail: {},
  372. },
  373. historyList: [],
  374. pickerBeginDateBefore: {
  375. disabledDate: (time) => {
  376. return time.getTime() > Date.now()
  377. },
  378. },
  379. accessoryTFs: false,
  380. }
  381. },
  382. activated() {
  383. this.deptBudgetList1.warehouseName = this.$route.query.warehouseName
  384. this.deptBudgetList1.binNumber = this.$route.query.binNumber
  385. this.getList()
  386. this.dataList.id = this.$route.query.id
  387. this.dataList.grossWeight = this.$route.query.grossWeight
  388. this.dataList.contractNo = this.$route.query.contractNo
  389. this.dataList.baseId = this.$route.query.baseId
  390. this.dataList.positionId = this.$route.query.positionId
  391. this.dataList.warehouseName = this.$route.query.warehouseName
  392. this.dataList.binNumber = this.$route.query.binNumber
  393. this.dataList.tare = this.$route.query.tare
  394. this.dataList.netWeight = this.$route.query.netWeight
  395. this.dataList.grade = this.$route.query.grade
  396. this.dataList.agent = this.$route.query.agent
  397. this.dataList.carNo = this.$route.query.carNo
  398. this.dataList.inOutDate = this.$route.query.inOutDate
  399. this.dataList.contractNo = this.$route.query.contractNo
  400. this.dataList.inOutType = this.$route.query.inOutType
  401. this.dataList.compId = this.$route.query.compId
  402. this.dataList.goodsName = this.$route.query.goodsName
  403. this.dataList.goodsNameKey = Number(this.$route.query.goodsNameKey)
  404. this.dataList.inOutFlag = this.$route.inOutFlag
  405. this.dataList.inOutTypeKey = Number(this.$route.query.inOutTypeKey)
  406. this.dataList.statusFlag = this.$route.statusFlag
  407. this.dataList.warehouseInOutDetail = this.$route.query.warehouseInOutDetail
  408. console.log(this.dataList)
  409. },
  410. methods: {
  411. //返回按钮
  412. revert() {
  413. this.$router.go(-1)
  414. },
  415. dataFilter(val) {
  416. // console.log(val,"名")
  417. this.deptBudgetList.staffList = val
  418. if (val) {
  419. //val存在
  420. this.options = this.staffList.filter((item) => {
  421. if (
  422. !!~item.staffName.indexOf(val) ||
  423. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  424. ) {
  425. return true
  426. }
  427. })
  428. } else {
  429. //val为空时,还原数组
  430. this.options = this.staffList
  431. }
  432. },
  433. selectstaff(e) {
  434. for (var i = 0; i < this.staffList.length; i++) {
  435. if (this.staffList[i].staffName == e) {
  436. this.deptBudgetList.personChargeKey = this.staffList[i].staffId
  437. }
  438. }
  439. },
  440. //暂存按钮
  441. temporaryStorage() {
  442. this.$confirm(`暂存后可在待完成页面查看,确定暂存`, {
  443. cancelButtonText: '取消',
  444. confirmButtonText: '确定',
  445. type: 'warning',
  446. })
  447. .then(() => {
  448. this.$refs.dataList.validate((valid) => {
  449. if (valid) {
  450. this.dataList.compId = sessionStorage.getItem('ws-pf_compId')
  451. this.dataList.inOutFlag = 1
  452. this.dataList.statusFlag = 1
  453. addstorageputList(this.dataList)
  454. .toPromise()
  455. .then((response) => {
  456. this.$message.success('暂存成功')
  457. this.$router.push({ path: 'warehouseManagementList' })
  458. })
  459. } else {
  460. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  461. return false
  462. }
  463. })
  464. })
  465. .catch(() => {
  466. return false
  467. })
  468. },
  469. //提交按钮
  470. submit() {
  471. if (!this.dataList.goodsName) {
  472. this.$message({
  473. message: '货名不能为空',
  474. type: 'warning',
  475. })
  476. return
  477. }
  478. if (!this.dataList.grossWeight) {
  479. this.$message({
  480. message: '毛重不能为空',
  481. type: 'warning',
  482. })
  483. return
  484. }
  485. if (
  486. this.dataList.grossWeight <= 0 ||
  487. this.dataList.grossWeight > 10000 ||
  488. (String(this.dataList.grossWeight).indexOf('.') != -1 &&
  489. String(this.dataList.grossWeight).length -
  490. (String(this.dataList.grossWeight).indexOf('.') + 1) >
  491. 3)
  492. ) {
  493. this.$message({
  494. message: '毛重输入错误',
  495. type: 'warning',
  496. })
  497. return
  498. }
  499. if (
  500. this.dataList.tare < 0 ||
  501. this.dataList.tare > 10000 ||
  502. (String(this.dataList.tare).indexOf('.') != -1 &&
  503. String(this.dataList.tare).length -
  504. (String(this.dataList.tare).indexOf('.') + 1) >
  505. 3)
  506. ) {
  507. this.$message({
  508. message: '皮重输入错误',
  509. type: 'warning',
  510. })
  511. return
  512. }
  513. if (!this.dataList.agent) {
  514. this.$message({
  515. message: '经办人不能为空',
  516. type: 'warning',
  517. })
  518. return
  519. }
  520. if (this.dataList.agent.length < 2 || this.dataList.agent.length > 10) {
  521. this.$message({
  522. message: '经办人输入有误',
  523. type: 'warning',
  524. })
  525. return
  526. }
  527. if (!this.dataList.grade) {
  528. this.$message({
  529. message: '品级不能为空!',
  530. type: 'warning',
  531. })
  532. return
  533. }
  534. if (!this.dataList.inOutDate) {
  535. this.$message({
  536. message: '入库日期不能为空!',
  537. type: 'warning',
  538. })
  539. return
  540. }
  541. if (!this.dataList.inOutType) {
  542. this.$message({
  543. message: '出库类型不能为空!',
  544. type: 'warning',
  545. })
  546. return
  547. }
  548. if (!this.dataList.carNo) {
  549. this.$message({
  550. message: '车牌号不能为空',
  551. type: 'warning',
  552. })
  553. return
  554. }
  555. if (this.dataList.carNo.length > 7) {
  556. this.$message({
  557. message: '车牌号输入错误,请输入7个字符之内',
  558. type: 'warning',
  559. })
  560. return
  561. }
  562. if (!this.dataList.contractNo) {
  563. this.$message({
  564. message: '合同编号不能为空',
  565. type: 'warning',
  566. })
  567. return
  568. }
  569. if (
  570. this.dataList.contractNo.length < 6 ||
  571. this.dataList.contractNo.length > 20
  572. ) {
  573. this.$message({
  574. message: '合同编号长度不符合要求,请输入6-20个字符之内',
  575. type: 'warning',
  576. })
  577. return
  578. }
  579. if (this.dataList.netWeight > this.$route.query.capacity) {
  580. this.$message({
  581. message: '入库量大于该仓库容量!',
  582. type: 'warning',
  583. })
  584. return
  585. }
  586. //自检员
  587. if (this.dataList.warehouseInOutDetail.qualityInspector) {
  588. if (
  589. this.dataList.warehouseInOutDetail.qualityInspector.length < 2 ||
  590. this.dataList.warehouseInOutDetail.qualityInspector.length > 10
  591. ) {
  592. this.$message({
  593. message: '质检员姓名长度错误!',
  594. type: 'warning',
  595. })
  596. return
  597. }
  598. }
  599. if (this.dataList.warehouseInOutDetail.waterContent) {
  600. if (isNaN(this.dataList.warehouseInOutDetail.waterContent)) {
  601. this.$message({
  602. message: '水分(%)非数字!',
  603. type: 'warning',
  604. })
  605. return
  606. }
  607. if (
  608. this.dataList.warehouseInOutDetail.waterContent < 1 ||
  609. this.dataList.warehouseInOutDetail.waterContent > 40 ||
  610. (String(this.dataList.warehouseInOutDetail.waterContent).indexOf(
  611. '.'
  612. ) != -1 &&
  613. String(this.dataList.warehouseInOutDetail.waterContent).length -
  614. (String(this.dataList.warehouseInOutDetail.waterContent).indexOf(
  615. '.'
  616. ) +
  617. 1) >
  618. 2)
  619. ) {
  620. this.$message({
  621. message: '水分(%)输入错误! 取值范围1-40之间且可以保留2小数',
  622. type: 'warning',
  623. })
  624. return
  625. }
  626. }
  627. //杂质
  628. if (this.dataList.warehouseInOutDetail.impurity) {
  629. if (isNaN(this.dataList.warehouseInOutDetail.impurity)) {
  630. this.$message({
  631. message: '杂质(%)非数字!',
  632. type: 'warning',
  633. })
  634. return
  635. }
  636. if (
  637. this.dataList.warehouseInOutDetail.impurity < 1 ||
  638. this.dataList.warehouseInOutDetail.impurity > 40 ||
  639. (String(this.dataList.warehouseInOutDetail.impurity).indexOf('.') !=
  640. -1 &&
  641. String(this.dataList.warehouseInOutDetail.impurity).length -
  642. (String(this.dataList.warehouseInOutDetail.impurity).indexOf(
  643. '.'
  644. ) +
  645. 1) >
  646. 2)
  647. ) {
  648. this.$message({
  649. message: '杂质(%)输入错误! 取值范围1-40之间且可以保留2小数',
  650. type: 'warning',
  651. })
  652. return
  653. }
  654. }
  655. //霉变
  656. if (this.dataList.warehouseInOutDetail.mildewGrain) {
  657. if (isNaN(this.dataList.warehouseInOutDetail.mildewGrain)) {
  658. this.$message({
  659. message: '霉变粒(%)非数字!',
  660. type: 'warning',
  661. })
  662. return
  663. }
  664. if (
  665. this.dataList.warehouseInOutDetail.mildewGrain < 1 ||
  666. this.dataList.warehouseInOutDetail.mildewGrain > 40 ||
  667. (String(this.dataList.warehouseInOutDetail.mildewGrain).indexOf(
  668. '.'
  669. ) != -1 &&
  670. String(this.dataList.warehouseInOutDetail.mildewGrain).length -
  671. (String(this.dataList.warehouseInOutDetail.mildewGrain).indexOf(
  672. '.'
  673. ) +
  674. 1) >
  675. 2)
  676. ) {
  677. this.$message({
  678. message: '霉变粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
  679. type: 'warning',
  680. })
  681. return
  682. }
  683. }
  684. //热损伤
  685. if (this.dataList.warehouseInOutDetail.jiaorenli) {
  686. if (isNaN(this.dataList.warehouseInOutDetail.jiaorenli)) {
  687. this.$message({
  688. message: '热损伤(%)非数字!',
  689. type: 'warning',
  690. })
  691. return
  692. }
  693. if (
  694. this.dataList.warehouseInOutDetail.jiaorenli < 1 ||
  695. this.dataList.warehouseInOutDetail.jiaorenli > 40 ||
  696. (String(this.dataList.warehouseInOutDetail.jiaorenli).indexOf('.') !=
  697. -1 &&
  698. String(this.dataList.warehouseInOutDetail.jiaorenli).length -
  699. (String(this.dataList.warehouseInOutDetail.jiaorenli).indexOf(
  700. '.'
  701. ) +
  702. 1) >
  703. 2)
  704. ) {
  705. this.$message({
  706. message: '热损伤(%)输入错误! 取值范围1-40之间且可以保留2小数',
  707. type: 'warning',
  708. })
  709. return
  710. }
  711. }
  712. //不完整粒(%)
  713. if (this.dataList.warehouseInOutDetail.imperfectGrain) {
  714. if (isNaN(this.dataList.warehouseInOutDetail.imperfectGrain)) {
  715. this.$message({
  716. message: '不完整粒(%)非数字!',
  717. type: 'warning',
  718. })
  719. return
  720. }
  721. if (
  722. this.dataList.warehouseInOutDetail.imperfectGrain < 1 ||
  723. this.dataList.warehouseInOutDetail.imperfectGrain > 40 ||
  724. (String(this.dataList.warehouseInOutDetail.imperfectGrain).indexOf(
  725. '.'
  726. ) != -1 &&
  727. String(this.dataList.warehouseInOutDetail.imperfectGrain).length -
  728. (String(
  729. this.dataList.warehouseInOutDetail.imperfectGrain
  730. ).indexOf('.') +
  731. 1) >
  732. 2)
  733. ) {
  734. this.$message({
  735. message: '不完整粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
  736. type: 'warning',
  737. })
  738. return
  739. }
  740. }
  741. //容重
  742. if (this.dataList.warehouseInOutDetail.bulkDensity) {
  743. if (isNaN(this.dataList.warehouseInOutDetail.bulkDensity)) {
  744. this.$message({
  745. message: '容重(克/升)非数字!',
  746. type: 'warning',
  747. })
  748. return
  749. }
  750. if (
  751. this.dataList.warehouseInOutDetail.bulkDensity < 1 ||
  752. this.dataList.warehouseInOutDetail.bulkDensity > 40 ||
  753. (String(this.dataList.warehouseInOutDetail.bulkDensity).indexOf(
  754. '.'
  755. ) != -1 &&
  756. String(this.dataList.warehouseInOutDetail.bulkDensity).length -
  757. (String(this.dataList.warehouseInOutDetail.bulkDensity).indexOf(
  758. '.'
  759. ) +
  760. 1) >
  761. 0)
  762. ) {
  763. this.$message({
  764. message: '容重(克/升)输入错误! 取值范围1-40之间且是整数',
  765. type: 'warning',
  766. })
  767. return
  768. }
  769. }
  770. this.$refs.dataList.validate((valid) => {
  771. if (valid) {
  772. this.dataList.compId = sessionStorage.getItem('ws-pf_compId')
  773. this.dataList.inOutFlag = 1
  774. this.dataList.statusFlag = 3
  775. addstorageputList(this.dataList)
  776. .toPromise()
  777. .then((response) => {
  778. this.$message.success('添加成功')
  779. this.$router.push({ path: 'warehouseManagementList' })
  780. })
  781. } else {
  782. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  783. return false
  784. }
  785. })
  786. },
  787. tarechange(e) {
  788. if (this.dataList.grossWeight && this.dataList.tare) {
  789. this.dataList.netWeight = Number(
  790. this.dataList.grossWeight - this.dataList.tare
  791. )
  792. }
  793. },
  794. grossWeightchange(e) {
  795. if (this.dataList.grossWeight && this.dataList.tare) {
  796. this.dataList.netWeight = Number(
  797. this.dataList.grossWeight - this.dataList.tare
  798. )
  799. }
  800. },
  801. selectgoodsName(e) {
  802. for (var i = 0; i < this.goodnameList.length; i++) {
  803. if (this.goodnameList[i].constValue == e) {
  804. this.dataList.goodsNameKey = this.goodnameList[i].constKey
  805. }
  806. }
  807. },
  808. selectpackingMethod(e) {
  809. for (var i = 0; i < this.packtypeList.length; i++) {
  810. if (this.packtypeList[i].constValue == e) {
  811. this.dataList.packingMethodKey = this.packtypeList[i].constKey
  812. }
  813. }
  814. },
  815. selectstorageType(e) {
  816. for (var i = 0; i < this.storageType.length; i++) {
  817. if (this.storageType[i].constValue == e) {
  818. this.dataList.inOutTypeKey = this.storageType[i].constKey
  819. }
  820. }
  821. },
  822. handleClose() {
  823. this.accessoryTFs = false
  824. },
  825. handleSizeChange(val) {
  826. console.log(`每页 ${val} 条`)
  827. this.pageSize = val
  828. this.getList()
  829. },
  830. handleCurrentChange(val) {
  831. this.currentPage = val
  832. console.log(`当前页: ${val}`)
  833. this.getList()
  834. },
  835. getList() {
  836. // 货名
  837. pullDown({ constId: 'CON2' })
  838. .toPromise()
  839. .then((response) => {
  840. this.goodnameList = response
  841. })
  842. // 品级
  843. pullDown({ constId: 'CON3' })
  844. .toPromise()
  845. .then((response) => {
  846. this.gradeList = response
  847. })
  848. // 类型
  849. if (this.$route.query.warehouseType == '1') {
  850. pullDown({ constId: 'CON6' })
  851. .toPromise()
  852. .then((response) => {
  853. this.deliveryType = response
  854. })
  855. } else if (this.$route.query.warehouseType == '2') {
  856. //临时仓库出库类型
  857. pullDown({ constId: 'WARE2' })
  858. .toPromise()
  859. .then((response) => {
  860. this.deliveryType = response
  861. })
  862. }
  863. //合同编号
  864. xialaNo({ compId: sessionStorage.getItem('ws-pf_compId') })
  865. .toPromise()
  866. .then((response) => {
  867. this.outContractNo = response
  868. })
  869. //经办人
  870. getstaff({ compId: sessionStorage.getItem('ws-pf_compId') })
  871. .toPromise()
  872. .then((response) => {
  873. this.options = response
  874. this.staffList = response
  875. // this.agent = response
  876. })
  877. },
  878. selecttaskType(e) {
  879. for (var i = 0; i < this.taskTypeList.length; i++) {
  880. if (this.taskTypeList[i].value == e) {
  881. this.searchType = this.taskTypeList[i].type
  882. }
  883. }
  884. },
  885. fujian(row) {
  886. if (
  887. row.receiveAttachmentPath === null ||
  888. row.receiveAttachmentPath === ''
  889. ) {
  890. EventBus.$emit(
  891. 'warning',
  892. this.$t('system.noticeCircular.NoInformation')
  893. )
  894. } else {
  895. this.accessoryTFs = true
  896. }
  897. this.appendixIdss = row.receiveAttachmentPath
  898. },
  899. handleExamine(row) {
  900. this.$router.push({
  901. name: 'salesContractExamine',
  902. query: { id: row.id },
  903. })
  904. },
  905. // 关闭 dialog时 处理文件url 初始化upload组件
  906. handleCloe() {
  907. this.dialogViewSpareMoney = false
  908. },
  909. history(row) {
  910. console.log(row)
  911. billoperatehis({ id: row.id })
  912. .toPromise()
  913. .then((response) => {
  914. this.historyList = response
  915. })
  916. },
  917. //删除
  918. approve() {},
  919. listQuery() {},
  920. total() {},
  921. clearfiltQuery() {},
  922. selectCrtDuty() {},
  923. },
  924. }
  925. </script>
  926. <style lang="scss" scoped>
  927. /deep/.basicInformation {
  928. .ws-info-table {
  929. border: none;
  930. }
  931. .el-form-item {
  932. width: 33.3333%;
  933. border: none;
  934. .el-form-item__label {
  935. background: transparent;
  936. border: none;
  937. }
  938. .el-form-item__content {
  939. border: none;
  940. }
  941. }
  942. }
  943. .title {
  944. position: relative;
  945. padding-left: 10px;
  946. }
  947. .title::before {
  948. content: '';
  949. display: inline-block;
  950. width: 5px;
  951. height: 30px;
  952. background: #5473e8;
  953. position: absolute;
  954. left: 0;
  955. }
  956. .el-form {
  957. padding: 0 10%;
  958. }
  959. .el-button--primary {
  960. background-color: #5878e8;
  961. border-color: #5878e8;
  962. }
  963. .el-col {
  964. background: #f6f7fc;
  965. }
  966. .bg-right {
  967. text-align: right;
  968. padding: 16px 20px;
  969. }
  970. .center {
  971. position: relative;
  972. top: 50px;
  973. width: 40%;
  974. height: 2000px;
  975. margin: 0 auto;
  976. }
  977. /deep/.el-form-item__label {
  978. width: 160px;
  979. }
  980. //选填
  981. /deep/.el-form-item {
  982. width: 50%;
  983. }
  984. .container {
  985. overflow: scroll;
  986. height: 120vh;
  987. }
  988. /deep/.ws-info-table .el-form-item .el-form-item__label {
  989. text-align: center;
  990. }
  991. .deliverydate {
  992. display: inline-block;
  993. width: 10%;
  994. }
  995. .center {
  996. margin-top: -60px;
  997. width: 80%;
  998. }
  999. //仓位
  1000. .position {
  1001. width: 52px;
  1002. height: 20px;
  1003. background: #afb5cb;
  1004. border-radius: 2px;
  1005. font-size: 12px;
  1006. font-family: PingFangSC-Medium, PingFang SC;
  1007. color: #ffffff;
  1008. line-height: 20px;
  1009. }
  1010. //表格文字
  1011. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1012. text-align: left;
  1013. font-size: 14px;
  1014. font-family: PingFangSC-Regular, PingFang SC;
  1015. font-weight: 400;
  1016. color: #8890b1;
  1017. line-height: 16px;
  1018. }
  1019. .inspector {
  1020. width: 50%;
  1021. }
  1022. //质检员
  1023. .inspector .el-form-item__content {
  1024. text-align: left;
  1025. margin-left: 0px;
  1026. }
  1027. /deep/[data-v-d228e17e] .el-form-item__label {
  1028. width: 60px;
  1029. }
  1030. .small-title {
  1031. position: relative;
  1032. padding: 10px;
  1033. font-weight: 600;
  1034. }
  1035. .small-title::before {
  1036. position: absolute;
  1037. content: '';
  1038. display: block;
  1039. background: #5473e8;
  1040. width: 4px;
  1041. height: 14px;
  1042. left: 0px;
  1043. top: 13px;
  1044. }
  1045. //下面列表
  1046. .neifor {
  1047. width: 80%;
  1048. background-color: #f6f7fc;
  1049. }
  1050. /deep/.neifor .ws-info-table .el-form-item .el-form-item__label {
  1051. width: 35%;
  1052. text-align: center;
  1053. }
  1054. /deep/.neifor .ws-info-table .el-form-item .el-form-item__content {
  1055. width: 60%;
  1056. background-color: #f6f7fc;
  1057. }
  1058. /deep/.neifor .el-input--small .el-input__inner {
  1059. width: 100%;
  1060. }
  1061. .el-input__inner {
  1062. width: 150px;
  1063. }
  1064. </style>