warehouseManagementDelete.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. //删除仓库
  2. <template>
  3. <div class="homepage">
  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="returnWarehouse()"
  14. ><img
  15. width="6"
  16. height="10"
  17. style="vertical-align: bottom; margin-right: 3px"
  18. src="../../../public/img/lujing.png"
  19. alt=""
  20. />返回</el-button
  21. >
  22. </el-col>
  23. </el-row>
  24. <div class="connert">
  25. <el-table
  26. class="wenzi"
  27. :data="warehouseList"
  28. style="width: 100%; margin-top: 20px"
  29. height="780"
  30. >
  31. <el-table-column type="index" label="序号">
  32. <template scope="scope">
  33. <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
  34. <span v-else>{{ scope.$index + 1 }}</span>
  35. </template>
  36. </el-table-column>
  37. <el-table-column prop="warehouseName" label="仓库名称">
  38. </el-table-column>
  39. <el-table-column prop="warehouseCity" label="仓库所在地">
  40. </el-table-column>
  41. <el-table-column prop="residual" label="应余库存(吨)">
  42. </el-table-column>
  43. <el-table-column prop="personCharge" label="负责人"> </el-table-column>
  44. <el-table-column prop="address" label="操作" width="200">
  45. <template slot-scope="scope">
  46. <div
  47. class="record"
  48. v-if="scope.row.showFlag == 0"
  49. @click="handleHide(scope.row)"
  50. >
  51. 显示
  52. </div>
  53. <div
  54. class="record"
  55. v-if="scope.row.showFlag == 1"
  56. @click="handleHide(scope.row)"
  57. >
  58. 隐藏
  59. </div>
  60. <div class="adjustment" @click="handleDelete(scope.row)">删除</div>
  61. </template>
  62. </el-table-column>
  63. </el-table>
  64. </div>
  65. </div>
  66. </template>
  67. <script>
  68. import {
  69. delectlist,
  70. deletewarehouse,
  71. hide,
  72. } from '@/model/warehouse/index'
  73. import { downloadFile } from '@/utils/batchDown'
  74. import Pagination from '@/components/Pagination'
  75. import WsUpload from '@/components/WsUpload'
  76. import { dayjs, fmoney, EventBus } from 'base-core-lib'
  77. export default {
  78. name: 'viewSpareMoney',
  79. components: {
  80. WsUpload,
  81. Pagination,
  82. },
  83. watch: {
  84. vesselId(val) {
  85. this.getList()
  86. },
  87. isShow(val) {
  88. this.showType = val
  89. },
  90. },
  91. data() {
  92. return {
  93. isshow: false,
  94. //弹出框
  95. dialogViewSpareMoney: false,
  96. dialogApproveFormVisible: false,
  97. // 船舶类型
  98. monetaryKey: null,
  99. // 表格显示数据
  100. tableDate: [],
  101. // 是否显示
  102. showType: true,
  103. // 年
  104. year: '',
  105. deptBudgetTotal: 0,
  106. currentPage: 1,
  107. pageSize: 10,
  108. searchType: 1,
  109. searchKeyWord: '',
  110. contractType: 2,
  111. startDate: null,
  112. endDate: null,
  113. warehouseList: [],
  114. scope: [],
  115. show: '隐藏',
  116. // 提交类型
  117. submitType: true,
  118. size: 10,
  119. compId: sessionStorage.getItem('ws-pf_compId'),
  120. deptCircularPage: {},
  121. date: {
  122. year: dayjs().format('YYYY'),
  123. month: dayjs().format('MM'),
  124. },
  125. contractList: [],
  126. deptBudgetList: {},
  127. historyList: [],
  128. pickerBeginDateBefore: {
  129. disabledDate: (time) => {
  130. return time.getTime() > Date.now()
  131. },
  132. },
  133. accessoryTFs: false,
  134. }
  135. },
  136. activated() {
  137. this.getList()
  138. this.showType = this.isShow
  139. },
  140. methods: {
  141. returnWarehouse() {
  142. this.$router.push({ path: 'warehouseManagementList' })
  143. },
  144. //列表
  145. getList() {
  146. delectlist({
  147. compId: sessionStorage.getItem('ws-pf_compId'),
  148. })
  149. .toPromise()
  150. .then((response) => {
  151. this.warehouseList = response
  152. })
  153. },
  154. handleExamine(row) {
  155. this.$router.push({
  156. name: 'salesContractExamine',
  157. query: { id: row.id },
  158. })
  159. },
  160. // 关闭 dialog时 处理文件url 初始化upload组件
  161. handleCloe() {
  162. this.dialogViewSpareMoney = false
  163. },
  164. //删除
  165. handleDelete(row) {
  166. if(row.residual == 0){
  167. // console.log(row)
  168. this.$confirm(`此操作永久删除该仓库全部信息,是否确认删除`, {
  169. cancelButtonText: '取消',
  170. confirmButtonText: '确定',
  171. type: 'warning',
  172. })
  173. .then(() => {
  174. deletewarehouse({ id: row.id })
  175. .toPromise()
  176. .then((response) => {
  177. this.$notify.success({
  178. title: '成功',
  179. message: '删除成功',
  180. })
  181. this.getList()
  182. })
  183. .catch((response) => {
  184. // console.log(3333)
  185. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  186. })
  187. })
  188. .catch(() => {
  189. return false
  190. })
  191. }else{
  192. this.$message({
  193. message: '还有应余库存,不能删除此仓库!',
  194. type: 'warning',
  195. })
  196. return
  197. }
  198. },
  199. //隐藏
  200. handleHide(row) {
  201. if (row.showFlag == 1) {
  202. this.$confirm(`隐藏后将对其他用户不可见,是否确认隐藏`, {
  203. cancelButtonText: '取消',
  204. confirmButtonText: '确定',
  205. type: 'warning',
  206. })
  207. .then(() => {
  208. hide({ id: row.id })
  209. .toPromise()
  210. .then((response) => {
  211. this.$notify.success({
  212. title: '成功',
  213. message: '隐藏成功',
  214. })
  215. this.getList()
  216. })
  217. .catch((response) => {
  218. // console.log(3333)
  219. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  220. })
  221. })
  222. .catch(() => {
  223. return false
  224. })
  225. } else {
  226. hide({ id: row.id })
  227. .toPromise()
  228. .then((response) => {
  229. this.$notify.success({
  230. title: '成功',
  231. message: '显示成功',
  232. })
  233. this.getList()
  234. })
  235. .catch((response) => {
  236. // console.log(3333)
  237. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  238. })
  239. }
  240. },
  241. },
  242. // deletecontract(){},
  243. //删除
  244. approve() {},
  245. listQuery() {},
  246. total() {},
  247. clearfiltQuery() {},
  248. selectCrtDuty() {},
  249. delectlist() {},
  250. deletewarehouse() {},
  251. }
  252. </script>
  253. <style lang="scss" scoped>
  254. /deep/.totalStorage .el-input__inner {
  255. color: #afb5cb;
  256. background: #f5f7fa;
  257. }
  258. .add,
  259. .del {
  260. position: absolute;
  261. right: -38px;
  262. top: 9px;
  263. cursor: pointer;
  264. }
  265. .del {
  266. right: -70px;
  267. }
  268. .amap-page-container {
  269. width: 300px;
  270. height: 300px;
  271. }
  272. .el-form {
  273. padding: 0 15%;
  274. }
  275. .readonly {
  276. position: relative;
  277. }
  278. .readonly:after {
  279. content: '*';
  280. color: #ff2727;
  281. position: absolute;
  282. right: 8px;
  283. z-index: 10;
  284. top: 21%;
  285. font-size: 20px;
  286. }
  287. .title {
  288. position: relative;
  289. }
  290. .title::before {
  291. content: '';
  292. display: inline-block;
  293. width: 5px;
  294. height: 30px;
  295. background: #5473e8;
  296. position: absolute;
  297. left: 0;
  298. }
  299. .ws-info-table {
  300. border-left: 1px solid transparent;
  301. border-top: 1px solid transparent;
  302. }
  303. .el-button--primary {
  304. background-color: #5878e8;
  305. border-color: #5878e8;
  306. }
  307. .el-col {
  308. background: #f6f7fc;
  309. }
  310. /deep/.el-table .el-table__header .cell,
  311. /deep/.el-table .el-table__body .cell {
  312. text-align: center;
  313. }
  314. .button-container {
  315. display: flex;
  316. flex-wrap: nowrap;
  317. justify-content: space-between;
  318. align-items: center;
  319. background-color: #fff;
  320. width: 100%;
  321. height: 50px;
  322. padding: 0 10px;
  323. & > div {
  324. margin-left: 10px;
  325. display: flex;
  326. flex-wrap: nowrap;
  327. flex-direction: row;
  328. & > span {
  329. line-height: 50px;
  330. }
  331. }
  332. /deep/.auditFlow-box {
  333. position: unset;
  334. margin-left: 10px;
  335. &/deep/.auditFlow-icon {
  336. width: auto;
  337. padding-right: 30px;
  338. }
  339. &/deep/.auditFlow-main {
  340. position: absolute;
  341. }
  342. }
  343. }
  344. .box-app {
  345. display: inline-block;
  346. float: left;
  347. margin-left: 30px;
  348. line-height: 50px;
  349. }
  350. /deep/.el-dialog {
  351. .el-form-item {
  352. margin-bottom: 0 !important;
  353. .el-input--medium {
  354. textarea {
  355. min-height: 100px !important;
  356. }
  357. }
  358. }
  359. }
  360. .collapse-bottom {
  361. margin-bottom: 20px;
  362. }
  363. .input-main .textarea .el-textarea__inner {
  364. width: 100%;
  365. z-index: 1;
  366. }
  367. .bg-left {
  368. padding-left: 30px;
  369. }
  370. .bg-right {
  371. padding-right: 10px;
  372. text-align: right;
  373. }
  374. .bg-bottom {
  375. margin: 15px 0px;
  376. }
  377. .wenzi {
  378. width: 900px;
  379. margin: 0 auto;
  380. }
  381. .wenzi h3 {
  382. display: inline-block;
  383. left: 10px;
  384. }
  385. .wenzi p {
  386. display: inline-block;
  387. }
  388. .center {
  389. width: 900px;
  390. margin: 0 auto;
  391. }
  392. .el-form-item {
  393. width: 50%;
  394. }
  395. .el-form-item__label {
  396. text-align: center;
  397. }
  398. .ce {
  399. width: 900px;
  400. margin: 0 auto;
  401. }
  402. /*.crt-main .textarea /deep/ .el-form-item__label {*/
  403. /* height: 82px;*/
  404. /*}*/
  405. // 控制select为只读的时候显示样式
  406. .hide-sel {
  407. .el-input__inner {
  408. border: 0px;
  409. }
  410. .el-icon-arrow-up {
  411. display: none;
  412. }
  413. .el-textarea__inner {
  414. background-color: #fff !important;
  415. border: 0;
  416. }
  417. .el-date-editor {
  418. i {
  419. display: none;
  420. }
  421. }
  422. .is-disabled {
  423. .el-input__inner:hover {
  424. background-color: #fff !important;
  425. border: 0;
  426. }
  427. color: #606266;
  428. .el-input__inner {
  429. background-color: #fff !important;
  430. border: 0;
  431. color: #606266;
  432. }
  433. .el-textarea__inner {
  434. background-color: #fff !important;
  435. border: 0;
  436. color: #606266;
  437. }
  438. }
  439. }
  440. // 控制select为只读的时候显示样式
  441. /deep/.ws-class-table-col {
  442. height: auto;
  443. padding: 0px 2px;
  444. /deep/.el-input__inner {
  445. padding: 0px 2px;
  446. }
  447. }
  448. /deep/.is-disabled {
  449. .el-input__prefix,
  450. .el-input__suffix {
  451. display: none;
  452. }
  453. .el-input__inner {
  454. background-color: #fff;
  455. border-color: #fff !important;
  456. color: #000 !important;
  457. font-size: 14px;
  458. cursor: text;
  459. padding: 0 !important;
  460. }
  461. }
  462. .winseaview-view {
  463. padding: 0 0 20px;
  464. }
  465. .container {
  466. overflow: scroll;
  467. height: 93vh;
  468. }
  469. .ws-info-table .el-form-item {
  470. width: 33.3333%;
  471. }
  472. .readonly:after {
  473. display: none;
  474. }
  475. .el-textarea__inner {
  476. display: none;
  477. }
  478. .el-form {
  479. margin-top: 50px;
  480. }
  481. .readonly {
  482. width: 16%;
  483. }
  484. .ws-info-table .el-form-item {
  485. width: 33.33%;
  486. }
  487. //去边框
  488. /deep/.el-form-item {
  489. border-right: 0px;
  490. border-bottom: 0px;
  491. }
  492. /deep/.ws-info-table {
  493. border-left: 0px;
  494. border-top: 0px;
  495. }
  496. .connert {
  497. padding: 10px 40px;
  498. }
  499. //表格文字居中
  500. /deep/.el-table th.is-leaf,
  501. /deep/.el-table td {
  502. text-align: center;
  503. }
  504. //表格数据文字
  505. /deep/.el-table .el-table__body .cell {
  506. font-size: 14px;
  507. }
  508. .record,
  509. .adjustment {
  510. display: inline-block;
  511. color: #5878e8;
  512. padding: 0 4px !important;
  513. position: relative;
  514. }
  515. .record:after {
  516. position: absolute;
  517. content: '';
  518. display: block;
  519. top: 5px;
  520. right: -2px;
  521. width: 1px;
  522. height: 12px;
  523. background: #e9ecf7;
  524. }
  525. </style>