warehouseManagementIoss.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <template>
  2. <div class="container">
  3. <el-row>
  4. <el-col :span="20">
  5. <h2 class="bg-left title">盘损当期仓损</h2>
  6. </el-col>
  7. <el-col :span="4" class="bg-right">
  8. <el-button
  9. class="bg-bottom"
  10. type="primary"
  11. size="small"
  12. @click="returnWarehouse()"
  13. >返回</el-button
  14. >
  15. </el-col>
  16. </el-row>
  17. <div class="center">
  18. <h2>鲅鱼圈一号库 102仓位</h2>
  19. <ws-form ref="deptBudgetList" :model="deptBudgetList">
  20. <!-- 货名 -->
  21. <ws-form-item label="货名" span="1" class="readonly">
  22. <ws-select
  23. placeholder=""
  24. class="typeselect"
  25. @change="selectpackingMethod"
  26. >
  27. <ws-option
  28. v-for="item in goodnameList"
  29. :key="item.constKey"
  30. :label="item.constValue"
  31. :value="item.constValue"
  32. />
  33. </ws-select>
  34. </ws-form-item>
  35. <!--当期累计入库量-->
  36. <ws-form-item label="当期累计入库量(吨)" span="1" prop="shippingType">
  37. <ws-input
  38. v-model="deptBudgetList.shippingType"
  39. placeholder="当期累计入库量(吨)"
  40. maxlength="20"
  41. size="small"
  42. />
  43. </ws-form-item>
  44. <!--当期累计出库量(吨)-->
  45. <ws-form-item
  46. label="当期累计出库量(吨)"
  47. span="1"
  48. prop="buyer"
  49. class="readonly"
  50. >
  51. <ws-input
  52. v-model="deptBudgetList.buyer"
  53. placeholder="当期累计出库量(吨)"
  54. maxlength="100"
  55. size="small"
  56. />
  57. </ws-form-item>
  58. <!--应余库存(吨)-->
  59. <ws-form-item label="应余库存(吨)" span="1" prop="settlementMethod">
  60. <ws-input
  61. v-model="deptBudgetList.settlementMethod"
  62. placeholder="应余库存(吨)"
  63. maxlength="120"
  64. size="small"
  65. />
  66. </ws-form-item>
  67. <!--实际库存(吨)-->
  68. <ws-form-item
  69. label="实际库存(吨)"
  70. span="1"
  71. prop="seller"
  72. class="readonly"
  73. >
  74. <ws-input
  75. v-model="deptBudgetList.seller"
  76. placeholder="实际库存(吨)"
  77. maxlength="100"
  78. size="small"
  79. />
  80. </ws-form-item>
  81. <!--损耗量(吨)-->
  82. <ws-form-item label="损耗量(吨)" span="1" prop="sourceGoods">
  83. <ws-input
  84. v-model="deptBudgetList.sourceGoods"
  85. placeholder="损耗量(吨)"
  86. maxlength="20"
  87. size="small"
  88. />
  89. </ws-form-item>
  90. <!--库损比例-->
  91. <ws-form-item label="库损比例" span="1" prop="contractNo">
  92. <ws-input
  93. v-model.number="deptBudgetList.buyerPhone"
  94. placeholder="库损比例"
  95. maxlength="100"
  96. size="small"
  97. />
  98. </ws-form-item>
  99. <p>注:提交成功后,当期实际库存将作为下一期的初始库存。</p>
  100. </ws-form>
  101. <div style="text-align: right; padding: 10px">
  102. <el-button
  103. class="bg-bottom-up"
  104. type="primary"
  105. size="small"
  106. @click="submit()"
  107. >提交</el-button
  108. >
  109. </div>
  110. </div>
  111. </div>
  112. </template>
  113. <script>
  114. import {
  115. getList,
  116. export1,
  117. billoperatehis,
  118. } from '@/model/contarct/index'
  119. import { downloadFile } from '@/utils/batchDown'
  120. import Pagination from '@/components/Pagination'
  121. import WsUpload from '@/components/WsUpload'
  122. // import { dayjs, fmoney, EventBus } from 'base-core-lib'
  123. import { dayjs, EventBus } from 'base-core-lib'
  124. export default {
  125. name: 'viewSpareMoney',
  126. components: {
  127. WsUpload,
  128. Pagination,
  129. },
  130. watch: {
  131. vesselId(val) {
  132. this.getList()
  133. },
  134. isShow(val) {
  135. this.showType = val
  136. },
  137. },
  138. data() {
  139. return {
  140. //弹出框
  141. dialogViewSpareMoney: false,
  142. dialogApproveFormVisible: false,
  143. // 船舶类型
  144. monetaryKey: null,
  145. // 表格显示数据
  146. tableDate: [],
  147. // 是否显示
  148. showType: true,
  149. // 年
  150. year: '',
  151. deptBudgetTotal: 0,
  152. currentPage: 1,
  153. pageSize: 10,
  154. searchType: 1,
  155. searchKeyWord: '',
  156. contractType: 2,
  157. startDate: null,
  158. endDate: null,
  159. // 提交类型
  160. submitType: true,
  161. selectpackingMethod: {},
  162. size: 10,
  163. compId: sessionStorage.getItem('ws-pf_compId'),
  164. deptCircularPage: {},
  165. packtypeList: {},
  166. date: {
  167. year: dayjs().format('YYYY'),
  168. month: dayjs().format('MM'),
  169. },
  170. contractList: [],
  171. deptBudgetList: {},
  172. historyList: [],
  173. pickerBeginDateBefore: {
  174. disabledDate: (time) => {
  175. return time.getTime() > Date.now()
  176. },
  177. },
  178. accessoryTFs: false,
  179. }
  180. },
  181. activated() {
  182. //cg.viewBudget
  183. //cg.viewSpareMoney
  184. // this.getVesselData();
  185. this.getList()
  186. this.showType = this.isShow
  187. },
  188. methods: {
  189. //返回按钮
  190. returnWarehouse() {
  191. this.$router.push({ path: 'warehouseManagementList' })
  192. },
  193. //提交按钮
  194. submit(){
  195. this.$router.push({ path: 'warehouseManagementList' })
  196. },
  197. dateFormat(fmt, date) {
  198. let ret
  199. const opt = {
  200. 'Y+': date.getFullYear().toString(), // 年
  201. 'm+': (date.getMonth() + 1).toString(), // 月
  202. 'd+': date.getDate().toString(), // 日
  203. 'H+': date.getHours().toString(), // 时
  204. // "M+": date.getMinutes().toString(), // 分
  205. // "S+": date.getSeconds().toString() // 秒
  206. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  207. }
  208. for (let k in opt) {
  209. ret = new RegExp('(' + k + ')').exec(fmt)
  210. if (ret) {
  211. fmt = fmt.replace(
  212. ret[1],
  213. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  214. )
  215. }
  216. }
  217. return fmt
  218. },
  219. handleClose() {
  220. this.accessoryTFs = false
  221. },
  222. handleSizeChange(val) {
  223. console.log(`每页 ${val} 条`)
  224. this.pageSize = val
  225. this.getList()
  226. },
  227. handleCurrentChange(val) {
  228. this.currentPage = val
  229. console.log(`当前页: ${val}`)
  230. this.getList()
  231. },
  232. getList() {
  233. getList({
  234. compId: sessionStorage.getItem('ws-pf_compId'),
  235. contractType: this.contractType,
  236. currentPage: this.currentPage,
  237. pageSize: this.pageSize,
  238. searchType: this.searchType,
  239. searchKeyWord: this.searchKeyWord,
  240. startDate: this.startDate,
  241. endDate: this.endDate,
  242. contrPage: this.contrPage,
  243. })
  244. .toPromise()
  245. .then((response) => {
  246. for (var i = 0; i < response.records.length; i++) {
  247. if (response.records[i].addressUrl != null) {
  248. response.records[i].addressUrlArray = response.records[
  249. i
  250. ].addressUrl.split(',')
  251. } else {
  252. response.records[i].addressUrlArray = []
  253. }
  254. }
  255. this.deptCircularPage.currentPage = response.current
  256. this.deptCircularPage.pageSize = response.size
  257. this.deptBudgetTotal = response.total
  258. this.contractList = response
  259. })
  260. },
  261. selecttaskType(e) {
  262. for (var i = 0; i < this.taskTypeList.length; i++) {
  263. if (this.taskTypeList[i].value == e) {
  264. this.searchType = this.taskTypeList[i].type
  265. }
  266. }
  267. },
  268. fujian(row) {
  269. if (
  270. row.receiveAttachmentPath === null ||
  271. row.receiveAttachmentPath === ''
  272. ) {
  273. EventBus.$emit(
  274. 'warning',
  275. this.$t('system.noticeCircular.NoInformation')
  276. )
  277. } else {
  278. this.accessoryTFs = true
  279. }
  280. this.appendixIdss = row.receiveAttachmentPath
  281. },
  282. handleExamine(row) {
  283. this.$router.push({
  284. name: 'salesContractExamine',
  285. query: { id: row.id },
  286. })
  287. },
  288. // 关闭 dialog时 处理文件url 初始化upload组件
  289. handleCloe() {
  290. this.dialogViewSpareMoney = false
  291. },
  292. history(row) {
  293. console.log(row)
  294. billoperatehis({ id: row.id })
  295. .toPromise()
  296. .then((response) => {
  297. this.historyList = response
  298. })
  299. },
  300. find() {
  301. this.startDate = this.dateFormat('YYYY-mm-dd', this.value2[0])
  302. this.endDate = this.dateFormat('YYYY-mm-dd', this.value2[1])
  303. this.currentPage = 1
  304. this.getList()
  305. },
  306. async exportlist() {
  307. const { data } = await export1(
  308. {
  309. compId: sessionStorage.getItem('ws-pf_compId'),
  310. contractType: this.contractType,
  311. currentPage: this.currentPage,
  312. pageSize: this.pageSize,
  313. searchType: this.searchType,
  314. searchKeyWord: this.searchKeyWord,
  315. startDate: this.startDate,
  316. endDate: this.endDate,
  317. },
  318. {},
  319. { responseType: 'blob' }
  320. ).toPromise()
  321. downloadFile({
  322. res: data,
  323. fileName: `${
  324. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  325. }_采购合同`,
  326. type: 'xls',
  327. })
  328. },
  329. // deletecontract(){},
  330. //删除
  331. approve() {},
  332. listQuery() {},
  333. total() {},
  334. clearfiltQuery() {},
  335. selectCrtDuty() {},
  336. },
  337. }
  338. </script>
  339. <style lang="scss" scoped>
  340. .center {
  341. position: relative;
  342. margin-top: 100px;
  343. top: 100px;
  344. width: 40%;
  345. height: 700px;
  346. margin: 0 auto;
  347. }
  348. /deep/.el-form-item__label {
  349. width: 160px;
  350. }
  351. /deep/.el-input--small{
  352. width: 70%;
  353. }
  354. .container .bg-bottom {
  355. position: absolute;
  356. float: right;
  357. top: 15px;
  358. right: 20px;
  359. }
  360. </style>