warehouseManagementList.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. <!--仓库管理-->
  2. <template>
  3. <div>
  4. <BaseHeaderLayout :leftSpan="20">
  5. <template slot="left">
  6. <ws-button
  7. type="primary"
  8. @click="handleLook()"
  9. v-hasPermission="
  10. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  11. "
  12. >查看</ws-button
  13. >
  14. <ws-button
  15. type="primary"
  16. @click="handleAdd()"
  17. v-hasPermission="
  18. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  19. "
  20. >添加</ws-button
  21. >
  22. <ws-button
  23. type="primary"
  24. @click="handleEdit()"
  25. v-hasPermission="
  26. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  27. "
  28. >编辑</ws-button
  29. >
  30. <ws-button
  31. type="primary"
  32. @click="handleDelete()"
  33. v-hasPermission="
  34. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  35. "
  36. >删除</ws-button
  37. >
  38. </template>
  39. <template slot="right">
  40. <ws-input
  41. v-model="searchKeyWord"
  42. placeholder="请输入仓库名"
  43. clearable
  44. maxlength="500"
  45. type="input"
  46. class="findValue"
  47. ></ws-input>
  48. <!-- v-hasPermission="'procurement.sparepart.directShip'" -->
  49. <ws-button
  50. class="find"
  51. type="primary"
  52. @click="find()"
  53. v-hasPermission="
  54. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  55. "
  56. ><img
  57. width="16"
  58. height="16"
  59. style="
  60. vertical-align: text-top;
  61. position: relative;
  62. top: 0px;
  63. left: -8px;
  64. "
  65. src="../../../public/img/sousuo.png"
  66. alt=""
  67. /></ws-button>
  68. </template>
  69. </BaseHeaderLayout>
  70. <div class="connert">
  71. <el-table
  72. class="wenzi"
  73. :data="contractList.records"
  74. style="width: 100%; margin-top: 20px"
  75. height="780"
  76. >
  77. <el-table-column prop="contractNo" label="仓库名" width="80">
  78. </el-table-column>
  79. <el-table-column prop="goodsName" label="仓库编号" width="80">
  80. </el-table-column>
  81. <el-table-column prop="weight" label="容量(吨)"> </el-table-column>
  82. <el-table-column prop="unitContractPrice" label="入库量(吨)">
  83. </el-table-column>
  84. <el-table-column prop="packingMethod" label="出库量(吨)">
  85. </el-table-column>
  86. <el-table-column prop="buyer" label="应余量(吨)"> </el-table-column>
  87. <el-table-column prop="seller" label="出入库" width="160">
  88. <button
  89. type="primary"
  90. @click="nocomplete()"
  91. v-hasPermission="
  92. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  93. "
  94. >
  95. 待完成
  96. </button>
  97. <button
  98. type="primary"
  99. @click="delivery()"
  100. v-hasPermission="
  101. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  102. "
  103. >
  104. 出库
  105. </button>
  106. <button
  107. type="primary"
  108. @click="warehousing()"
  109. v-hasPermission="
  110. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  111. "
  112. >
  113. 入库
  114. </button>
  115. </el-table-column>
  116. <el-table-column prop="address" label="操作" width="200">
  117. <!-- <template slot-scope="scope"> -->
  118. <ws-button
  119. type="primary"
  120. @click="record()"
  121. v-hasPermission="
  122. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  123. "
  124. >记录</ws-button
  125. >
  126. <ws-button
  127. type="primary"
  128. @click="loss()"
  129. v-hasPermission="
  130. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  131. "
  132. >盘损</ws-button
  133. >
  134. <!-- </template> -->
  135. </el-table-column>
  136. </el-table>
  137. </div>
  138. </div>
  139. </template>
  140. <script>
  141. import {
  142. getList,
  143. export1,
  144. editstatus,
  145. billoperatehis,
  146. } from '@/model/warehouse/index'
  147. import { downloadFile } from '@/utils/batchDown'
  148. import Pagination from '@/components/Pagination'
  149. import WsUpload from '@/components/WsUpload'
  150. import { dayjs, fmoney, EventBus } from 'base-core-lib'
  151. export default {
  152. name: 'viewSpareMoney',
  153. components: {
  154. WsUpload,
  155. Pagination,
  156. },
  157. watch: {
  158. vesselId(val) {
  159. this.getList()
  160. },
  161. isShow(val) {
  162. this.showType = val
  163. },
  164. },
  165. data() {
  166. return {
  167. //弹出框
  168. dialogViewSpareMoney: false,
  169. dialogApproveFormVisible: false,
  170. // 船舶类型
  171. monetaryKey: null,
  172. // 表格显示数据
  173. tableDate: [],
  174. // 是否显示
  175. showType: true,
  176. // 年
  177. year: '',
  178. currentPage: 1,
  179. pageSize: 10,
  180. searchType: 1,
  181. searchTypeText: '未完成',
  182. searchKeyWord: '',
  183. contractType: 2,
  184. startDate: null,
  185. endDate: null,
  186. // 提交类型
  187. submitType: true,
  188. size: 10,
  189. compId: sessionStorage.getItem('ws-pf_compId'),
  190. deptCircularPage: {},
  191. date: {
  192. year: dayjs().format('YYYY'),
  193. month: dayjs().format('MM'),
  194. },
  195. contractList: [],
  196. deptBudgetList: {},
  197. historyList: [],
  198. pickerBeginDateBefore: {
  199. disabledDate: (time) => {
  200. return time.getTime() > Date.now()
  201. },
  202. },
  203. accessoryTFs: false,
  204. }
  205. },
  206. activated() {
  207. //cg.viewBudget
  208. //cg.viewSpareMoney
  209. // this.getVesselData();
  210. this.getList()
  211. this.showType = this.isShow
  212. },
  213. methods: {
  214. //出库
  215. delivery() {
  216. this.$router.push({ path: 'warehouseManagementDelivery' })
  217. },
  218. //入库
  219. warehousing() {
  220. this.$router.push({ path: 'warehouseManagementPut' })
  221. },
  222. //待完成
  223. nocomplete() {
  224. this.$router.push({ path: 'warehouseManagementNoComplete' })
  225. },
  226. //记录
  227. record() {
  228. this.$router.push({ path: 'warehouseManagementRecord' })
  229. },
  230. //盘损
  231. loss() {
  232. this.$router.push({ path: 'warehouseManagementIoss' })
  233. },
  234. //查看
  235. handleLook() {
  236. this.$router.push({ path: 'warehouseManagementLook' })
  237. },
  238. //添加
  239. handleAdd() {
  240. this.$router.push({ path: 'warehouseManagementAdd' })
  241. },
  242. //编辑
  243. handleEdit() {
  244. this.$router.push({ path: 'warehouseManagementEdit' })
  245. },
  246. handleDelete() {
  247. this.$router.push({ path: 'warehouseManagementDelete' })
  248. },
  249. dateFormat(fmt, date) {
  250. let ret
  251. const opt = {
  252. 'Y+': date.getFullYear().toString(), // 年
  253. 'm+': (date.getMonth() + 1).toString(), // 月
  254. 'd+': date.getDate().toString(), // 日
  255. 'H+': date.getHours().toString(), // 时
  256. // "M+": date.getMinutes().toString(), // 分
  257. // "S+": date.getSeconds().toString() // 秒
  258. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  259. }
  260. for (let k in opt) {
  261. ret = new RegExp('(' + k + ')').exec(fmt)
  262. if (ret) {
  263. fmt = fmt.replace(
  264. ret[1],
  265. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  266. )
  267. }
  268. }
  269. return fmt
  270. },
  271. handleClose() {
  272. this.accessoryTFs = false
  273. },
  274. handleSizeChange(val) {
  275. console.log(`每页 ${val} 条`)
  276. this.pageSize = val
  277. this.getList()
  278. },
  279. handleCurrentChange(val) {
  280. this.currentPage = val
  281. console.log(`当前页: ${val}`)
  282. this.getList()
  283. },
  284. getList() {
  285. getList({
  286. compId: sessionStorage.getItem('ws-pf_compId'),
  287. contractType: this.contractType,
  288. currentPage: this.currentPage,
  289. pageSize: this.pageSize,
  290. searchType: this.searchType,
  291. searchKeyWord: this.searchKeyWord,
  292. startDate: this.startDate,
  293. endDate: this.endDate,
  294. contrPage: this.contrPage,
  295. })
  296. .toPromise()
  297. .then((response) => {
  298. for (var i = 0; i < response.records.length; i++) {
  299. if (response.records[i].addressUrl != null) {
  300. response.records[i].addressUrlArray = response.records[
  301. i
  302. ].addressUrl.split(',')
  303. } else {
  304. response.records[i].addressUrlArray = []
  305. }
  306. }
  307. this.deptCircularPage.currentPage = response.current
  308. this.deptCircularPage.pageSize = response.size
  309. this.deptBudgetTotal = response.total
  310. this.contractList = response
  311. })
  312. },
  313. editClick(row) {
  314. var status = ''
  315. if (row.status == '待执行' || row.status == '已完成') {
  316. status = '执行中'
  317. } else if (row.status == '执行中') {
  318. status = '已完成'
  319. }
  320. //cancelButtonClass: "btn-custom-cancel"
  321. this.$confirm(`是否将状态改为${status}`, {
  322. confirmButtonText: '确定',
  323. cancelButtonText: '取消',
  324. type: 'warning',
  325. })
  326. .then(() => {
  327. editstatus({ id: row.id })
  328. .toPromise()
  329. .then((response) => {
  330. this.$notify.success({
  331. title: '成功',
  332. message: '状态修改成功',
  333. })
  334. this.getList()
  335. })
  336. .catch((response) => {
  337. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  338. })
  339. })
  340. .catch(() => {
  341. return false
  342. })
  343. },
  344. selecttaskType(e) {
  345. for (var i = 0; i < this.taskTypeList.length; i++) {
  346. if (this.taskTypeList[i].value == e) {
  347. this.searchType = this.taskTypeList[i].type
  348. }
  349. }
  350. },
  351. fujian(row) {
  352. if (
  353. row.receiveAttachmentPath === null ||
  354. row.receiveAttachmentPath === ''
  355. ) {
  356. EventBus.$emit(
  357. 'warning',
  358. this.$t('system.noticeCircular.NoInformation')
  359. )
  360. } else {
  361. this.accessoryTFs = true
  362. }
  363. this.appendixIdss = row.receiveAttachmentPath
  364. },
  365. handleExamine(row) {
  366. this.$router.push({
  367. name: 'salesContractExamine',
  368. query: { id: row.id },
  369. })
  370. },
  371. // 关闭 dialog时 处理文件url 初始化upload组件
  372. handleCloe() {
  373. this.dialogViewSpareMoney = false
  374. },
  375. history(row) {
  376. console.log(row)
  377. billoperatehis({ id: row.id })
  378. .toPromise()
  379. .then((response) => {
  380. this.historyList = response
  381. })
  382. },
  383. find() {
  384. this.startDate = this.dateFormat('YYYY-mm-dd', this.value2[0])
  385. this.endDate = this.dateFormat('YYYY-mm-dd', this.value2[1])
  386. this.currentPage = 1
  387. this.getList()
  388. },
  389. async exportlist() {
  390. const { data } = await export1(
  391. {
  392. compId: sessionStorage.getItem('ws-pf_compId'),
  393. contractType: this.contractType,
  394. currentPage: this.currentPage,
  395. pageSize: this.pageSize,
  396. searchType: this.searchType,
  397. searchKeyWord: this.searchKeyWord,
  398. startDate: this.startDate,
  399. endDate: this.endDate,
  400. },
  401. {},
  402. { responseType: 'blob' }
  403. ).toPromise()
  404. downloadFile({
  405. res: data,
  406. fileName: `${
  407. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  408. }_采购合同`,
  409. type: 'xls',
  410. })
  411. },
  412. },
  413. }
  414. </script>
  415. <style lang="scss" scoped>
  416. .connert {
  417. width: 90%;
  418. margin: 0 auto;
  419. }
  420. .vertical-text-left {
  421. width: 62px;
  422. text-align: right;
  423. }
  424. </style>