|
|
@ -1,90 +1,114 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<el-input placeholder="请输入内容" clearable > </el-input>
|
|
|
|
<div class="query">
|
|
|
|
<el-transfer v-model="rightList" :data="leftList" :titles="titles"
|
|
|
|
<el-input
|
|
|
|
:filterable=false
|
|
|
|
style="width: 351px; margin-bottom: 10px"
|
|
|
|
@change="handleChange"
|
|
|
|
v-model="leftQueryParams.materialName"
|
|
|
|
>
|
|
|
|
placeholder="请输入内容"
|
|
|
|
<!-- 左侧栏分页 -->
|
|
|
|
clearable
|
|
|
|
<el-button
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
type="text"
|
|
|
|
/>
|
|
|
|
style="color:#606266"
|
|
|
|
<el-input
|
|
|
|
v-if="leftLength != 0"
|
|
|
|
style="width: 351px; margin-bottom: 10px"
|
|
|
|
class="transfer-footer"
|
|
|
|
v-model="rightQueryParams.materialName"
|
|
|
|
slot="left-footer"
|
|
|
|
placeholder="请输入内容"
|
|
|
|
size="small"
|
|
|
|
clearable
|
|
|
|
>共{{ Ltotal }}条</el-button>
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
<el-button
|
|
|
|
/>
|
|
|
|
v-if="leftLength != 0"
|
|
|
|
</div>
|
|
|
|
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-transfer
|
|
|
|
<el-button
|
|
|
|
v-model="rightList"
|
|
|
|
type="text"
|
|
|
|
:data="leftList"
|
|
|
|
style="color:#606266"
|
|
|
|
:titles="titles"
|
|
|
|
v-if="rightLength != 0"
|
|
|
|
:filterable="true"
|
|
|
|
class="transfer-footer"
|
|
|
|
@change="handleChange"
|
|
|
|
slot="right-footer"
|
|
|
|
>
|
|
|
|
size="small"
|
|
|
|
<!-- 左侧栏分页 -->
|
|
|
|
>共{{ Rtotal }}条</el-button>
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
type="text"
|
|
|
|
v-if="rightLength != 0"
|
|
|
|
style="color: #606266"
|
|
|
|
class="transfer-footer"
|
|
|
|
v-if="leftLength != 0"
|
|
|
|
slot="right-footer"
|
|
|
|
class="transfer-footer"
|
|
|
|
size="small"
|
|
|
|
slot="left-footer"
|
|
|
|
@click="rightPageNumChange"
|
|
|
|
size="small"
|
|
|
|
:disabled="RPageNum - 1 < 1"
|
|
|
|
>共{{ Ltotal }}条</el-button
|
|
|
|
>上一页</el-button>
|
|
|
|
>
|
|
|
|
<el-input
|
|
|
|
<el-button
|
|
|
|
v-if="rightLength != 0"
|
|
|
|
v-if="leftLength != 0"
|
|
|
|
v-model="RPageNum"
|
|
|
|
class="transfer-footer"
|
|
|
|
size="mini"
|
|
|
|
slot="left-footer"
|
|
|
|
class="transfer-footer"
|
|
|
|
size="small"
|
|
|
|
slot="right-footer"
|
|
|
|
@click="leftPageNumChange"
|
|
|
|
:placeholder="RPageNum"
|
|
|
|
:disabled="LPageNum - 1 < 1"
|
|
|
|
style="width: 43px"
|
|
|
|
>上一页</el-button
|
|
|
|
></el-input>
|
|
|
|
>
|
|
|
|
<el-button
|
|
|
|
<el-input
|
|
|
|
class="transfer-footer"
|
|
|
|
v-if="leftLength != 0"
|
|
|
|
slot="right-footer"
|
|
|
|
v-model="LPageNum"
|
|
|
|
size="small"
|
|
|
|
size="mini"
|
|
|
|
@click="rightAddPageNumChange"
|
|
|
|
class="transfer-footer"
|
|
|
|
v-if="rightLength != 0"
|
|
|
|
slot="left-footer"
|
|
|
|
:disabled="RNextPage>RPages"
|
|
|
|
:placeholder="LPageNum"
|
|
|
|
>下一页</el-button>
|
|
|
|
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-transfer>
|
|
|
|
<!-- 右侧栏分页 -->
|
|
|
|
|
|
|
|
<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>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import { getListProduct,getRightList ,addProduct, updateProduct, getProduct, delProduct} from "@/api/quality/userbind";
|
|
|
|
import { getListProduct,getRightList ,addProduct} from "@/api/quality/userbind";
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: "UserBind",
|
|
|
|
name: "Routeprodproduct",
|
|
|
|
|
|
|
|
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
@ -113,8 +137,8 @@ export default {
|
|
|
|
pageNum: 1,
|
|
|
|
pageNum: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
pageSize: 10,
|
|
|
|
userCodes: this.userCodes,
|
|
|
|
userCodes: this.userCodes,
|
|
|
|
materialId: null,
|
|
|
|
itemId: null,
|
|
|
|
materialCode: null,
|
|
|
|
itemCode: null,
|
|
|
|
materialName: null,
|
|
|
|
materialName: null,
|
|
|
|
specification: null,
|
|
|
|
specification: null,
|
|
|
|
unitOfMeasure: null,
|
|
|
|
unitOfMeasure: null,
|
|
|
@ -124,11 +148,13 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 表单参数
|
|
|
|
// 表单参数
|
|
|
|
form: {},
|
|
|
|
form: {},
|
|
|
|
|
|
|
|
// 分页
|
|
|
|
|
|
|
|
page: { pageNo: 1, pageSize: 20, total: 0 },
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------->
|
|
|
|
//--------------------->
|
|
|
|
leftList: [],
|
|
|
|
leftList: [],
|
|
|
|
rightList: [],
|
|
|
|
rightList: [],
|
|
|
|
titles:['未关联物料','已关联物料'],
|
|
|
|
titles: ["未关联产品", "已关联产品"],
|
|
|
|
// 左侧分页数据
|
|
|
|
// 左侧分页数据
|
|
|
|
Ltotal: "",
|
|
|
|
Ltotal: "",
|
|
|
|
LPageNum: "1",
|
|
|
|
LPageNum: "1",
|
|
|
@ -137,10 +163,11 @@ export default {
|
|
|
|
LPages: null,
|
|
|
|
LPages: null,
|
|
|
|
leftLength: null,
|
|
|
|
leftLength: null,
|
|
|
|
leftQueryParams: {
|
|
|
|
leftQueryParams: {
|
|
|
|
userCodes: this.userCodes,
|
|
|
|
materialName: null,
|
|
|
|
|
|
|
|
userCodes: this.userCodes,
|
|
|
|
pageNum: 1,
|
|
|
|
pageNum: 1,
|
|
|
|
pageSize: 20
|
|
|
|
pageSize: 20,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 右侧分页数据
|
|
|
|
// 右侧分页数据
|
|
|
|
Rtotal: "",
|
|
|
|
Rtotal: "",
|
|
|
|
RPageNum: "1",
|
|
|
|
RPageNum: "1",
|
|
|
@ -149,42 +176,53 @@ export default {
|
|
|
|
rightLength: null,
|
|
|
|
rightLength: null,
|
|
|
|
RNextPage: null,
|
|
|
|
RNextPage: null,
|
|
|
|
rightQueryParams: {
|
|
|
|
rightQueryParams: {
|
|
|
|
userCodes: this.userCodes,
|
|
|
|
materialName: null,
|
|
|
|
|
|
|
|
userCodes: this.userCodes,
|
|
|
|
pageNum: 1,
|
|
|
|
pageNum: 1,
|
|
|
|
pageSize: 20
|
|
|
|
pageSize: 20,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
props :{
|
|
|
|
props: {
|
|
|
|
userCodes: undefined,
|
|
|
|
userCodes: undefined,
|
|
|
|
optType: undefined
|
|
|
|
optType: undefined,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
this.getList();
|
|
|
|
this.getList();
|
|
|
|
this.getRightListFun();
|
|
|
|
this.getRightListFun();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
// // 穿梭框搜索
|
|
|
|
|
|
|
|
// filterMethod(keyword, row) {
|
|
|
|
|
|
|
|
// console.log(keyword, row);
|
|
|
|
|
|
|
|
// return row.label.indexOf(keyword) > -1;
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// 查询
|
|
|
|
|
|
|
|
handleQuery() {
|
|
|
|
|
|
|
|
this.getList();
|
|
|
|
|
|
|
|
this.getRightListFun();
|
|
|
|
|
|
|
|
},
|
|
|
|
/** 查询未分配产品列表 */
|
|
|
|
/** 查询未分配产品列表 */
|
|
|
|
getList() {
|
|
|
|
getList() {
|
|
|
|
this.loading = true;
|
|
|
|
this.loading = true;
|
|
|
|
getListProduct(this.leftQueryParams).then(response => {
|
|
|
|
getListProduct(this.leftQueryParams).then((response) => {
|
|
|
|
this.LPages = Math.ceil(response.total/this.LPageSize)
|
|
|
|
this.LPages = Math.ceil(response.total / this.LPageSize);
|
|
|
|
this.leftList = response.rows;
|
|
|
|
this.leftList = response.rows;
|
|
|
|
this.Ltotal = response.total;
|
|
|
|
this.Ltotal = response.total;
|
|
|
|
this.LPageNum = this.leftQueryParams.pageNum;
|
|
|
|
this.LPageNum = this.leftQueryParams.pageNum;
|
|
|
|
this.LNextPage = this.leftQueryParams.pageNum+1;
|
|
|
|
this.LNextPage = this.leftQueryParams.pageNum + 1;
|
|
|
|
this.loading = false;
|
|
|
|
this.loading = false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/**左边上一页**/
|
|
|
|
/**左边上一页**/
|
|
|
|
leftPageNumChange(){
|
|
|
|
leftPageNumChange() {
|
|
|
|
this.leftQueryParams.pageNum = this.LPageNum-1;
|
|
|
|
this.leftQueryParams.pageNum = this.LPageNum - 1;
|
|
|
|
this.loading = true;
|
|
|
|
this.loading = true;
|
|
|
|
this.getList();
|
|
|
|
this.getList();
|
|
|
|
this.getRightListFun();
|
|
|
|
this.getRightListFun();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/**左边下一页**/
|
|
|
|
/**左边下一页**/
|
|
|
|
leftAddPageNumChange(){
|
|
|
|
leftAddPageNumChange() {
|
|
|
|
this.leftQueryParams.pageNum = this.LNextPage;
|
|
|
|
this.leftQueryParams.pageNum = this.LNextPage;
|
|
|
|
this.loading = true;
|
|
|
|
this.loading = true;
|
|
|
|
this.getList();
|
|
|
|
this.getList();
|
|
|
@ -194,36 +232,34 @@ export default {
|
|
|
|
/** 查询已分配产品列表 -------------------------------*/
|
|
|
|
/** 查询已分配产品列表 -------------------------------*/
|
|
|
|
getRightListFun() {
|
|
|
|
getRightListFun() {
|
|
|
|
this.loading = true;
|
|
|
|
this.loading = true;
|
|
|
|
getRightList(this.rightQueryParams).then(response => {
|
|
|
|
getRightList(this.rightQueryParams).then((response) => {
|
|
|
|
this.RPages = Math.ceil(response.total/this.RPageSize);
|
|
|
|
this.RPages = Math.ceil(response.total / this.RPageSize);
|
|
|
|
|
|
|
|
|
|
|
|
const dataright = [];
|
|
|
|
const dataright = [];
|
|
|
|
for(let i in response.rows){
|
|
|
|
for (let i in response.rows) {
|
|
|
|
// 将返回的列表赋值于穿梭框左边列表
|
|
|
|
// 将返回的列表赋值于穿梭框左边列表
|
|
|
|
dataright.push(response.rows[i].key)
|
|
|
|
dataright.push(response.rows[i].key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.rightList = dataright;
|
|
|
|
this.rightList = dataright;
|
|
|
|
|
|
|
|
this.Rtotal = response.total;
|
|
|
|
this.Rtotal = response.total;
|
|
|
|
|
|
|
|
this.RPageNum = this.rightQueryParams.pageNum;
|
|
|
|
this.RPageNum = this.rightQueryParams.pageNum;
|
|
|
|
this.RNextPage = this.rightQueryParams.pageNum+1;
|
|
|
|
this.RNextPage = this.rightQueryParams.pageNum + 1;
|
|
|
|
this.loading = false;
|
|
|
|
this.loading = false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/**右边上一页**/
|
|
|
|
/**右边上一页**/
|
|
|
|
rightPageNumChange(){
|
|
|
|
rightPageNumChange() {
|
|
|
|
this.rightQueryParams.pageNum = this.RPageNum-1;
|
|
|
|
this.rightQueryParams.pageNum = this.RPageNum - 1;
|
|
|
|
this.loading = true;
|
|
|
|
this.loading = true;
|
|
|
|
this.getRightListFun();
|
|
|
|
this.getRightListFun();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/**右边下一页**/
|
|
|
|
/**右边下一页**/
|
|
|
|
rightAddPageNumChange(){
|
|
|
|
rightAddPageNumChange() {
|
|
|
|
this.rightQueryParams.pageNum = this.RNextPage;
|
|
|
|
this.rightQueryParams.pageNum = this.RNextPage;
|
|
|
|
this.loading = true;
|
|
|
|
this.loading = true;
|
|
|
|
this.getRightListFun();
|
|
|
|
this.getRightListFun();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 取消按钮
|
|
|
|
// 取消按钮
|
|
|
|
cancel() {
|
|
|
|
cancel() {
|
|
|
|
this.open = false;
|
|
|
|
this.open = false;
|
|
|
@ -233,9 +269,9 @@ export default {
|
|
|
|
reset() {
|
|
|
|
reset() {
|
|
|
|
this.form = {
|
|
|
|
this.form = {
|
|
|
|
recordId: null,
|
|
|
|
recordId: null,
|
|
|
|
userCodes: this.userCodes,
|
|
|
|
userCodes: this. userCodes,
|
|
|
|
materialId: null,
|
|
|
|
itemId: null,
|
|
|
|
materialCode: null,
|
|
|
|
itemCode: null,
|
|
|
|
materialName: null,
|
|
|
|
materialName: null,
|
|
|
|
specification: null,
|
|
|
|
specification: null,
|
|
|
|
unitOfMeasure: null,
|
|
|
|
unitOfMeasure: null,
|
|
|
@ -246,24 +282,29 @@ export default {
|
|
|
|
createBy: null,
|
|
|
|
createBy: null,
|
|
|
|
createTime: null,
|
|
|
|
createTime: null,
|
|
|
|
updateBy: null,
|
|
|
|
updateBy: null,
|
|
|
|
updateTime: null
|
|
|
|
updateTime: null,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
/** 提交按钮 */
|
|
|
|
handleChange(value, direction, movedKeys) {
|
|
|
|
handleChange(value, direction, movedKeys) {
|
|
|
|
if (this.queryParams.userCodes != null) {
|
|
|
|
if (this.queryParams. userCodes != null) {
|
|
|
|
this.queryParams.selectedValues = value;
|
|
|
|
this.queryParams.selectedValues = value;
|
|
|
|
addProduct(this.queryParams).then(response => {
|
|
|
|
addProduct(this.queryParams).then((response) => {
|
|
|
|
this.$modal.msgSuccess("关联成功");
|
|
|
|
this.$modal.msgSuccess("关联成功");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
<style>
|
|
|
|
<style>
|
|
|
|
.el-transfer-panel {
|
|
|
|
.el-transfer-panel {
|
|
|
|
width: 350px;
|
|
|
|
width: 350px;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
.query{
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
|
|
padding-right: 4px;
|
|
|
|
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|