更新代码
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-02-21 14:30:17
|
||||
* @LastEditTime: 2023-06-20 15:37:17
|
||||
* @LastEditTime: 2023-06-26 15:32:36
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@@ -15,8 +15,8 @@
|
||||
<el-button type="primary" size="small" @click="conditionSearch">{{ $t("conditionSearch")}}}</el-button>
|
||||
</el-badge>
|
||||
</SearchBar>
|
||||
<base-table id="palletTable" :table-props="tableProps" :page="listQuery.page" ref="palletTable1"
|
||||
:limit="listQuery.limit" :table-data="tableData">
|
||||
<base-table highlight-current-row id="palletTable" :table-props="tableProps" :page="listQuery.page"
|
||||
@current-change="handleCurrentChange" ref="palletTable1" :limit="listQuery.limit" :table-data="tableData">
|
||||
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="100" label="操作" :method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
@@ -49,23 +49,18 @@
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<div class="mod-sys__user">
|
||||
<SearchBar :formConfigs="formConfigMember" ref="ruleForm" @headBtnClick="buttonClick">
|
||||
<SearchBar :formConfigs="formConfigMember" ref="ruleForm" @headBtnClick="teamMemberButtonClick">
|
||||
</SearchBar>
|
||||
<base-table id="palletTable" :table-props="tableProps" :page="listQuery.page" ref="palletTable1"
|
||||
:limit="listQuery.limit" :table-data="tableData">
|
||||
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="100" label="操作" :method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
<base-table id="palletTable" :table-props="depProps" ref="palletTable1" :table-data="teamMemberData">
|
||||
</base-table>
|
||||
<pagination :limit.sync="listQuery.limit" :page.sync="listQuery.page" :total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel"
|
||||
@confirm="handleConfirm" :before-close="handleCancel">
|
||||
<team-add ref="addOrUpdate" @refreshDataList="successSubmit"></team-add>
|
||||
<base-dialog :dialogTitle="teamMemberOrEditTitle" :dialogVisible="teamMemberOrUpdateVisible"
|
||||
@cancel="handleTeamMemberCancel" @confirm="handleTeamMemberConfirm" :before-close="handleTeamMemberCancel">
|
||||
<teamMember-add ref="teamMemberOrUpdate" @refreshDataList="successTeamMemberSubmit"></teamMember-add>
|
||||
<!-- <el-row slot="footer" type="flex" justify="end"> </el-row> -->
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-col>""
|
||||
</el-col>""
|
||||
</el-row>
|
||||
</el-card>
|
||||
</template>
|
||||
@@ -74,12 +69,12 @@
|
||||
import basicPage from "@/mixins/basic-page";
|
||||
import basicSearch from "@/mixins/basic-search";
|
||||
import teamAdd from "./components/team-add";
|
||||
import teamMemberAdd from './components/teamMember-add'
|
||||
import teamSearch from "./components/teamSearch.vue";
|
||||
import Cookies from 'js-cookie'
|
||||
import qs from 'qs'
|
||||
// import radio from "./components/radio.vue";
|
||||
import i18n from "@/i18n";
|
||||
// import i18n from "@/i18n";
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "teamCode",
|
||||
@@ -98,6 +93,16 @@ const tableProps = [
|
||||
label: i18n.t('basic.remark')
|
||||
},
|
||||
];
|
||||
const depProps = [
|
||||
{
|
||||
prop: "departName",
|
||||
label: i18n.t('basic.departName')
|
||||
},
|
||||
{
|
||||
prop: "userName",
|
||||
label: i18n.t('basic.userName')
|
||||
}
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
@@ -116,11 +121,17 @@ export default {
|
||||
getDataListURL: "/basic/qmsTeam/page",
|
||||
deleteURL: "/basic/qmsTeam",
|
||||
exportURL: "/basic/qmsTeam/export",
|
||||
teamMemberURL: '/basic/qmsTeamMember/page'
|
||||
},
|
||||
tableProps,
|
||||
depProps,
|
||||
teamId:null,
|
||||
teamMemberData: [],
|
||||
teamMemberOrEditTitle:'',
|
||||
tableBtn,
|
||||
productData: {},
|
||||
addOrUpdateVisible: false,
|
||||
teamMemberOrUpdateVisible:false,
|
||||
searchOrEditTitle: "",
|
||||
addOrEditTitle: '',
|
||||
searchOrUpdateVisible: false,
|
||||
@@ -156,7 +167,14 @@ export default {
|
||||
name: i18n.t('export'),
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
}
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "取消选中",
|
||||
name: "cancel",
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
},
|
||||
],
|
||||
formConfigMember: [
|
||||
// {
|
||||
@@ -180,14 +198,37 @@ export default {
|
||||
},
|
||||
components: {
|
||||
teamAdd,
|
||||
teamMemberAdd,
|
||||
teamSearch
|
||||
},
|
||||
// mounted() {
|
||||
// this.getDepData()
|
||||
// },
|
||||
methods: {
|
||||
//search-bar点击
|
||||
handleProductCancel() {
|
||||
this.productOrUpdateVisible = false;
|
||||
this.productOrEditTitle = "";
|
||||
},
|
||||
setCurrent(index) {
|
||||
this.$refs.palletTable1.setCurrent("palletTable", index)
|
||||
console.log(index)
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.teamId = val.newVal.id
|
||||
this.$http.get(this.urlOptions.teamMemberURL, {
|
||||
params: {
|
||||
limit: 999,
|
||||
page: 1,
|
||||
teamId:val.newVal.id
|
||||
}
|
||||
}).then(({ data: res } ) => {
|
||||
console.log(res)
|
||||
if (res && res.code === 0) {
|
||||
this.teamMemberData = res.data.list
|
||||
}
|
||||
})
|
||||
},
|
||||
// handleSearchCancel() {
|
||||
// this.searchOrEditTitle = "";
|
||||
// this.searchOrUpdateVisible = false;
|
||||
@@ -268,7 +309,7 @@ export default {
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
})
|
||||
.catch(() => { });
|
||||
} else if (val.type === 'edit') {
|
||||
@@ -279,6 +320,41 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
successTeamMemberSubmit() {
|
||||
this.handleTeamMemberCancel()
|
||||
this.$http.get(this.urlOptions.teamMemberURL, {
|
||||
params: {
|
||||
limit: 999,
|
||||
page: 1,
|
||||
teamId: this.teamId
|
||||
}
|
||||
}).then(({ data: res } ) => {
|
||||
if (res && res.code === 0) {
|
||||
this.teamMemberData = res.data.list
|
||||
}
|
||||
});
|
||||
},
|
||||
handleTeamMemberCancel() {
|
||||
this.teamMemberOrUpdateVisible = false
|
||||
this.teamMemberOrEditTitle = ''
|
||||
},
|
||||
teamMemberButtonClick(val) {
|
||||
console.log(val);
|
||||
switch (val.btnName) {
|
||||
case "change":
|
||||
this.teamMemberOrEditTitle = '修改团队成员'
|
||||
this.teamMemberOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.teamMemberOrUpdate.init(this.teamId)
|
||||
});
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
handleTeamMemberConfirm() {
|
||||
this.$refs.teamMemberOrUpdate.dataFormSubmit()
|
||||
},
|
||||
buttonClick(val) {
|
||||
console.log(val);
|
||||
switch (val.btnName) {
|
||||
@@ -301,6 +377,9 @@ export default {
|
||||
this.$refs.addOrUpdate.init();
|
||||
});
|
||||
break;
|
||||
case "cancel":
|
||||
this.$refs.palletTable1.setCurrent("palletTable", -1);
|
||||
break;
|
||||
// case "correlation":
|
||||
// this.productOrEditTitle = "产品";
|
||||
// this.productOrUpdateVisible = true;
|
||||
|
||||
Reference in New Issue
Block a user