添加删除按钮
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<nav-bar title="调拨维护"></nav-bar>
|
||||
<view class="sticky search-confirm-wrap">
|
||||
<view class="sticky search-confirm-wrap" style="z-index: 11;">
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-15 zd-row jcflexstart">
|
||||
<view class="zd-col-10"><search-box placeholder="输入查询条件" v-model="val1" /></view>
|
||||
<view class="zd-col-10"><search-box placeholder="关键字" v-model="val1" /></view>
|
||||
<view class="zd-col-7 select_wraper mgl10">
|
||||
<zxz-uni-data-select placeholder="选择调出组织信息" v-model="value2" filterable :localdata="range1"></zxz-uni-data-select>
|
||||
</view>
|
||||
@@ -15,6 +15,7 @@
|
||||
<view class="zd-col-9 zd-row jcflexend">
|
||||
<button class="confirm-button" @tap="toSearch">查询</button>
|
||||
<button class="confirm-button" :disabled="disabled1" @tap="_easOutInBillSync">同步</button>
|
||||
<button class="confirm-button" :class="{'confirm-button_disabled': checkData.length === 0}" :disabled="disabled1" @tap="_easOutInBillDelete">删除</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -22,7 +23,8 @@
|
||||
<view class="zdrow-wrap">
|
||||
<view class="zd-row sticky zd-th-wraper">
|
||||
<view class="zd-col-1 zd-th"><text>序号</text></view>
|
||||
<view class="zd-col-4 zd-th"><text class="fontcol1">调拨单号</text></view>
|
||||
<view class="zd-col-1 zd-th"><text>选择</text></view>
|
||||
<view class="zd-col-3 zd-th"><text class="fontcol1">调拨单号</text></view>
|
||||
<view class="zd-col-2 zd-th"><text>业务日期</text></view>
|
||||
<view class="zd-col-2 zd-th"><text>提交时间</text></view>
|
||||
<view class="zd-col-2 zd-th"><text>调出库存<br>组织编码</text></view>
|
||||
@@ -37,7 +39,10 @@
|
||||
<view class="zd-td-wraper" v-for="(e, i) in dataList" :key="e.id">
|
||||
<view class="zd-row" @tap="loadSubData(e)">
|
||||
<view class="zd-col-1 zd-td"><text>{{i+1}}</text></view>
|
||||
<view class="zd-col-4 zd-td fontcol1"><text>{{e.djbh}}</text></view>
|
||||
<view class="zd-col-1 zd-td" @tap.stop="toCheckbox(e)">
|
||||
<view class="zd-checkbox" :class="{'zd-checkbox_active': e.checked}"></view>
|
||||
</view>
|
||||
<view class="zd-col-3 zd-td fontcol1"><text>{{e.djbh}}</text></view>
|
||||
<view class="zd-col-2 zd-td"><text>{{e.ywrq}}</text></view>
|
||||
<view class="zd-col-2 zd-td"><text>{{e.cjsj}}</text></view>
|
||||
<view class="zd-col-2 zd-td"><text>{{e.dckcbm}}</text></view>
|
||||
@@ -210,7 +215,7 @@
|
||||
import ScanInput from '@/components/ScanInput.vue'
|
||||
import Pagination from '@/components/Pagination.vue'
|
||||
import GridDetail from '@/components/GridDetail.vue'
|
||||
import {getWarehouseInfo, getOrganizationInfo, allocationPage, allocationBillDetail, allocationBillConfirm, allocationBillDetailUpdate, easOutInBillSync, inWarehouseAssignLocation, addAssignDtl, inWarehouseCommit, viewAssignDtl, updateAssignDtl} from '@/utils/getData2.js'
|
||||
import {getWarehouseInfo, getOrganizationInfo, allocationPage, allocationBillDetail, allocationBillConfirm, allocationBillDetailUpdate, easOutInBillSync, inWarehouseAssignLocation, addAssignDtl, inWarehouseCommit, viewAssignDtl, updateAssignDtl, easOutInBillDelete} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -221,6 +226,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
crType: '',
|
||||
val1: '', // 模糊查询
|
||||
value1: '', // 选择调入组织信息
|
||||
value2: '', // 选择调出组织信息
|
||||
@@ -232,6 +238,7 @@
|
||||
},
|
||||
currentPage1: 1,
|
||||
dataList: [], // 一级表格数据
|
||||
checkData: [], // 一级表格多选数组
|
||||
popData: [], // 副表格点击物料编码弹出弹窗
|
||||
popdisabled: false,
|
||||
popObj: {}, // 弹窗当前主表格内容
|
||||
@@ -247,7 +254,8 @@
|
||||
subCheckData: [] // 二级表格多选数组
|
||||
}
|
||||
},
|
||||
onLoad () {
|
||||
onLoad (options) {
|
||||
this.crType = options.type
|
||||
this.toSearch()
|
||||
setTimeout(() => {
|
||||
this._getWarehouseInfo()
|
||||
@@ -319,6 +327,12 @@
|
||||
this.currentPage1 = page
|
||||
this._allocationPage()
|
||||
},
|
||||
// 一级表格多选
|
||||
toCheckbox (e) {
|
||||
e.checked = !e.checked
|
||||
let arr = this.dataList.filter(el => el.checked === true)
|
||||
this.checkData = arr.map(el => {return el.djid})
|
||||
},
|
||||
// 点击一级表格一行加载二级表格
|
||||
loadSubData (e) {
|
||||
if (e.subData.length > 0) {
|
||||
@@ -596,6 +610,31 @@
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
// 点击删除按钮
|
||||
async _easOutInBillDelete () {
|
||||
this.disabled1 = true
|
||||
if (!this.checkData.length) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await easOutInBillDelete('ALLO', this.checkData)
|
||||
if (res.code === 1) {
|
||||
this.disabled1 = false
|
||||
this.checkData = []
|
||||
this.subCheckData = []
|
||||
this._allocationPage()
|
||||
} else {
|
||||
this.disabled1 = false
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user