高敬炎 2 years ago
parent
commit
c76be728d9

+ 2 - 1
src/api/V2/tradeServicesManagement/index.js

@@ -39,4 +39,5 @@ export const API_GET_WAREHOUSERECEIPT_BANKLIST = '/commonSysParameter/getInfo'
 export const API_GET_SETDEFAULT = '/enabledInfo/getEnabledInfo'
 // 贸易服务设置显示
 export const API_SET_SETDEFAULT = '/enabledInfo/api/setEnabledInfo'
-
+// 开锁关锁
+export const API_OPENLOCK = '/warehousePositionInfo/api/openLock'

+ 5 - 2
src/model/tradeServicesManagement/index.js

@@ -19,7 +19,8 @@ import {
     API_POST_REPAYMENT_SUBMIT,
     API_GET_WAREHOUSERECEIPT_BANKLIST,
     API_GET_SETDEFAULT,
-    API_SET_SETDEFAULT
+    API_SET_SETDEFAULT,
+    API_OPENLOCK
 } from '@/api/V2/tradeServicesManagement'
 // 列表
 export const getList = appRx.get(API_GET_TRADESERVICES_LIST, errorCatcher, errorHandle, filter)
@@ -58,4 +59,6 @@ export const WarehouseReceiptBankList = appRx.get(API_GET_WAREHOUSERECEIPT_BANKL
 // 贸易服务默认显示
 export const getDefault = appRx.get(API_GET_SETDEFAULT, errorCatcher, errorHandle, filter)
 // 贸易服务设置显示
-export const setDefault = appRx.post(API_SET_SETDEFAULT, errorCatcher, errorHandle, filter)
+export const setDefault = appRx.post(API_SET_SETDEFAULT, errorCatcher, errorHandle, filter)
+// 开锁关锁
+export const openlock = appRx.post(API_OPENLOCK, errorCatcher, errorHandle, filter)

+ 101 - 2
src/views/tradeServicesManagement/warehouseReceiptRegulation.vue

@@ -25,6 +25,7 @@
         <el-button :type="searchType == 4 ? 'primary' : ''" @click="handlestatus(4)">已还</el-button>
         <el-input @keyup.enter.native="findList()" placeholder="可按业务编号、合同编号、仓库名查找" class="search-input" v-model="searchKeyWord"></el-input>
         <el-button type="primary" @click='findList'>查找</el-button>
+        <el-button type="" @click='handle'>电子锁操作记录</el-button>
         <el-button type="primary" v-hasPermission=" `tradeServicesManagement.tradeService.add`" class="add" @click="add">添加</el-button>
       </div>
       <el-table :data="tradeServicesList" style="width: 100%; margin-top: 20px" ref="tradeServicesList" border
@@ -53,7 +54,7 @@
             <span v-else>{{scope.row.approveStatus?scope.row.approveStatus:scope.row.status}}</span>
           </template>
         </el-table-column>
-        <el-table-column prop="address" label="操作" width="300">
+        <el-table-column prop="address" label="操作" width="500">
           <template slot-scope="scope">
             <el-button size="mini" v-hasPermission=" `tradeServicesManagement.tradeService.view`" @click="lookBtnClick(scope.row, 2)">
               查看</el-button>
@@ -67,6 +68,8 @@
               还款</el-button>
             <el-button v-hasPermission=" `tradeServicesManagement.tradeService.edit`" size="mini" @click="rowEditBtnClick(scope.row)" v-if="!scope.row.approveStatus&&scope.row.status=='已驳回'">修改</el-button>
             <el-button v-hasPermission=" `tradeServicesManagement.tradeService.delete`" size="mini" type="danger" @click="rowDeleteBtnClick(scope.row)" v-if="!scope.row.approveStatus&&scope.row.status=='已驳回'">删除</el-button>
+            <el-button v-if="scope.row.lockedStatusFlag==1" size="mini" type="success" @click="rowhandleBtnClick(scope.row,0)" >电子锁(已开)</el-button>
+            <el-button v-if="scope.row.lockedStatusFlag==0" size="mini" type="danger" @click="rowhandleBtnClick(scope.row,1)" >电子锁(已关)</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -76,6 +79,50 @@
           :total="deptBudgetTotal"></el-pagination>
       </div>
     </div>
+    <el-dialog
+      title="开锁"
+      :visible.sync="dialogVisible"
+      width="30%"
+      :before-close="handleClose">
+      <div>
+        <el-form ref="form" :model="form" label-width="100px">
+          <el-form-item label="开锁事由">
+            <el-checkbox-group @change="checkchange" v-model="checkList">
+              <el-checkbox label="出库"></el-checkbox>
+              <el-checkbox label="入库"></el-checkbox>
+              <el-checkbox label="巡检"></el-checkbox>
+            </el-checkbox-group>
+          </el-form-item>
+          <el-form-item label="人员">
+            <el-input v-model="form.lockName" placeholder="请输入人员"></el-input>
+          </el-form-item>
+          <el-form-item label="备注(选填)">
+            <el-input type="textarea" v-model="form.lockRemark"></el-input>
+          </el-form-item>
+        </el-form>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submit">提交</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog
+      title="开锁"
+      :visible.sync="dialogVisible1"
+      width="30%"
+      :before-close="handleClose1">
+      <div>
+        <div style="border-bottom:1px solid #ccc;padding:10px;" v-for="item in dataList">
+          <div style="justify-content: space-between;" class="flex">
+            <div>{{ item.dealMsg }}({{item.billType}})-{{ item.operateUser }}</div>
+            <div>{{ item.createDate }}</div>
+          </div>
+          <div style="justify-content: space-between;" class="flex">
+            <div>{{ item.dealMsgEn }}</div><div>{{ item. verifyUserDuty}}</div>
+          </div>
+          <div>{{ item.verifyRemark }}</div>
+        </div>
+      </div>
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -85,11 +132,15 @@
     getMapInfo,
     deleteTrageInfo,
     getDefault,
-    setDefault
+    setDefault,
+    openlock
   } from '@/model/tradeServicesManagement/index'
   import {
     selectWarehouseSelf,
   } from '@/model/houseSelfCollect/index'
