warehouseManagementPerfectput.vue 34 KB

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