|
@@ -109,26 +109,52 @@
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <!-- 编辑部门对话框 -->
|
|
|
- <el-dialog v-model="showEditDialogVisible" title="编辑部门">
|
|
|
- <div class="form-edit-dialog">
|
|
|
+
|
|
|
+ <!-- 编辑部门登录框 -->
|
|
|
+ <el-dialog v-model="PeopleLogin" title="供应商请登录">
|
|
|
+ <div class="form-edit-dialog" >
|
|
|
+
|
|
|
<div class="form-item">
|
|
|
- <label for="editDepartmentName" class="label-style">部门名称:</label>
|
|
|
- <input type="text" id="editDepartmentName" v-model="editDepartmentName" placeholder="输入部门名称" class="input-style" />
|
|
|
+ <label for="YourLink" class="label-style">用户账号:</label>
|
|
|
+ <input type="text" id="YourLink" v-model="YourLink" placeholder="输入用户账号" class="input-style" />
|
|
|
</div>
|
|
|
<div class="form-item">
|
|
|
- <label for="editPhoneNumber" class="label-style">联系电话:</label>
|
|
|
- <input type="tel" id="editPhoneNumber" v-model="editPhoneNumber" placeholder="输入联系电话" class="input-style" />
|
|
|
+ <label for="YourPass" class="label-style">用户密码:</label>
|
|
|
+ <input type="text" id="YourPass" v-model="YourPass" placeholder="输入用户密码" class="input-style" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<template #footer>
|
|
|
<span class="dialog-footer" style="margin-top: 20px">
|
|
|
- <el-button type="primary" @click="editDepartment">确定</el-button>
|
|
|
+ <el-button type="primary" @click="queryLogin">确定</el-button>
|
|
|
<el-button @click="showEditDialogVisible = false">取消</el-button>
|
|
|
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
+ <!-- 编辑部门对话框 -->
|
|
|
+ <el-dialog :data="queryLoginID" v-model="showEditDialogVisible" title="编辑部门">
|
|
|
+ <div class="form-edit-dialog">
|
|
|
+ <div class="form-item">
|
|
|
+ <label for="YourID" class="label-style">用户ID:</label>
|
|
|
+ <input type="text" id="YourID" v-model="YourID" placeholder="输入用户账号" class="input-style" />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-item">
|
|
|
+ <label for="departmentName" class="label-style">部门名称:</label>
|
|
|
+ <input prop="foodSupplierLink" type="text" id="departmentName" v-model="departmentName" class="input-style" />
|
|
|
+ </div>
|
|
|
+ <div class="form-item">
|
|
|
+ <label for="phoneNumber" class="label-style">联系电话:</label>
|
|
|
+ <input prop="foodSupplierPass" type="text" id="phoneNumber" v-model="phoneNumber" class="input-style" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <span class="dialog-footer" style="margin-top: 20px">
|
|
|
+ <el-button type="primary" @click="editDepartment">确定</el-button>
|
|
|
+ <el-button @click="showEditDialogVisible = false">取消</el-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -143,6 +169,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
tableData2: [],
|
|
|
+ queryLoginID:[],
|
|
|
tableData: ref([]),
|
|
|
showAddDialog: ref(false),
|
|
|
addDepartmentName: ref(''),
|
|
@@ -152,8 +179,12 @@ export default {
|
|
|
phone: ref(''),
|
|
|
email: ref(''),
|
|
|
showEditDialogVisible: ref(false),
|
|
|
+ PeopleLogin:ref(false),
|
|
|
editDepartmentName: ref(''),
|
|
|
- editPhoneNumber: ref('')
|
|
|
+ editPhoneNumber: ref(''),
|
|
|
+ departmentName: ref(''),
|
|
|
+ phoneNumber: ref(''),
|
|
|
+ YourID:ref('')
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -207,18 +238,52 @@ export default {
|
|
|
this.email.value = '';
|
|
|
},
|
|
|
showEditDialog(department) {
|
|
|
- this.editDepartmentName.value = department.DepartmentName;
|
|
|
- this.editPhoneNumber.value = department.PhoneNumber;
|
|
|
- this.showEditDialogVisible.value = true;
|
|
|
+ this.editDepartmentName = department.DepartmentName;
|
|
|
+ this.editPhoneNumber = department.PhoneNumber;
|
|
|
+ // this.showEditDialogVisible = true;
|
|
|
+ this.PeopleLogin = true;
|
|
|
},
|
|
|
+
|
|
|
+
|
|
|
+ queryLogin(){
|
|
|
+ let querylogin = {
|
|
|
+ FoodSupplierLink:this.YourLink,
|
|
|
+ FoodSupplierPass:this.YourPass,
|
|
|
+ };
|
|
|
+ http.post('/action/FoodSupplierVO/queryLoginlyh',querylogin).then(res =>{
|
|
|
+ console.log(res,"wwwwwwwwwwwwwwwww")
|
|
|
+ this.queryLoginID=res;
|
|
|
+ console.log(this.queryLoginID[0].foodSupplierName)
|
|
|
+ //
|
|
|
+ this.YourID=String(this.queryLoginID[0].foodSupplierID)
|
|
|
+ this.departmentName = String(this.queryLoginID[0].foodSupplierName);
|
|
|
+ console.log(this.departmentName)
|
|
|
+ this.phoneNumber = String(this.queryLoginID[0].foodSupplierLink);
|
|
|
+ this.querypeople()
|
|
|
+ this.showEditDialogVisible = true;
|
|
|
+ }).catch(error=>{
|
|
|
+ console.log(error)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
editDepartment() {
|
|
|
- const index = this.tableData.findIndex(item => item.DepartmentName === this.editDepartmentName.value && item.PhoneNumber === this.editPhoneNumber.value);
|
|
|
- if (index!== -1) {
|
|
|
- this.tableData[index].DepartmentName = this.editDepartmentName.value;
|
|
|
- this.tableData[index].PhoneNumber = this.editPhoneNumber.value;
|
|
|
- }
|
|
|
- this.showEditDialogVisible.value = false;
|
|
|
+ let updatePerson={
|
|
|
+ FoodSupplierID:this.YourID,
|
|
|
+ FoodSupplierName:this.departmentName,
|
|
|
+ FoodSupplierLink:this.phoneNumber,
|
|
|
+ };
|
|
|
+ http.post('/action/FoodSupplierVO/updateSupplier',updatePerson).then(res =>{
|
|
|
+ console.log(res,'这里是改好了数据')
|
|
|
+ alert("修改成功")
|
|
|
+ this.querypeople()
|
|
|
+ this.showEditDialogVisible= false;
|
|
|
+ }).catch(error=>{
|
|
|
+ console.log(error)
|
|
|
+ alert("修改失败")
|
|
|
+ })
|
|
|
+
|
|
|
},
|
|
|
+
|
|
|
deleteDepartment(row){
|
|
|
// 添加确认删除的弹窗
|
|
|
console.log(row.foodSupplierID)
|