+  import {
+    billoperatehis,
+  } from '@/model/contarct/index'
   export default {
     components: {
       mapDrag
@@ -110,6 +161,12 @@
         warehouseList: [],
         compId: '',
         id:'',
+        dialogVisible:false,
+        form:{},
+        dialogVisible1:false,
+        dataList:[],
+        checkList:[],
+        currectData:{}
       }
     },
     activated() {
@@ -147,6 +204,48 @@
 
     },
     methods: {
+      handle(){
+        billoperatehis({id:localStorage.getItem('ws-pf_compId')}).toPromise().then((response) => {
+              this.dataList=response
+              this.dialogVisible1 = true
+            })
+      },
+      checkchange(e){
+        console.log(e)
+        this.form.lockReason=e.join('/')
+      },
+      submit(){
+        openlock({flag:1,electronicLock:this.currectData.electronicLock,...this.form}).toPromise().then((response) => {
+              this.$message.success('开锁成功')
+              this.dialogVisible = false
+              this.getList()
+            })
+      },
+      handleClose(){
+        this.dialogVisible = false
+      },
+      handleClose1(){
+        this.dialogVisible1 = false
+      },
+      rowhandleBtnClick(row,status){
+        if(status==0){
+          this.$confirm('确定关闭电子锁?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+          .then(() => {
+            openlock({flag:2,electronicLock:row.electronicLock}).toPromise().then((response) => {
+              this.$message.success('关锁成功')
+              this.getList()
+            })
+          })
+        }else{
+          this.currectData=row
+          this.dialogVisible=true
+
+        }
+      },
       getMapInfo() {
         getMapInfo().toPromise().then((response) => {
           // console.log('地图数据', response)