Browse Source

前端sdy

zhongtianhaoyuan 4 năm trước cách đây
mục cha
commit
dad07ca08a

+ 5 - 1
src/api/V2/warehouse/index.js

@@ -1,5 +1,9 @@
 export const API_GET_WAREHOUSE_BASEINFO = '/warehouseBaseInfo/selectWarehouseViewinfo'
+
 //仓库列表查看
 export const API_GET_WAREHOUSE_LOOK = '/warehouseBaseInfo/getWarehouse'
 //仓库名称下拉
-export const API_GET_WAREHOUSE_CUSTOMDROPDOWN = '/warehouseBaseInfo/selectWarehouse'
+export const API_GET_WAREHOUSE_CUSTOMDROPDOWN = '/warehouseBaseInfo/selectWarehouse'
+
+export const API_GET_WAREHOUSE_DELETE = '/warehouseBaseInfo/api/deleteWarehouse'
+

+ 9 - 2
src/model/warehouse/index.js

@@ -3,11 +3,18 @@ import { appRx } from '../defalutConfig/indexRx'
 import {
     API_GET_WAREHOUSE_BASEINFO,
     API_GET_WAREHOUSE_LOOK,
-    API_GET_WAREHOUSE_CUSTOMDROPDOWN
+    API_GET_WAREHOUSE_CUSTOMDROPDOWN,
+    API_GET_WAREHOUSE_DELETE,
 } from '@/api/V2/warehouse'
 // 列表
 export const getList = appRx.get(API_GET_WAREHOUSE_BASEINFO, errorCatcher, errorHandle, filter)
 //仓库查看
 export const getLook = appRx.get( API_GET_WAREHOUSE_LOOK, errorCatcher, errorHandle, filter)
 //仓库下拉
-export const xiala = appRx.get( API_GET_WAREHOUSE_CUSTOMDROPDOWN, errorCatcher, errorHandle, filter)
+export const xiala = appRx.get( API_GET_WAREHOUSE_CUSTOMDROPDOWN, errorCatcher, errorHandle, filter)
+
+// 列表
+export const getList = appRx.get(API_GET_WAREHOUSE_BASEINFO, errorCatcher, errorHandle, filter)
+//删除
+export const deletewarehouse = appRx.get(API_GET_WAREHOUSE_DELETE, errorCatcher, errorHandle, filter)
+

+ 41 - 22
src/views/warehouse/warehouseManagementDelete.vue

@@ -50,7 +50,7 @@
 
             <ws-button
               type="primary"
-              @click="handleAdd()"
+              @click="handleDelete(scope.row)"
               v-hasPermission="
                 `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
               "
@@ -64,12 +64,10 @@
   </div>
 </template>
 <script>
-import {
-  getList,
-  export1,
-  editstatus,
-  billoperatehis,
-} from '@/model/contarct/index'
+
+import{
+  deletewarehouse
+} from '@/model/warehouse/index'
 import { downloadFile } from '@/utils/batchDown'
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'
@@ -90,6 +88,7 @@ export default {
   },
   data() {
     return {
+      
       //弹出框
       dialogViewSpareMoney: false,
       dialogApproveFormVisible: false,
@@ -109,6 +108,7 @@ export default {
       contractType: 2,
       startDate: null,
       endDate: null,
+
       // 提交类型
       submitType: true,
       size: 10,
@@ -185,10 +185,15 @@ export default {
     //cg.viewBudget
     //cg.viewSpareMoney
     // this.getVesselData();
-    this.getList()
+    // this.deletewarehouse()
+    // this.getList()
+  
     this.showType = this.isShow
   },
   methods: {
+    handleDelete(){
+      this.$router.push({ path : 'warehouseManagementDelete'})
+    },
     returnWarehouse(){
       this.$router.push({ path: 'warehouseManagementList' })
     },
@@ -214,19 +219,7 @@ export default {
       }
       return fmt
     },
-    handleClose() {
-      this.accessoryTFs = false
-    },
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`)
-      this.pageSize = val
-      this.getList()
-    },
-    handleCurrentChange(val) {
-      this.currentPage = val
-      console.log(`当前页: ${val}`)
-      this.getList()
-    },
+    
     getList() {
       getList({
         compId: sessionStorage.getItem('ws-pf_compId'),
@@ -369,13 +362,39 @@ export default {
     },
     // deletecontract(){},
     //删除
-
     approve() {},
     listQuery() {},
     total() {},
     clearfiltQuery() {},
     selectCrtDuty() {},
   },
+  handleDelete(row) {
+      var handleDelete = ' '
+      if (row.handleDelete =='') {
+      }
+      this.$confirm(`此操作永久删除该仓库全部信息,是否确认删除`, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+      })
+        .then(() => {
+          deletewarehouse({ id: row.id })
+            .toPromise()
+            .then((response) => {
+              this.$notify.success({
+                title: '成功',
+                message: '删除成功',
+              })
+              this.getList()
+            })
+            .catch((response) => {
+              // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+            })
+        })
+        .catch(() => {
+          return false
+        })
+    },
 }
 </script>
 <style lang="scss" scoped>

+ 1 - 1
src/views/warehouse/warehouseManagementList.vue

@@ -144,7 +144,7 @@ import {
   export1,
   editstatus,
   billoperatehis,
-} from '@/model/contarct/index'
+} from '@/model/warehouse/index'
 import { downloadFile } from '@/utils/batchDown'
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'