warehouseManagementPerfectDelivery.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  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="returnNoComplete()"
  14. >返回</el-button
  15. >
  16. </el-col>
  17. </el-row>
  18. <div class="center">
  19. <h2>鲅鱼圈一号库 102仓位</h2>
  20. <ws-form ref="deptBudgetList" :model="deptBudgetList">
  21. <!--毛重(吨)-->
  22. <ws-form-item label="毛重(吨)" span="1" prop="shippingType">
  23. <ws-input
  24. v-model="deptBudgetList.shippingType"
  25. placeholder="请输入毛重"
  26. maxlength="20"
  27. size="small"
  28. />
  29. </ws-form-item>
  30. <!--皮重(吨)-->
  31. <ws-form-item label="皮重(吨)" span="1" prop="buyer" class="readonly">
  32. <ws-input
  33. v-model="deptBudgetList.buyer"
  34. placeholder="请输入皮重"
  35. maxlength="100"
  36. size="small"
  37. />
  38. </ws-form-item>
  39. <!--净重(吨)-->
  40. <ws-form-item label="净重(吨)" span="1" prop="settlementMethod">
  41. <ws-input
  42. v-model="deptBudgetList.settlementMethod"
  43. placeholder="不可编辑,自动计算"
  44. maxlength="120"
  45. size="small"
  46. />
  47. </ws-form-item>
  48. <!-- 品级 -->
  49. <ws-form-item label="品级" span="1" class="readonly">
  50. <ws-select
  51. v-model="deptBudgetList.grade"
  52. placeholder=""
  53. class="typeselect"
  54. @change="selectpackingMethod"
  55. >
  56. <ws-option
  57. v-for="item in gradeList"
  58. :key="item.constKey"
  59. :label="item.constValue"
  60. :value="item.constValue"
  61. />
  62. </ws-select>
  63. </ws-form-item>
  64. <!--经办人-->
  65. <ws-form-item label="经办人" span="1" prop="seller" class="readonly">
  66. <ws-input
  67. v-model="deptBudgetList.seller"
  68. placeholder="请输入出库经办人姓名"
  69. maxlength="100"
  70. size="small"
  71. />
  72. </ws-form-item>
  73. <!--出库日期-->
  74. <ws-form-item
  75. label="出库日期"
  76. span="1"
  77. prop="signingDate"
  78. class="deliverydate"
  79. >
  80. <ws-date-picker
  81. v-model="deptBudgetList.signingDate"
  82. type="date"
  83. placeholder="请选择出库日期"
  84. value-format="yyyy-MM-dd"
  85. />
  86. </ws-form-item>
  87. <!-- 出库类型 -->
  88. <ws-form-item label="出库类型" span="1" class="readonly">
  89. <ws-select
  90. placeholder=""
  91. class="typeselect"
  92. @change="selectpackingMethod"
  93. >
  94. <ws-option
  95. v-for="item in goodnameList"
  96. :key="item.constKey"
  97. :label="item.constValue"
  98. :value="item.constValue"
  99. />
  100. </ws-select>
  101. </ws-form-item>
  102. <!--车牌号-->
  103. <ws-form-item label="车牌号" span="1" prop="sourceGoods">
  104. <ws-input
  105. v-model="deptBudgetList.sourceGoods"
  106. placeholder="请输入车牌号"
  107. maxlength="20"
  108. size="small"
  109. />
  110. </ws-form-item>
  111. <!--合同编号-->
  112. <ws-form-item label="合同编号" span="1" prop="contractNo">
  113. <ws-input
  114. v-model.number="deptBudgetList.buyerPhone"
  115. placeholder="请输入合同编号"
  116. maxlength="100"
  117. size="small"
  118. />
  119. </ws-form-item>
  120. <ws-upload
  121. ref="upload"
  122. table-name="maintain_work_order"
  123. oss-key="mainPlan"
  124. :comp-id="compId"
  125. :appendix-ids="appendixIdsAdd"
  126. :vesselId="deptBudgetList.addressUrl"
  127. :size-limit="size"
  128. @uploadSuccess="uploadSuccess"
  129. @onChange="onChange"
  130. accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
  131. />
  132. <div class="choice">
  133. <h2>化验数据(选填)</h2>
  134. <ws-info-table>
  135. <!--自检员-->
  136. <ws-form-item label="自检员" span="1" prop="settlementMethod">
  137. <ws-input
  138. v-model="deptBudgetList.settlementMethod"
  139. placeholder="请输入自检员姓名"
  140. maxlength="120"
  141. size="small"
  142. />
  143. </ws-form-item>
  144. <!--水分(%)<=-->
  145. <ws-form-item label="水分(%)<=" span="1" prop="settlementMethod">
  146. <ws-input
  147. v-model="deptBudgetList.settlementMethod"
  148. placeholder="请输入水分占比"
  149. maxlength="120"
  150. size="small"
  151. />
  152. </ws-form-item>
  153. <!--杂质(%)<=-->
  154. <ws-form-item label="杂质(%)<=" span="1" prop="settlementMethod">
  155. <ws-input
  156. v-model="deptBudgetList.settlementMethod"
  157. placeholder="请输入杂质占比"
  158. maxlength="120"
  159. size="small"
  160. />
  161. </ws-form-item>
  162. <!--容重(克/升)>=-->
  163. <ws-form-item
  164. label="容重(克/升)>="
  165. span="1"
  166. prop="settlementMethod"
  167. >
  168. <ws-input
  169. v-model="deptBudgetList.settlementMethod"
  170. placeholder="请输入容重"
  171. maxlength="120"
  172. size="small"
  173. />
  174. </ws-form-item>
  175. <!--霉变粒(%)<=-->
  176. <ws-form-item
  177. label="霉变粒(%)<="
  178. span="1"
  179. prop="settlementMethod"
  180. >
  181. <ws-input
  182. v-model="deptBudgetList.settlementMethod"
  183. placeholder="请输入霉变粒占比"
  184. maxlength="120"
  185. size="small"
  186. />
  187. </ws-form-item>
  188. <!--热损伤(%)<=-->
  189. <ws-form-item
  190. label="热损伤(%)<="
  191. span="1"
  192. prop="settlementMethod"
  193. >
  194. <ws-input
  195. v-model="deptBudgetList.settlementMethod"
  196. placeholder="请输入热损伤占比"
  197. maxlength="120"
  198. size="small"
  199. />
  200. </ws-form-item>
  201. <!--不完整粒(%)<=-->
  202. <ws-form-item
  203. label="不完整粒(%)<="
  204. span="1"
  205. prop="settlementMethod"
  206. >
  207. <ws-input
  208. v-model="deptBudgetList.settlementMethod"
  209. placeholder="请输入不完整粒占比"
  210. maxlength="120"
  211. size="small"
  212. />
  213. </ws-form-item>
  214. </ws-info-table>
  215. </div>
  216. <div style="text-align: right; padding: 10px">
  217. <el-button
  218. class="bg-bottom-up"
  219. type="primary"
  220. size="small"
  221. @click="returnWarehouse()"
  222. >暂存</el-button
  223. >
  224. <el-button
  225. class="bg-bottom-up"
  226. type="primary"
  227. size="small"
  228. @click="submit()"
  229. >提交</el-button
  230. >
  231. </div>
  232. </ws-form>
  233. </div>
  234. </div>
  235. </template>
  236. <script>
  237. import { pullDown, addstorageputList } from '@/model/warehouse/index'
  238. import { downloadFile } from '@/utils/batchDown'
  239. import Pagination from '@/components/Pagination'
  240. import WsUpload from '@/components/WsUpload'
  241. // import { dayjs, fmoney, EventBus } from 'base-core-lib'
  242. import { dayjs, EventBus } from 'base-core-lib'
  243. export default {
  244. name: 'viewSpareMoney',
  245. components: {
  246. WsUpload,
  247. Pagination,
  248. },
  249. watch: {
  250. vesselId(val) {
  251. this.getList()
  252. },
  253. isShow(val) {
  254. this.showType = val
  255. },
  256. },
  257. data() {
  258. return {
  259. //弹出框
  260. dialogViewSpareMoney: false,
  261. dialogApproveFormVisible: false,
  262. // 船舶类型
  263. monetaryKey: null,
  264. // 表格显示数据
  265. tableDate: [],
  266. // 是否显示
  267. showType: true,
  268. // 年
  269. year: '',
  270. deptBudgetTotal: 0,
  271. currentPage: 1,
  272. pageSize: 10,
  273. searchType: 1,
  274. searchKeyWord: '',
  275. contractType: 2,
  276. startDate: null,
  277. endDate: null,
  278. goodnameList: {},
  279. // 提交类型
  280. submitType: true,
  281. selectpackingMethod: {},
  282. appendixIdsAdd: {},
  283. uploadSuccess: {},
  284. onChange: {},
  285. size: 10,
  286. compId: sessionStorage.getItem('ws-pf_compId'),
  287. deptCircularPage: {},
  288. packtypeList: {},
  289. date: {
  290. year: dayjs().format('YYYY'),
  291. month: dayjs().format('MM'),
  292. },
  293. contractList: [],
  294. deptBudgetList: {},
  295. historyList: [],
  296. pickerBeginDateBefore: {
  297. disabledDate: (time) => {
  298. return time.getTime() > Date.now()
  299. },
  300. },
  301. accessoryTFs: false,
  302. }
  303. },
  304. activated() {
  305. //cg.viewBudget
  306. //cg.viewSpareMoney
  307. // this.getVesselData();
  308. // this.getList()
  309. this.showType = this.isShow
  310. },
  311. mounted(){
  312. this.getList()
  313. },
  314. methods: {
  315. //返回按钮
  316. returnNoComplete() {
  317. this.$router.push({ path: 'warehouseManagementNoComplete' })
  318. },
  319. //提交按钮
  320. submit() {
  321. this.$refs.deptBudgetList.validate((valid) => {
  322. if (valid) {
  323. this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
  324. this.deptBudgetList.inOutFlag = 1
  325. addstorageputList(this.deptBudgetList)
  326. .toPromise()
  327. .then((response) => {
  328. this.$message.success('添加成功')
  329. this.$router.push({ path: 'warehouseManagementList' })
  330. })
  331. } else {
  332. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  333. return false
  334. }
  335. })
  336. },
  337. //暂存按钮
  338. returnWarehouse() {
  339. this.$refs.deptBudgetList.validate((valid) => {
  340. if (valid) {
  341. this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
  342. this.deptBudgetList.statusFlag = 1
  343. addstorageputList(this.deptBudgetList)
  344. .toPromise()
  345. .then((response) => {
  346. this.$message.success('暂存成功')
  347. this.$router.push({ path: 'warehouseManagementNoComplete' })
  348. })
  349. } else {
  350. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  351. return false
  352. }
  353. })
  354. },
  355. dateFormat(fmt, date) {
  356. let ret
  357. const opt = {
  358. 'Y+': date.getFullYear().toString(), // 年
  359. 'm+': (date.getMonth() + 1).toString(), // 月
  360. 'd+': date.getDate().toString(), // 日
  361. 'H+': date.getHours().toString(), // 时
  362. // "M+": date.getMinutes().toString(), // 分
  363. // "S+": date.getSeconds().toString() // 秒
  364. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  365. }
  366. for (let k in opt) {
  367. ret = new RegExp('(' + k + ')').exec(fmt)
  368. if (ret) {
  369. fmt = fmt.replace(
  370. ret[1],
  371. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  372. )
  373. }
  374. }
  375. return fmt
  376. },
  377. handleClose() {
  378. this.accessoryTFs = false
  379. },
  380. handleSizeChange(val) {
  381. console.log(`每页 ${val} 条`)
  382. this.pageSize = val
  383. this.getList()
  384. },
  385. handleCurrentChange(val) {
  386. this.currentPage = val
  387. console.log(`当前页: ${val}`)
  388. this.getList()
  389. },
  390. getList() {
  391. // 货名
  392. pullDown({ constId: 'CON2' })
  393. .toPromise()
  394. .then((response) => {
  395. this.goodnameList = response
  396. })
  397. // 品级
  398. pullDown({ constId: 'CON3' })
  399. .toPromise()
  400. .then((response) => {
  401. this.gradeList = response
  402. })
  403. // 类型
  404. pullDown({ constId: 'CON5' })
  405. .toPromise()
  406. .then((response) => {
  407. this.storageType = response
  408. })
  409. },
  410. selecttaskType(e) {
  411. for (var i = 0; i < this.taskTypeList.length; i++) {
  412. if (this.taskTypeList[i].value == e) {
  413. this.searchType = this.taskTypeList[i].type
  414. }
  415. }
  416. },
  417. fujian(row) {
  418. if (
  419. row.receiveAttachmentPath === null ||
  420. row.receiveAttachmentPath === ''
  421. ) {
  422. EventBus.$emit(
  423. 'warning',
  424. this.$t('system.noticeCircular.NoInformation')
  425. )
  426. } else {
  427. this.accessoryTFs = true
  428. }
  429. this.appendixIdss = row.receiveAttachmentPath
  430. },
  431. handleExamine(row) {
  432. this.$router.push({
  433. name: 'salesContractExamine',
  434. query: { id: row.id },
  435. })
  436. },
  437. // 关闭 dialog时 处理文件url 初始化upload组件
  438. handleCloe() {
  439. this.dialogViewSpareMoney = false
  440. },
  441. history(row) {
  442. console.log(row)
  443. billoperatehis({ id: row.id })
  444. .toPromise()
  445. .then((response) => {
  446. this.historyList = response
  447. })
  448. },
  449. find() {
  450. this.startDate = this.dateFormat('YYYY-mm-dd', this.value2[0])
  451. this.endDate = this.dateFormat('YYYY-mm-dd', this.value2[1])
  452. this.currentPage = 1
  453. this.getList()
  454. },
  455. async exportlist() {
  456. const { data } = await export1(
  457. {
  458. compId: sessionStorage.getItem('ws-pf_compId'),
  459. contractType: this.contractType,
  460. currentPage: this.currentPage,
  461. pageSize: this.pageSize,
  462. searchType: this.searchType,
  463. searchKeyWord: this.searchKeyWord,
  464. startDate: this.startDate,
  465. endDate: this.endDate,
  466. },
  467. {},
  468. { responseType: 'blob' }
  469. ).toPromise()
  470. downloadFile({
  471. res: data,
  472. fileName: `${
  473. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  474. }_采购合同`,
  475. type: 'xls',
  476. })
  477. },
  478. // deletecontract(){},
  479. //删除
  480. approve() {},
  481. listQuery() {},
  482. total() {},
  483. clearfiltQuery() {},
  484. selectCrtDuty() {},
  485. },
  486. }
  487. </script>
  488. <style lang="scss" scoped>
  489. .center {
  490. position: relative;
  491. top: 50px;
  492. width: 40%;
  493. height: 2000px;
  494. margin: 0 auto;
  495. }
  496. /deep/.el-form-item__label {
  497. width: 160px;
  498. }
  499. /deep/.el-input--small {
  500. width: 70%;
  501. }
  502. .container .bg-bottom {
  503. position: absolute;
  504. float: right;
  505. top: 15px;
  506. right: 20px;
  507. }
  508. //选填
  509. /deep/.el-form-item {
  510. width: 50%;
  511. }
  512. .container {
  513. overflow: scroll;
  514. height: 120vh;
  515. }
  516. /deep/.ws-info-table[data-v-850a44a6] .el-form-item .el-form-item__label {
  517. text-align: center;
  518. }
  519. .deliverydate {
  520. width: 35%;
  521. }
  522. .center[data-v-32a9842f] {
  523. margin-top: -60px;
  524. }
  525. </style>