产品列表数据展示

master
milo 2022-04-10 22:03:40 +08:00
parent 2fcae8c82f
commit 565eefe8e5
12 changed files with 53 additions and 28 deletions

View File

@ -2,3 +2,7 @@ import axios from 'axios'
import qs from 'qs' import qs from 'qs'
export const customerData = query => axios.post('http://oa-dxtc.test/customer', qs.stringify(query)); export const customerData = query => axios.post('http://oa-dxtc.test/customer', qs.stringify(query));
export const customerAdd = addQuery => axios.post('http://oa-dxtc.test/customer/add', qs.stringify(addQuery));
export const customerEdit = editQuery => axios.post('http://oa-dxtc.test/customer/edit', qs.stringify(editQuery));

View File

@ -1,4 +0,0 @@
import axios from 'axios'
import qs from 'qs'
export const customerAdd = query => axios.post('http://oa-dxtc.test/customer/add', qs.stringify(query));

View File

@ -1,4 +0,0 @@
import axios from 'axios'
import qs from 'qs'
export const customerEdit = query => axios.post('http://oa-dxtc.test/customer/edit', qs.stringify(query));

6
src/api/project.ts Normal file
View File

@ -0,0 +1,6 @@
import axios from 'axios'
import qs from 'qs'
export const projectData = query => axios.post('http://oa-dxtc.test/project/index', qs.stringify(query));
export const projectAdd = addQuery => axios.post('http://oa-dxtc.test/project/add', qs.stringify(addQuery));

View File

@ -1,4 +0,0 @@
import axios from 'axios'
import qs from 'qs'
export const projectAdd = query => axios.post('http://oa-dxtc.test/project/add', qs.stringify(query));

View File

@ -2,3 +2,7 @@ import axios from 'axios'
import qs from 'qs' import qs from 'qs'
export const sourceData = query => axios.post('http://oa-dxtc.test/source/index', qs.stringify(query)); export const sourceData = query => axios.post('http://oa-dxtc.test/source/index', qs.stringify(query));
export const sourceAdd = addQuery => axios.post('http://oa-dxtc.test/source/add', qs.stringify(addQuery));
export const sourceEdit = editQuery => axios.post('http://oa-dxtc.test/source/edit', qs.stringify(editQuery));

View File

@ -1,4 +0,0 @@
import axios from 'axios'
import qs from 'qs'
export const sourceAdd = query => axios.post('http://oa-dxtc.test/source/add', qs.stringify(query));

View File

@ -1,4 +0,0 @@
import axios from 'axios'
import qs from 'qs'
export const sourceEdit = query => axios.post('http://oa-dxtc.test/source/edit', qs.stringify(query));

4
src/api/user.ts Normal file
View File

@ -0,0 +1,4 @@
import axios from 'axios'
import qs from 'qs'
export const userData = query => axios.post('http://oa-dxtc.test/user/index', qs.stringify(query));

View File

@ -121,9 +121,9 @@
<script> <script>
import { ref, reactive } from "vue"; import { ref, reactive } from "vue";
import { ElMessage, ElMessageBox } from "element-plus"; import { ElMessage, ElMessageBox } from "element-plus";
import { customerData } from "../api/customer"; import { customerData, customerAdd, customerEdit } from "../api/customer";
import { customerAdd } from "../api/customerAdd"; // import { customerAdd } from "../api/customerAdd";
import { customerEdit } from '../api/customerEdit'; // import { customerEdit } from '../api/customerEdit';
import { sourceData } from '../api/source'; import { sourceData } from '../api/source';
export default { export default {

View File

@ -41,7 +41,7 @@
v-for="item in customerListData" v-for="item in customerListData"
:key="item.id" :key="item.id"
:value="item.id" :value="item.id"
:label="item.name" :label="item.company"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -125,7 +125,9 @@
<script lang="ts"> <script lang="ts">
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { projectAdd } from "../api/projectAdd"; import { projectData, projectAdd } from "../api/project";
import { customerData } from '../api/customer';
import { userData } from '../api/user';
export default{ export default{
setup() { setup() {
@ -144,6 +146,31 @@ export default{
] ]
}); });
//
const query = reactive({
page: 1
});
const pageTotal = ref(0);
const getData = () => {
//
projectData(query).then((res) => {
tableData.value = res.data.data;
pageTotal.value = res.data.pageTotal || 0;
});
//
customerData({}).then((res) => {
console.log(res.data.data)
customerListData.value = res.data.data;
});
//
userData({}).then((res) => {
console.log(res.data.data)
userListData.value = res.data.data;
});
};
getData();
// //
const addVisible = ref(false); const addVisible = ref(false);
const tableAddData = ref(null); const tableAddData = ref(null);

View File

@ -62,9 +62,9 @@
<script lang="ts"> <script lang="ts">
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { sourceAdd } from "../api/sourceAdd"; // import { sourceAdd } from "../api/sourceAdd";
import { sourceEdit } from '../api/sourceEdit'; // import { sourceEdit } from '../api/sourceEdit';
import { sourceData } from '../api/source'; import { sourceData, sourceAdd, sourceEdit } from '../api/source';
export default { export default {
//name: 'source2', //name: 'source2',