tranManagementWarehouseInOutTask.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. <!--出入库任务-->
  2. <template>
  3. <div>
  4. <BaseHeaderLayout :leftSpan="20">
  5. <template slot="right">
  6. <ws-button class="but" type="primary" @click="handleAdd()"
  7. >添加</ws-button
  8. >
  9. </template>
  10. <template slot="left">
  11. <ws-button class="but" type="primary" @click="handlestatus(1)">
  12. 执行中</ws-button
  13. >
  14. <ws-button class="but" @click="handlestatus(2)">已完成</ws-button>
  15. <ws-button class="but" @click="handlestatus('')">全部任务</ws-button>
  16. </template>
  17. <template slot="left">
  18. <ws-input
  19. v-model="warehouseName"
  20. placeholder="可按合同编号或任务编号查找"
  21. clearable
  22. maxlength="500"
  23. type="input"
  24. class="findValue"
  25. ></ws-input>
  26. <!-- v-hasPermission="'procurement.sparepart.directShip'" -->
  27. <div class="search">
  28. <ws-button class="find" type="primary" @click="lookUp()"
  29. ><img
  30. width="16"
  31. height="16"
  32. style="
  33. vertical-align: text-top;
  34. position: relative;
  35. top: 0px;
  36. left: -1px;
  37. "
  38. src="../../../public/img/sousuo.png"
  39. alt=""
  40. /></ws-button>
  41. </div>
  42. </template>
  43. </BaseHeaderLayout>
  44. <div>
  45. <el-table
  46. class="wenzi"
  47. :data="gainList.records"
  48. style="width: 100%; margin-top: 20px"
  49. height="780"
  50. >
  51. <el-table-column type="index" label="序号">
  52. <template scope="scope">
  53. <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
  54. <span v-else>{{ scope.$index + 1 }}</span>
  55. </template>
  56. </el-table-column>
  57. <el-table-column prop="contractNo" label="合同编号" width="80">
  58. </el-table-column>
  59. <el-table-column prop="taskNo" label="任务编号"> </el-table-column>
  60. <el-table-column prop=" warehouseName" class="table_td" label="库房名">
  61. </el-table-column>
  62. <el-table-column prop="inOutType" class="table_td" label="出入库类型">
  63. </el-table-column>
  64. <el-table-column prop="goodsName" class="table_td" label="货名">
  65. </el-table-column>
  66. <el-table-column prop=" weight" class="table_td" label="重量(吨)">
  67. </el-table-column>
  68. <el-table-column prop="yujiDate" class="table_td" label="预计日期">
  69. </el-table-column>
  70. <el-table-column prop="publisher" class="table_td" label="发布者">
  71. </el-table-column>
  72. <el-table-column prop="status" label="状态">
  73. <template slot-scope="scope">
  74. <el-popover
  75. placement="left"
  76. :width="285"
  77. trigger="click"
  78. visible-arrow="false"
  79. @show="history(scope.row)"
  80. >
  81. <template>
  82. <span slot="reference">
  83. <span
  84. v-if="scope.row.status == '待审核'"
  85. class="executory"
  86. ></span>
  87. <span
  88. v-if="scope.row.status == '执行中'"
  89. class="inExecution"
  90. ></span>
  91. <span v-if="scope.row.status == '已完成'" class="done"></span
  92. >{{ scope.row.status }}
  93. </span>
  94. </template>
  95. <div>
  96. <p style="margin-top: 0; padding-left: 10px">操作历史</p>
  97. <div v-for="(item, index) in historyList" class="flex">
  98. <div class="vertical-text vertical-text-left">
  99. {{ item.updateDate }}
  100. </div>
  101. <div>
  102. <div class="vertical-circle"></div>
  103. <div
  104. v-if="index != historyList.length - 1"
  105. class="vertical-line"
  106. ></div>
  107. </div>
  108. <div class="vertical-text">
  109. {{ item.operateUser }}<br />{{ item.dealMsg }}
  110. </div>
  111. </div>
  112. </div>
  113. </el-popover>
  114. <img
  115. width="17"
  116. height="18"
  117. style="vertical-align: text-top; position: relative; top: -1px"
  118. src="../../../public/img/edit.png"
  119. @click="editClick(scope.row)"
  120. alt=""
  121. />
  122. </template>
  123. </el-table-column>
  124. <el-table-column prop="createDate" class="table_td" label="创建时间">
  125. </el-table-column>
  126. <el-table-column prop="seller" label="操作" width="300">
  127. <template slot-scope="scope">
  128. <ws-button class="completed" @click="nocomplete(scope.row)">
  129. 查看
  130. </ws-button>
  131. <ws-button class="putstorage" @click="delivery(scope.row)">
  132. 编辑
  133. </ws-button>
  134. <ws-button @click="deleteclick(scope.row)"> 删除 </ws-button>
  135. </template>
  136. </el-table-column>
  137. </el-table>
  138. </div>
  139. </div>
  140. </template>
  141. <script>
  142. import { gain, deltran } from '@/model/tasksport/index'
  143. import { downloadFile } from '@/utils/batchDown'
  144. import Pagination from '@/components/Pagination'
  145. import WsUpload from '@/components/WsUpload'
  146. import { dayjs, fmoney, EventBus } from 'base-core-lib'
  147. export default {
  148. name: 'viewSpareMoney',
  149. components: {
  150. WsUpload,
  151. Pagination,
  152. },
  153. watch: {
  154. vesselId(val) {
  155. this.getList()
  156. },
  157. isShow(val) {
  158. this.showType = val
  159. },
  160. },
  161. data() {
  162. return {
  163. //弹出框
  164. dialogViewSpareMoney: false,
  165. dialogApproveFormVisible: false,
  166. // 船舶类型
  167. monetaryKey: null,
  168. // 表格显示数据
  169. tableDate: [],
  170. // 是否显示
  171. showType: true,
  172. // 年
  173. year: '',
  174. gainList: [],
  175. currentPage: 1,
  176. pageSize: 10,
  177. searchType: 1,
  178. searchTypeText: '未完成',
  179. searchKeyWord: '',
  180. contractType: 2,
  181. // 提交类型
  182. submitType: true,
  183. size: 10,
  184. spanArr: [],
  185. warehouseName: '',
  186. compId: sessionStorage.getItem('ws-pf_compId'),
  187. deptCircularPage: {},
  188. historyList: [],
  189. pickerBeginDateBefore: {
  190. disabledDate: (time) => {
  191. return time.getTime() > Date.now()
  192. },
  193. },
  194. accessoryTFs: false,
  195. }
  196. },
  197. activated() {
  198. this.getList()
  199. this.showType = this.isShow
  200. },
  201. methods: {
  202. //添加
  203. add() {
  204. this.$router.push({ path: 'tranManagementWarehouseInOutTaskAdd' })
  205. },
  206. //查找
  207. lookUp() {
  208. this.currentPage = 1
  209. this.getList()
  210. },
  211. deleteclick(row) {
  212. //cancelButtonClass: "btn-custom-cancel"
  213. this.$confirm(`运输任务删除后不可恢复,是否确定删除?`, {
  214. confirmButtonText: '确定',
  215. cancelButtonText: '取消',
  216. type: 'warning',
  217. })
  218. .then(() => {
  219. console.log(row)
  220. deltran({
  221. id: row.id,
  222. })
  223. .toPromise()
  224. .then((response) => {
  225. this.getList()
  226. })
  227. })
  228. .catch(() => {
  229. return false
  230. })
  231. },
  232. getList() {
  233. gain({
  234. compId: sessionStorage.getItem('ws-pf_compId'),
  235. currentPage: this.currentPage,
  236. pageSize: this.pageSize,
  237. searchType: this.searchType,
  238. searchKeyWord: this.searchKeyWord,
  239. })
  240. .toPromise()
  241. .then((response) => {
  242. this.gainList = response
  243. })
  244. },
  245. handlestatus(status) {
  246. this.searchType = status
  247. this.getList()
  248. },
  249. //编辑
  250. delivery(item) {
  251. this.$router.push({
  252. path: 'tranManagementWarehouseInOutTaskEdit',
  253. query: {
  254. id: item.id,
  255. },
  256. })
  257. },
  258. //查看
  259. warehousing(item) {
  260. var free = 0
  261. for (var i = 0; i < item.warehouseNumViewList.length; i++) {
  262. free += Number(item.warehouseNumViewList[i].storage)
  263. }
  264. this.$router.push({
  265. path: 'tranManagementWarehouseInOutTaskLook',
  266. query: {
  267. baseId: item.warehouseId,
  268. positionId: item.binNumberId,
  269. warehouseName: item.warehouseName,
  270. binNumber: item.binNumber,
  271. capacity: item.capacity - free,
  272. },
  273. })
  274. },
  275. getSpanArr(data) {
  276. let that = this
  277. //页面展示的数据,不一定是全部的数据,所以每次都清空之前存储的 保证遍历的数据是最新的数据。以免造成数据渲染混乱
  278. that.spanArr = []
  279. that.pos = 0
  280. //遍历数据
  281. data.forEach((item, index) => {
  282. //判断是否是第一项
  283. // if (index === 0) {
  284. // this.spanArr.push(1)
  285. // this.pos = 0
  286. // } else {
  287. //不是第一项时,就根据标识去存储
  288. if (data[index].warehouseNumViewList.length > 1) {
  289. // 查找到符合条件的数据时每次要把之前存储的数据+1
  290. this.spanArr[this.pos] = data[index].warehouseNumViewList.length
  291. this.spanArr.push(0)
  292. } else {
  293. // 没有符合的数据时,要记住当前的index
  294. this.spanArr.push(1)
  295. this.pos = index
  296. }
  297. // }
  298. })
  299. },
  300. //查看//传参
  301. nocomplete(row) {
  302. this.$router.push({
  303. path: 'tranManagementLook',
  304. query: {
  305. id: row.id,
  306. },
  307. })
  308. },
  309. //查看
  310. handleLook() {
  311. this.$router.push({ path: 'tranManagementWarehouseInOutTaskLook' })
  312. },
  313. //添加
  314. handleAdd() {
  315. this.$router.push({ path: 'tranManagementWarehouseInOutTaskAdd' })
  316. },
  317. //编辑
  318. handleEdit() {
  319. this.$router.push({ path: 'tranManagementWarehouseInOutTaskEdit' })
  320. },
  321. dateFormat(fmt, date) {
  322. let ret
  323. const opt = {
  324. 'Y+': date.getFullYear().toString(), // 年
  325. 'm+': (date.getMonth() + 1).toString(), // 月
  326. 'd+': date.getDate().toString(), // 日
  327. 'H+': date.getHours().toString(), // 时
  328. // "M+": date.getMinutes().toString(), // 分
  329. // "S+": date.getSeconds().toString() // 秒
  330. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  331. }
  332. for (let k in opt) {
  333. ret = new RegExp('(' + k + ')').exec(fmt)
  334. if (ret) {
  335. fmt = fmt.replace(
  336. ret[1],
  337. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  338. )
  339. }
  340. }
  341. return fmt
  342. },
  343. handleClose() {
  344. this.accessoryTFs = false
  345. },
  346. handleSizeChange(val) {
  347. console.log(`每页 ${val} 条`)
  348. this.pageSize = val
  349. this.getList()
  350. },
  351. handleCurrentChange(val) {
  352. this.currentPage = val
  353. console.log(`当前页: ${val}`)
  354. this.getList()
  355. },
  356. editClick(row) {
  357. var status = ''
  358. if (row.status == '待审核' || row.status == '已完成') {
  359. status = '执行中'
  360. } else if (row.status == '执行中') {
  361. status = '已完成'
  362. }
  363. //cancelButtonClass: "btn-custom-cancel"
  364. this.$confirm(`是否将状态改为${status}`, {
  365. confirmButtonText: '确定',
  366. cancelButtonText: '取消',
  367. type: 'warning',
  368. })
  369. .then(() => {
  370. editstatus({ id: row.id })
  371. .toPromise()
  372. .then((response) => {
  373. this.$notify.success({
  374. title: '成功',
  375. message: '状态修改成功',
  376. })
  377. this.getList()
  378. })
  379. .catch((response) => {
  380. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  381. })
  382. })
  383. .catch(() => {
  384. return false
  385. })
  386. },
  387. selecttaskType(e) {
  388. for (var i = 0; i < this.taskTypeList.length; i++) {
  389. if (this.taskTypeList[i].value == e) {
  390. this.searchType = this.taskTypeList[i].type
  391. }
  392. }
  393. },
  394. handleExamine(row) {
  395. this.$router.push({
  396. name: 'salesContractExamine',
  397. query: { id: row.id },
  398. })
  399. },
  400. // 关闭 dialog时 处理文件url 初始化upload组件
  401. handleCloe() {
  402. this.dialogViewSpareMoney = false
  403. },
  404. history(row) {
  405. billoperatehis({ id: row.id })
  406. .toPromise()
  407. .then((response) => {
  408. this.historyList = response
  409. })
  410. },
  411. find() {
  412. this.currentPage = 1
  413. this.getList()
  414. },
  415. async exportlist() {
  416. const { data } = await export1(
  417. {
  418. compId: sessionStorage.getItem('ws-pf_compId'),
  419. contractType: this.contractType,
  420. currentPage: this.currentPage,
  421. pageSize: this.pageSize,
  422. searchType: this.searchType,
  423. searchKeyWord: this.searchKeyWord,
  424. startDate: this.startDate,
  425. endDate: this.endDate,
  426. },
  427. {},
  428. { responseType: 'blob' }
  429. ).toPromise()
  430. downloadFile({
  431. res: data,
  432. fileName: `${
  433. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  434. }_采购合同`,
  435. type: 'xls',
  436. })
  437. },
  438. },
  439. }
  440. </script>
  441. <style lang="scss" scoped>
  442. .connert {
  443. width: 90%;
  444. margin: 0 auto;
  445. }
  446. .vertical-text-left {
  447. width: 62px;
  448. text-align: right;
  449. }
  450. .el-button--primary {
  451. background-color: #5878e8;
  452. border-color: #5878e8;
  453. }
  454. .el-button--default {
  455. color: #8890b1;
  456. border-color: #e8eaf1;
  457. }
  458. /deep/.base_header_layout .grid-content.right .find.el-button--primary {
  459. width: 30px;
  460. margin-left: 0;
  461. border-top-left-radius: 0px;
  462. border-bottom-left-radius: 0px;
  463. }
  464. /deep/.findValue .el-input__inner {
  465. border-top-right-radius: 0px;
  466. border-bottom-right-radius: 0px;
  467. }
  468. .completed.el-button--default {
  469. border-color: #5878e8;
  470. background-color: #f6f7fc;
  471. color: #5878e8;
  472. }
  473. .putstorage.el-button--default,
  474. .deliverystorage.el-button--default {
  475. border-color: #8890b1;
  476. background-color: #fff;
  477. color: #8890b1;
  478. }
  479. /deep/.el-table td,
  480. /deep/.el-table th.is-leaf {
  481. border-right: 1px solid #e9ecf7;
  482. text-align: center;
  483. }
  484. /deep/.el-table tr td:first-child,
  485. /deep/.el-table tr th.is-leaf:first-child {
  486. border-left: 1px solid #e9ecf7;
  487. }
  488. .record,
  489. .adjustment {
  490. display: inline-block;
  491. color: #5878e8;
  492. padding: 0 4px !important;
  493. position: relative;
  494. }
  495. .record:after {
  496. position: absolute;
  497. content: '';
  498. display: block;
  499. top: 5px;
  500. right: -2px;
  501. width: 1px;
  502. height: 12px;
  503. background: #e9ecf7;
  504. }
  505. .el-row {
  506. height: 150px;
  507. }
  508. .base_header_layout .grid-content {
  509. margin-top: 80px;
  510. }
  511. .but {
  512. margin-top: 150px;
  513. }
  514. .findValue {
  515. width: 0%;
  516. margin-left: 25%;
  517. }
  518. /deep/.el-input--small .el-input__inner {
  519. margin-left: -550px;
  520. width: 300px;
  521. }
  522. .search {
  523. margin-left: -250px;
  524. }
  525. </style>