moveWarehouseTask.vue 13 KB

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