|
@@ -15,6 +15,11 @@
|
|
<el-option v-for="item in fixedData.ProductType" :key="item.id" :label="item.name" :value="item.id" />
|
|
<el-option v-for="item in fixedData.ProductType" :key="item.id" :label="item.name" :value="item.id" />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="状态">
|
|
|
|
+ <el-select v-model="filterProductForm.status" placeholder="请选择">
|
|
|
|
+ <el-option v-for="item in fixedData.Personnel" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item label="负责人">
|
|
<el-form-item label="负责人">
|
|
<el-select v-model="filterProductForm.userId" placeholder="请选择">
|
|
<el-select v-model="filterProductForm.userId" placeholder="请选择">
|
|
<el-option v-for="item in fixedData.Personnel" :key="item.id" :label="item.name" :value="item.id" />
|
|
<el-option v-for="item in fixedData.Personnel" :key="item.id" :label="item.name" :value="item.id" />
|
|
@@ -43,7 +48,7 @@
|
|
<el-button type="primary" @click="batchDelete()">批量删除</el-button>
|
|
<el-button type="primary" @click="batchDelete()">批量删除</el-button>
|
|
<el-button type="primary" @click="showDeteleProduct(true)">回收站</el-button>
|
|
<el-button type="primary" @click="showDeteleProduct(true)">回收站</el-button>
|
|
<el-button type="primary" @click="dialogVisible.importVisible = true">导入</el-button>
|
|
<el-button type="primary" @click="dialogVisible.importVisible = true">导入</el-button>
|
|
- <el-button type="primary">导出</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="exportProductTableList()" :loading="allLoading.exoprtLoading">导出</el-button>
|
|
</div>
|
|
</div>
|
|
<div class="flex-1 w-full overflow-hidden">
|
|
<div class="flex-1 w-full overflow-hidden">
|
|
<el-table ref="productTableRef" :data="productTableList" border v-loading="allLoading.productTableLading"
|
|
<el-table ref="productTableRef" :data="productTableList" border v-loading="allLoading.productTableLading"
|
|
@@ -131,8 +136,8 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
import { ref, reactive, onMounted, inject } from "vue";
|
|
import { ref, reactive, onMounted, inject } from "vue";
|
|
-import { GETSYSFILED, MOD, MODUCODE, GETPERSONNEL, GETTEMPLATE, GETTABLELIST, ADDPRODUCT, ALLDETELE, UPLOADFILE } from './api'
|
|
|
|
-import { getAllListByCode, getFromValue, resetFromValue, getFirstDayOfMonth, getLastDayOfMonth, formatDate, createTaskFromType, confirmAction, downloadTemplate } from '@/utils/tools'
|
|
|
|
|
|
+import { GETSYSFILED, MOD, MODUCODE, GETPERSONNEL, GETTEMPLATE, GETTABLELIST, ADDPRODUCT, ALLDETELE, UPLOADFILE, EXPORTTIME } from './api'
|
|
|
|
+import { getAllListByCode, getFromValue, resetFromValue, getFirstDayOfMonth, downloadFile, formatDate, createTaskFromType, confirmAction, downloadTemplate } from '@/utils/tools'
|
|
import { FormInstance, FormRules, ElMessageBox, ElTable, UploadRequestOptions } from 'element-plus'
|
|
import { FormInstance, FormRules, ElMessageBox, ElTable, UploadRequestOptions } from 'element-plus'
|
|
import { post, get, uploadFile } from "@/utils/request";
|
|
import { post, get, uploadFile } from "@/utils/request";
|
|
import { useRouter, useRoute } from "vue-router";
|
|
import { useRouter, useRoute } from "vue-router";
|
|
@@ -151,12 +156,14 @@ const filterProductForm = reactive<filterProductFormType>({ // 筛选条件form
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
id: '',
|
|
id: '',
|
|
type: '',
|
|
type: '',
|
|
|
|
+ status: '',
|
|
})
|
|
})
|
|
const allLoading = reactive({
|
|
const allLoading = reactive({
|
|
productTableLading: false,
|
|
productTableLading: false,
|
|
generateFormLading: false,
|
|
generateFormLading: false,
|
|
saveLoading: false,
|
|
saveLoading: false,
|
|
- importLoading: false
|
|
|
|
|
|
+ importLoading: false,
|
|
|
|
+ exoprtLoading: false
|
|
})
|
|
})
|
|
const dialogVisible = reactive({
|
|
const dialogVisible = reactive({
|
|
editProductVisible: false,
|
|
editProductVisible: false,
|
|
@@ -272,12 +279,23 @@ async function importProducts(param: UploadRequestOptions) {
|
|
const res = await uploadFile(UPLOADFILE, formData)
|
|
const res = await uploadFile(UPLOADFILE, formData)
|
|
allLoading.importLoading = false
|
|
allLoading.importLoading = false
|
|
if (res.code == 'ok') {
|
|
if (res.code == 'ok') {
|
|
- globalPopup?.showSuccess(res.msg || '')
|
|
|
|
|
|
+ globalPopup?.showSuccess('导入成功' || '')
|
|
|
|
+ getProductTableList()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
globalPopup?.showError(res.msg || '')
|
|
globalPopup?.showError(res.msg || '')
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+function exportProductTableList() {
|
|
|
|
+ allLoading.exoprtLoading = true
|
|
|
|
+ let valueForm = getFromValue(filterProductForm)
|
|
|
|
+ post(EXPORTTIME, {...valueForm}).then((res) => {
|
|
|
|
+ downloadFile(res.data, '产品表导出.xlsx')
|
|
|
|
+ }).finally(() => {
|
|
|
|
+ allLoading.exoprtLoading = false
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
function handleSizeChange(val: number) {
|
|
function handleSizeChange(val: number) {
|
|
filterProductForm.pageIndex = 1
|
|
filterProductForm.pageIndex = 1
|
|
filterProductForm.pageSize = val
|
|
filterProductForm.pageSize = val
|