Kaynağa Gözat

Manage Team 添加编辑页接口

wzl 2 yıl önce
ebeveyn
işleme
665f64e34b

+ 1 - 1
src/components/sideMenu.vue

@@ -100,7 +100,7 @@ export default {
         </el-menu-item>
       </el-menu>
     </div>
-    <div @click="logout()" class="w-full h-40px bg-[#F6F7F9] flex items-center cursor-pointer"><Logout class="ml-27px" /><span class="ml-11px text-14px text-[#232A40] font-bold">Log out</span></div>
+    <div @click="logout()" class="absolute left-0 bottom-0 w-full h-40px bg-[#F6F7F9] flex items-center cursor-pointer"><Logout class="ml-27px" /><span class="ml-11px text-14px text-[#232A40] font-bold">Log out</span></div>
   </div>
 </template>
 

+ 13 - 2
src/views/ProductManagement.vue

@@ -13,6 +13,8 @@ const dialogVisible = ref(false)
 const cancelEmail = ref('')
 const cancelUniqueSn = ref('')
 const total = ref(0)
+const productList = ref([])
+const productId = ref('')
 
 onMounted(() => {
   let pageText = document.getElementsByClassName('el-pagination__jump')[0]
@@ -20,6 +22,7 @@ onMounted(() => {
     pageText.childNodes[0].nodeValue = '跳至'
   }
   pagingQuery()
+  getproductList()
 })
 const filter = () => {
   get('http://81.68.234.235:8032/pdf-tech/vppOrderDetail/pageByCompany', formdata).then(
@@ -40,6 +43,14 @@ const pagingQuery = () => {
       }
     )
 }
+//获取已购买产品
+const getproductList = (val) => {
+  get('http://81.68.234.235:8032/pdf-tech/product/listWithAdmin').then(
+    (res) => {
+      productList.value = res.data.result
+    }
+  )
+}
 //打开对话框
 const handleClick = (val) => {
   dialogVisible.value = true
@@ -72,9 +83,9 @@ const handleCurrentChange = (value) => {
         <span>Content</span>
       </div>
       <div class="flex bg-[#fff] pt-32px px-24px rounded-t-8px w-full">
-        <select name="" id="" class="w-140px">
+        <select v-model="productId" name="" id="" class="w-140px">
           <option value="" disabled selected>Product</option>
-          <option v-for="item in tableData" :key="item.id" :label="item.name" :value="item.id">
+          <option v-for="item in productList" :key="item.id" :label="item.name" :value="item.id">
           </option>
         </select>
         <button @click="filter()" class="

+ 9 - 5
src/views/TeamManagement/ManageTeamOperate.vue

@@ -1,5 +1,5 @@
 <script>
-import { post, put } from '../../../utils/request'
+import { post, put, postWithHeader } from '../../../utils/request'
 
 export default {
   data () {
@@ -74,7 +74,6 @@ export default {
         this.formData.productList[0].licenseNumber = rowData.licenseAmount
       }
     }
-    console.log(rowData)
   },
   methods: {
     // 提交表单
@@ -91,7 +90,6 @@ export default {
         if (this.flag === 'create') this.createTeam()
         if (this.flag === 'edit') this.editTeam()
       }
-      console.log(this.flag, this.formData)
       // this.dialogVisible = true
     },
     // 重置表单
@@ -115,7 +113,13 @@ export default {
     },
     // 创建团队
     createTeam () {
-      post('http://81.68.234.235:8032/pdf-tech/vppTeam/createTeam', this.formData).then((res) => {
+      // const data = {
+      //   data: JSON.stringify(this.formData),
+      //   headers: {
+      //     'Content-Type': 'application/json'
+      //   }
+      // }
+      postWithHeader('http://81.68.234.235:8032/pdf-tech/vppTeam/createTeam', JSON.stringify(this.formData)).then((res) => {
         if (res.data.code === 200) {
           this.$message('Change Success')
         } else (
@@ -125,7 +129,7 @@ export default {
     },
     // 编辑团队
     editTeam () {
-      put('http://81.68.234.235:8032/pdf-tech/vppTeam/editTeam', this.formData).then((res) => {
+      put('http://81.68.234.235:8032/pdf-tech/vppTeam/editTeam', JSON.stringify(this.formData)).then((res) => {
         if (res.data.code === 200) {
           this.$message('Change Success')
         } else (

+ 19 - 0
utils/request.js

@@ -1,8 +1,10 @@
 import axios from 'axios';
 import cookies from 'vue-cookies'
+import Qs from 'qs'
 
 const token = cookies.get('accessToken')
 axios.defaults.headers['authorization'] = `Bearer ${token}`;
+
 // 创建请求实例
 const instance = axios.create({
   baseURL: '/api',
@@ -111,4 +113,21 @@ export function _delete(url, params = {}) {
   });
 }
 
+/**
+ * @param {string} url
+ * @param {object} data
+ */
+export function postWithHeader(url, data = {}) {
+  // data = Qs.stringify(data)
+  return instance({
+    method: 'post',
+    url,
+    data,
+    headers: {
+      'Content-Type': 'application/json'
+    },
+    dataType: "json",
+  });
+}
+
 export default instance;