|
|
|
@ -1,134 +1,124 @@
|
|
|
|
|
<template>
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="分配供应商"
|
|
|
|
|
:visible.sync="showFlag"
|
|
|
|
|
width="1000px"
|
|
|
|
|
append-to-body
|
|
|
|
|
>
|
|
|
|
|
<el-form ref="form1" label-width="80px">
|
|
|
|
|
<el-form-item label="目标id" prop="belongGoalId">
|
|
|
|
|
<el-input v-model="belongGoalId" disabled />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<el-tabs type="border-card" v-if="belongGoalId != null">
|
|
|
|
|
<el-tab-pane label="分配供应商">
|
|
|
|
|
<div>
|
|
|
|
|
<div class="query">
|
|
|
|
|
<el-input
|
|
|
|
|
style="width: 351px; margin-bottom: 10px"
|
|
|
|
|
v-model="leftQueryParams.supplierName"
|
|
|
|
|
placeholder="请输入内容"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
<el-input
|
|
|
|
|
style="width: 351px; margin-bottom: 10px"
|
|
|
|
|
v-model="rightQueryParams.supplierName"
|
|
|
|
|
placeholder="请输入内容"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<el-transfer
|
|
|
|
|
v-model="rightList"
|
|
|
|
|
:data="leftList"
|
|
|
|
|
:titles="titles"
|
|
|
|
|
:filterable="true"
|
|
|
|
|
@change="handleChange"
|
|
|
|
|
>
|
|
|
|
|
<!-- 左侧栏分页 -->
|
|
|
|
|
<el-button
|
|
|
|
|
type="text"
|
|
|
|
|
style="color: #606266"
|
|
|
|
|
v-if="leftLength != 0"
|
|
|
|
|
class="transfer-footer"
|
|
|
|
|
slot="left-footer"
|
|
|
|
|
size="small"
|
|
|
|
|
>共{{ Ltotal }}条</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="leftLength != 0"
|
|
|
|
|
class="transfer-footer"
|
|
|
|
|
slot="left-footer"
|
|
|
|
|
size="small"
|
|
|
|
|
@click="leftPageNumChange"
|
|
|
|
|
:disabled="LPageNum - 1 < 1"
|
|
|
|
|
>上一页</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-input
|
|
|
|
|
v-if="leftLength != 0"
|
|
|
|
|
v-model="LPageNum"
|
|
|
|
|
size="mini"
|
|
|
|
|
class="transfer-footer"
|
|
|
|
|
slot="left-footer"
|
|
|
|
|
:placeholder="LPageNum"
|
|
|
|
|
style="width: 67px; padding: 1px 3px"
|
|
|
|
|
disabled
|
|
|
|
|
></el-input>
|
|
|
|
|
<el-button
|
|
|
|
|
class="transfer-footer"
|
|
|
|
|
slot="left-footer"
|
|
|
|
|
size="small"
|
|
|
|
|
@click="leftAddPageNumChange"
|
|
|
|
|
v-if="leftLength != 0"
|
|
|
|
|
:disabled="LNextPage > LPages"
|
|
|
|
|
>下一页</el-button
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
<!-- 右侧栏分页 -->
|
|
|
|
|
<el-button
|
|
|
|
|
type="text"
|
|
|
|
|
style="color: #606266"
|
|
|
|
|
v-if="rightLength != 0"
|
|
|
|
|
class="transfer-footer"
|
|
|
|
|
slot="right-footer"
|
|
|
|
|
size="small"
|
|
|
|
|
>共{{ Rtotal }}条</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="rightLength != 0"
|
|
|
|
|
class="transfer-footer"
|
|
|
|
|
slot="right-footer"
|
|
|
|
|
size="small"
|
|
|
|
|
@click="rightPageNumChange"
|
|
|
|
|
:disabled="RPageNum - 1 < 1"
|
|
|
|
|
>上一页</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-input
|
|
|
|
|
v-if="rightLength != 0"
|
|
|
|
|
v-model="RPageNum"
|
|
|
|
|
size="mini"
|
|
|
|
|
class="transfer-footer"
|
|
|
|
|
slot="right-footer"
|
|
|
|
|
:placeholder="RPageNum"
|
|
|
|
|
style="width: 43px"
|
|
|
|
|
></el-input>
|
|
|
|
|
<el-button
|
|
|
|
|
class="transfer-footer"
|
|
|
|
|
slot="right-footer"
|
|
|
|
|
size="small"
|
|
|
|
|
@click="rightAddPageNumChange"
|
|
|
|
|
v-if="rightLength != 0"
|
|
|
|
|
:disabled="RNextPage > RPages"
|
|
|
|
|
>下一页</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-transfer>
|
|
|
|
|
<div>
|
|
|
|
|
<el-form ref="form1" label-width="80px">
|
|
|
|
|
<el-form-item label="目标id" prop="belongGoalId">
|
|
|
|
|
<el-input v-model="belongGoalId" disabled />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<el-tabs type="border-card" v-if="belongGoalId != null">
|
|
|
|
|
<el-tab-pane :label="disTitle">
|
|
|
|
|
<div>
|
|
|
|
|
<div class="query">
|
|
|
|
|
<el-input
|
|
|
|
|
style="width: 351px; margin-bottom: 10px"
|
|
|
|
|
v-model="leftQueryParams.supplierName"
|
|
|
|
|
placeholder="请输入内容"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
<el-input
|
|
|
|
|
style="width: 351px; margin-bottom: 10px"
|
|
|
|
|
v-model="rightQueryParams.supplierName"
|
|
|
|
|
placeholder="请输入内容"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
</el-tabs>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<el-transfer
|
|
|
|
|
v-model="rightList"
|
|
|
|
|
:data="leftList"
|
|
|
|
|
:titles="titles"
|
|
|
|
|
:filterable="true"
|
|
|
|
|
@change="handleChange"
|
|
|
|
|
>
|
|
|
|
|
<!-- 左侧栏分页 -->
|
|
|
|
|
<el-button
|
|
|
|
|
type="text"
|
|
|
|
|
style="color: #606266"
|
|
|
|
|
v-if="leftLength != 0"
|
|
|
|
|
class="transfer-footer"
|
|
|
|
|
slot="left-footer"
|
|
|
|
|
size="small"
|
|
|
|
|
>共{{ Ltotal }}条</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="leftLength != 0"
|
|
|
|
|
class="transfer-footer"
|
|
|
|
|
slot="left-footer"
|
|
|
|
|
size="small"
|
|
|
|
|
@click="leftPageNumChange"
|
|
|
|
|
:disabled="LPageNum - 1 < 1"
|
|
|
|
|
>上一页</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-input
|
|
|
|
|
v-if="leftLength != 0"
|
|
|
|
|
v-model="LPageNum"
|
|
|
|
|
size="mini"
|
|
|
|
|
class="transfer-footer"
|
|
|
|
|
slot="left-footer"
|
|
|
|
|
:placeholder="LPageNum"
|
|
|
|
|
style="width: 67px; padding: 1px 3px"
|
|
|
|
|
disabled
|
|
|
|
|
></el-input>
|
|
|
|
|
<el-button
|
|
|
|
|
class="transfer-footer"
|
|
|
|
|
slot="left-footer"
|
|
|
|
|
size="small"
|
|
|
|
|
@click="leftAddPageNumChange"
|
|
|
|
|
v-if="leftLength != 0"
|
|
|
|
|
:disabled="LNextPage > LPages"
|
|
|
|
|
>下一页</el-button
|
|
|
|
|
>
|
|
|
|
|
<!-- 右侧栏分页 -->
|
|
|
|
|
<el-button
|
|
|
|
|
type="text"
|
|
|
|
|
style="color: #606266"
|
|
|
|
|
v-if="rightLength != 0"
|
|
|
|
|
class="transfer-footer"
|
|
|
|
|
slot="right-footer"
|
|
|
|
|
size="small"
|
|
|
|
|
>共{{ Rtotal }}条</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="rightLength != 0"
|
|
|
|
|
class="transfer-footer"
|
|
|
|
|
slot="right-footer"
|
|
|
|
|
size="small"
|
|
|
|
|
@click="rightPageNumChange"
|
|
|
|
|
:disabled="RPageNum - 1 < 1"
|
|
|
|
|
>上一页</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-input
|
|
|
|
|
v-if="rightLength != 0"
|
|
|
|
|
v-model="RPageNum"
|
|
|
|
|
size="mini"
|
|
|
|
|
class="transfer-footer"
|
|
|
|
|
slot="right-footer"
|
|
|
|
|
:placeholder="RPageNum"
|
|
|
|
|
style="width: 43px"
|
|
|
|
|
></el-input>
|
|
|
|
|
<el-button
|
|
|
|
|
class="transfer-footer"
|
|
|
|
|
slot="right-footer"
|
|
|
|
|
size="small"
|
|
|
|
|
@click="rightAddPageNumChange"
|
|
|
|
|
v-if="rightLength != 0"
|
|
|
|
|
:disabled="RNextPage > RPages"
|
|
|
|
|
>下一页</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-transfer>
|
|
|
|
|
</div>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
</el-tabs>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { getLeftList, getRightList, addSupplier } from "@/api/quality/qcGoalDistribute";
|
|
|
|
|
import { getLeftList, getRightList, addSupplier, getProductLeftList, getProductRightList } from "@/api/quality/qcGoalDistribute";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "QcGoalDistriBute",
|
|
|
|
|
|
|
|
|
|
props: ['belongGoalId','mode','disTitle'],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// 遮罩层
|
|
|
|
@ -145,6 +135,7 @@ export default {
|
|
|
|
|
total: 0,
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
|
model: null,
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
showFlag: false,
|
|
|
|
|
// 查询参数
|
|
|
|
@ -170,7 +161,7 @@ export default {
|
|
|
|
|
//--------------------->
|
|
|
|
|
leftList: [],
|
|
|
|
|
rightList: [],
|
|
|
|
|
titles: ["未关联供应商", "已关联供应商"],
|
|
|
|
|
titles: ["未分配", "已分配"],
|
|
|
|
|
// 左侧分页数据
|
|
|
|
|
Ltotal: "",
|
|
|
|
|
LPageNum: "1",
|
|
|
|
@ -199,12 +190,23 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
props: {
|
|
|
|
|
belongGoalId:undefined,
|
|
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
|
if (this.belongGoalId) {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.getRightListFun();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
belongGoalId(newVal,oldVal) {
|
|
|
|
|
console.log(newVal);
|
|
|
|
|
if(newVal !== oldVal) {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.getRightListFun();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// // 穿梭框搜索
|
|
|
|
@ -221,14 +223,26 @@ export default {
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
this.leftQueryParams.belongGoalId = this.belongGoalId;
|
|
|
|
|
getLeftList(this.leftQueryParams).then((response) => {
|
|
|
|
|
this.LPages = Math.ceil(response.total / this.LPageSize);
|
|
|
|
|
this.leftList = response.rows;
|
|
|
|
|
this.Ltotal = response.total;
|
|
|
|
|
this.LPageNum = this.leftQueryParams.pageNum;
|
|
|
|
|
this.LNextPage = this.leftQueryParams.pageNum + 1;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
if(this.mode) {
|
|
|
|
|
getLeftList(this.leftQueryParams).then((response) => {
|
|
|
|
|
this.LPages = Math.ceil(response.total / this.LPageSize);
|
|
|
|
|
this.leftList = response.rows;
|
|
|
|
|
this.Ltotal = response.total;
|
|
|
|
|
this.LPageNum = this.leftQueryParams.pageNum;
|
|
|
|
|
this.LNextPage = this.leftQueryParams.pageNum + 1;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
getProductLeftList(this.leftQueryParams).then((response) => {
|
|
|
|
|
this.LPages = Math.ceil(response.total / this.LPageSize);
|
|
|
|
|
this.leftList = response.rows;
|
|
|
|
|
this.Ltotal = response.total;
|
|
|
|
|
this.LPageNum = this.leftQueryParams.pageNum;
|
|
|
|
|
this.LNextPage = this.leftQueryParams.pageNum + 1;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
/**左边上一页**/
|
|
|
|
|
leftPageNumChange() {
|
|
|
|
@ -249,23 +263,36 @@ export default {
|
|
|
|
|
getRightListFun() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
this.rightQueryParams.belongGoalId = this.belongGoalId;
|
|
|
|
|
getRightList(this.rightQueryParams).then((response) => {
|
|
|
|
|
this.RPages = Math.ceil(response.total / this.RPageSize);
|
|
|
|
|
let dataright = [];
|
|
|
|
|
for (let i in response.rows) {
|
|
|
|
|
// 将返回的列表赋值于穿梭框左边列表
|
|
|
|
|
dataright.push(response.rows[i].key);
|
|
|
|
|
}
|
|
|
|
|
this.rightList = dataright;
|
|
|
|
|
this.Rtotal = response.total;
|
|
|
|
|
this.RPageNum = this.rightQueryParams.pageNum;
|
|
|
|
|
this.RNextPage = this.rightQueryParams.pageNum + 1;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.error('获取右侧列表数据失败:', error);
|
|
|
|
|
this.loading = false;
|
|
|
|
|
// 可以在这里添加一些错误处理的逻辑
|
|
|
|
|
});
|
|
|
|
|
if(this.mode) {
|
|
|
|
|
getRightList(this.rightQueryParams).then((response) => {
|
|
|
|
|
this.RPages = Math.ceil(response.total / this.RPageSize);
|
|
|
|
|
let dataright = [];
|
|
|
|
|
for (let i in response.rows) {
|
|
|
|
|
// 将返回的列表赋值于穿梭框左边列表
|
|
|
|
|
dataright.push(response.rows[i].key);
|
|
|
|
|
}
|
|
|
|
|
this.rightList = dataright;
|
|
|
|
|
this.Rtotal = response.total;
|
|
|
|
|
this.RPageNum = this.rightQueryParams.pageNum;
|
|
|
|
|
this.RNextPage = this.rightQueryParams.pageNum + 1;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
getProductRightList(this.rightQueryParams).then((response) => {
|
|
|
|
|
this.RPages = Math.ceil(response.total / this.RPageSize);
|
|
|
|
|
let dataright = [];
|
|
|
|
|
for (let i in response.rows) {
|
|
|
|
|
// 将返回的列表赋值于穿梭框左边列表
|
|
|
|
|
dataright.push(response.rows[i].key);
|
|
|
|
|
}
|
|
|
|
|
this.rightList = dataright;
|
|
|
|
|
this.Rtotal = response.total;
|
|
|
|
|
this.RPageNum = this.rightQueryParams.pageNum;
|
|
|
|
|
this.RNextPage = this.rightQueryParams.pageNum + 1;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
/**右边上一页**/
|
|
|
|
|
rightPageNumChange() {
|
|
|
|
@ -280,11 +307,6 @@ export default {
|
|
|
|
|
this.getRightListFun();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|
this.showFlag = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
},
|
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
|
|
|
|
this.form = {
|
|
|
|
@ -322,11 +344,6 @@ export default {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 提交 */
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.showFlag = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|