|
@@ -8,7 +8,34 @@
|
|
|
:items="items"
|
|
|
:pagination="pagination"
|
|
|
:page-change="pageChange"
|
|
|
- />
|
|
|
+ >
|
|
|
+ <template v-slot:batch-btn-box="{ selected }">
|
|
|
+
|
|
|
+ <!-- <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ icon="el-icon-edit"
|
|
|
+ size="mini"
|
|
|
+ :disabled="selected | singleBatch"
|
|
|
+ @click="handleUpdate(selected)"
|
|
|
+ v-hasPermi="['car:brand:edit']"
|
|
|
+ >修改</el-button
|
|
|
+ >
|
|
|
+ </el-col> -->
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ size="mini"
|
|
|
+ :disabled="selected | multipleBatch"
|
|
|
+ @click="handleAudit(selected)"
|
|
|
+ >批量审核</el-button
|
|
|
+ >
|
|
|
+ </el-col>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ </base-table>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -17,11 +44,38 @@ import toolbar from './toolbar';
|
|
|
import mxFilterList from '@/mixins/filterList';
|
|
|
import { getPage } from '@/api/photoWarehouse';
|
|
|
|
|
|
+const checkArr = (arr) => {
|
|
|
+ if (Array.isArray(arr)) {
|
|
|
+ if (arr.length === 0) {
|
|
|
+ return 'null';
|
|
|
+ } else if (arr.length === 1) {
|
|
|
+ return 'single';
|
|
|
+ } else {
|
|
|
+ return 'multiple';
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ throw new Error('ErrorType, we need Array', arr);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
export default {
|
|
|
name: 'photoVerifyManagement',
|
|
|
|
|
|
components: { toolbar },
|
|
|
|
|
|
+ filters: {
|
|
|
+ // 单选可用
|
|
|
+ singleBatch: (arr) => {
|
|
|
+ return checkArr(arr) !== 'single';
|
|
|
+ },
|
|
|
+ // 非空可用
|
|
|
+ multipleBatch: (arr) => {
|
|
|
+ return checkArr(arr) === 'null';
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
mixins: [
|
|
|
mxFilterList({
|
|
|
fetchList: getPage // 在下方data再声明一个 fetchList: iGetList 同等效果
|
|
@@ -32,6 +86,9 @@ export default {
|
|
|
return {
|
|
|
columns: [
|
|
|
{
|
|
|
+ key: 'selection',
|
|
|
+ },
|
|
|
+ {
|
|
|
key: 'id',
|
|
|
name: '标识',
|
|
|
width: this.$col.b
|
|
@@ -175,6 +232,13 @@ export default {
|
|
|
|
|
|
beforeDestroy() {
|
|
|
this.$g_off('photo_reload', this.reload);
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ handleAudit(arr) {
|
|
|
+ this.$PhotoVerifyMultItemModal({
|
|
|
+ ids: arr.map(x => x.id)
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|