|
@@ -26,6 +26,10 @@
|
|
|
</template>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
+ <div class="w-full flex p-3 shadow-[0_-3px_5px_0px_rgba(0,0,0,0.2)]">
|
|
|
+ <El-button class="w-full" @click="resetFilterForm()">重置</El-Button>
|
|
|
+ <El-button type="primary" class="w-full" @click="getTableList()">搜索</El-Button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="flex-1 p-5 overflow-auto">
|
|
@@ -70,7 +74,7 @@
|
|
|
import { ref, reactive, onMounted, inject } from "vue";
|
|
|
import { getAllListByCode, getFromValue, resetFromValue, getFirstDayOfMonth, getLastDayOfMonth, formatDate } from '@/utils/tools'
|
|
|
import { post, get } from "@/utils/request";
|
|
|
-import { actionButtons, tableColumns, GETSYSFILED, GETPERSONNEL, GETGENERATEFOEM, MOD } from "./api";
|
|
|
+import { actionButtons, tableColumns, GETSYSFILED, GETPERSONNEL, GETGENERATEFOEM, MOD, GETTABLELIST, GETALLPRODUCT } from "./api";
|
|
|
import { useRouter, useRoute } from "vue-router";
|
|
|
|
|
|
const router = useRouter()
|
|
@@ -82,14 +86,15 @@ const filterForm = reactive<FilterForm>({ // 筛选条件 Value
|
|
|
responsibleId: '',
|
|
|
createId: '',
|
|
|
email: '',
|
|
|
- startTime: '',
|
|
|
- endTime: ''
|
|
|
+ startTime: getFirstDayOfMonth(new Date()),
|
|
|
+ endTime: formatDate(new Date())
|
|
|
});
|
|
|
const selectData = reactive({ // 下拉数据
|
|
|
Personnel: [] as personnelInterface[],
|
|
|
Customer: [] as any[], // 客户名称
|
|
|
OrderType: [] as any[], // 订单类型
|
|
|
RemittanceStatus: [] as any[], // 回款状态
|
|
|
+ AllProduct: [] as any[] // 所有产品
|
|
|
})
|
|
|
const filterItems = ref<FilterItem[]>([]) // 渲染筛选条件
|
|
|
const formTablePaging = reactive({ // 分页条件
|
|
@@ -106,7 +111,7 @@ const allLoading = reactive({ // 按钮加载 Loading
|
|
|
formTableLading: false,
|
|
|
})
|
|
|
const dialogVisible = reactive({
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
|
|
|
function toDetali(row: any) {
|
|
@@ -116,6 +121,32 @@ function toDetali(row: any) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+function getTableList() {
|
|
|
+ const formValue = getFromValue(filterForm)
|
|
|
+ const formPaging = { pageIndex: formTablePaging.currentPage, pageSize: formTablePaging.pageSize }
|
|
|
+ allLoading.formTableLading = true
|
|
|
+ post(GETTABLELIST, { ...formValue, ...formPaging }).then(res => {
|
|
|
+ const { total, record } = res.data
|
|
|
+ formTable.value = record
|
|
|
+ formTablePaging.total = total
|
|
|
+ }).finally(() => {
|
|
|
+ allLoading.formTableLading = false
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+function resetFilterForm() {
|
|
|
+ let newFilterForm = resetFromValue(filterForm, { startTime: getFirstDayOfMonth(new Date()), endTime: formatDate(new Date()) })
|
|
|
+ Object.assign(filterForm, newFilterForm)
|
|
|
+ getTableList()
|
|
|
+}
|
|
|
+
|
|
|
+function getAllProduct() {
|
|
|
+ post(GETALLPRODUCT, { pageIndex: -1, pageSize: -1 }).then((res) => {
|
|
|
+ const { record } = res.data
|
|
|
+ selectData.AllProduct = record
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
async function getSystemField() {
|
|
|
const systemField = getAllListByCode([])
|
|
|
for (let i in systemField) {
|
|
@@ -143,11 +174,11 @@ async function getSystemField() {
|
|
|
|
|
|
function setFilterItems() {
|
|
|
filterItems.value = [
|
|
|
- { label: '订单编号', key: 'contactPerson', type: 'input' },
|
|
|
- { label: '订单名称', key: 'customerId', type: 'input' },
|
|
|
- { label: '客户名称', key: 'phoneNumber', type: 'select', options: selectData.Customer },
|
|
|
+ { label: '订单编号', key: 'orderCode', type: 'input' },
|
|
|
+ { label: '订单名称', key: 'orderName', type: 'input' },
|
|
|
+ { label: '客户名称', key: 'customId', type: 'select', options: selectData.Customer },
|
|
|
{ label: '商机名称', key: 'email', type: 'input' },
|
|
|
- { label: '订单类型', key: 'orderType', type: 'select', options: selectData.OrderType },
|
|
|
+ { label: '订单类型', key: 'type', type: 'select', options: selectData.OrderType },
|
|
|
{ label: '回款状态', key: 'remittanceStatus', type: 'select', options: selectData.RemittanceStatus },
|
|
|
{ label: '负责人', key: 'responsibleId', type: 'select', options: selectData.Personnel },
|
|
|
{ label: '下单时间', key: '', type: 'date' },
|
|
@@ -156,6 +187,8 @@ function setFilterItems() {
|
|
|
|
|
|
onMounted(() => {
|
|
|
getSystemField()
|
|
|
+ getAllProduct()
|
|
|
+ getTableList()
|
|
|
})
|
|
|
</script>
|
|
|
|