白坯订单管理生产工艺页面优化

master
李靖 1 year ago
parent bc7ca954be
commit cab0992134

@ -244,7 +244,28 @@
<el-form ref="form" :model="form" :rules="addrules" label-width="80px">
<!-- 第一行 -->
<el-row>
<div class="tagbox">
<div class="tagboxlabel">物料名称</div>
<div class="tag" style="">
<el-tag
:key="index"
class="tagitem"
v-for="(tag,index) in selectMaterielListtag"
closable
:disable-transitions="false"
@close="handleClose(tag)"
>
{{ tag.productDescZh }}
</el-tag>
</div>
<el-button
class="button1"
icon="el-icon-search"
circle
@click="selectMateriel()"
></el-button>
</div>
<el-row style="display: none;">
<!-- 第一列 -->
<el-col :offset="1" :span="18">
@ -529,6 +550,8 @@ export default {
splitOpen: false,
// -list
selectMaterielList: [],
// -listtag
selectMaterielListtag:[],
// -list
materielList: [],
// --
@ -963,10 +986,23 @@ export default {
...this.queryParams
}, `whiteOrder_${new Date().getTime()}.xlsx`)
},
//
handleClose(tag) {
this.selectMaterielListtag.splice(this.selectMaterielListtag.indexOf(tag.productDescZh), 1);
this.form.prodCode =''
this.form.prodDesc =''
var code = "";
var desc = "";
for (let i = 0; i < this.selectMaterielListtag.length; i++) {
code = code + this.selectMaterielListtag[i].productCode + ",";
desc = desc + this.selectMaterielListtag[i].productDescZh + ",";
}
this.form.prodCode += code;
this.form.prodDesc += desc;
},
// --
subMateriel() {
console.log("点击了物料-确定")
if (this.selectMaterielList.length < 1) {
this.$message({
message: '至少选择一个物料!',
@ -974,12 +1010,17 @@ export default {
})
return
}
console.log(this.form.prodCode == '')
// if(this.form.prodCode == '' ){
// this.selectMaterielListtag = this.selectMaterielList
// }
var code = '';
var desc = '';
for (let i = 0; i < this.selectMaterielList.length; i++) {
if(this.form.prodCode.indexOf(this.selectMaterielList[i].productCode)<0){
code = code + this.selectMaterielList[i].productCode + ',';
this.selectMaterielListtag.push(this.selectMaterielList[i])
}else{
this.$message({
message: this.selectMaterielList[i].productDescZh+'已经选择',
@ -993,6 +1034,7 @@ export default {
}
this.form.prodCode += code;
this.form.prodDesc += desc;
//
this.innerVisible = false;
},
@ -1078,19 +1120,21 @@ export default {
this.form.planComplete = moment(new Date()).format('YYYY-MM-DD')
//
this.dialogVisible = true;
this.selectMaterielListtag = []
this.reset();
},
// -
submitForm() {
console.log("点击了提交按钮");
console.log("点击了提交按钮",this.form);
//
if (this.form.prodCode == null) {
if (this.form.prodCode == '') {
this.$message({
message: '请选择物料!',
type: 'warning'
})
return
}
if (this.form.prodDesc == null) {
if (this.form.prodDesc == '') {
this.$message({
message: '请选择物料!',
type: 'warning'
@ -1174,6 +1218,7 @@ export default {
this.open = false;
// -
this.dialogVisible = false;
this.selectMaterielListtag = []
this.reset();
},
// -
@ -1282,3 +1327,42 @@ export default {
margin-left: 650px;
}
</style>
<style lang="scss" scoped>
.tagbox {
display: flex;
/* overflow: scroll; */
position: relative;
width: 80%;
padding-left: 26px;
margin-bottom: 15px;
.tagboxlabel{
width: 100px;
text-align: right;
vertical-align: middle;
font-size: 14px;
color: black;
line-height: 40px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin-right: 12px;
}
.tag {
width: 82%;
border: 1px #DCDFE6 solid;
height: 100px;
padding: 5px 15px;
overflow-y: scroll;
.tagitem{
margin-left: 5px;
}
}
.button1{
width: 37px;
height: 37px;
position: absolute;
right: -39px;
top: 2px;
}
}
</style>

File diff suppressed because it is too large Load Diff

@ -1,87 +1,119 @@
<template>
<div>
<el-input placeholder="请输入内容" clearable > </el-input>
<el-transfer v-model="rightList" :data="leftList" :titles="titles"
:filterable=false
@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-input placeholder="请输入内容" clearable> </el-input> -->
<div class="query">
<el-input
style="width: 351px; margin-bottom: 10px"
v-model="leftQueryParams.itemName"
placeholder="请输入内容"
clearable
@keyup.enter.native="handleQuery"
/>
<el-input
style="width: 351px; margin-bottom: 10px"
v-model="rightQueryParams.itemName"
placeholder="请输入内容"
clearable
@keyup.enter.native="handleQuery"
/>
</div>
<!-- 右侧栏分页 -->
<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
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-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>
</template>
<script>
import { getListProduct,getRightList ,addProduct , updateProduct, getProduct, delProduct} from "@/api/technology/routeprodproduct";
import {
getListProduct,
getRightList,
addProduct,
updateProduct,
getProduct,
delProduct,
} from "@/api/technology/routeprodproduct";
export default {
name: "Routeprodproduct",
@ -124,11 +156,13 @@ export default {
},
//
form: {},
//
page: { pageNo: 1, pageSize: 20, total: 0 },
//--------------------->
leftList: [],
rightList: [],
titles:['未关联产品','已关联产品'],
titles: ["未关联产品", "已关联产品"],
//
Ltotal: "",
LPageNum: "1",
@ -137,10 +171,11 @@ export default {
LPages: null,
leftLength: null,
leftQueryParams: {
itemName: null,
routeId: this.routeId,
pageNum: 1,
pageSize: 20
},
pageSize: 20,
},
//
Rtotal: "",
RPageNum: "1",
@ -149,42 +184,53 @@ export default {
rightLength: null,
RNextPage: null,
rightQueryParams: {
itemName: null,
routeId: this.routeId,
pageNum: 1,
pageSize: 20
},
pageSize: 20,
},
};
},
props :{
routeId: undefined,
optType: undefined
props: {
routeId: undefined,
optType: undefined,
},
created() {
this.getList();
this.getRightListFun();
},
methods: {
// // 穿
// filterMethod(keyword, row) {
// console.log(keyword, row);
// return row.label.indexOf(keyword) > -1;
// },
//
handleQuery() {
this.getList();
this.getRightListFun();
},
/** 查询未分配产品列表 */
getList() {
this.loading = true;
getListProduct(this.leftQueryParams).then(response => {
this.LPages = Math.ceil(response.total/this.LPageSize)
getListProduct(this.leftQueryParams).then((response) => {
this.LPages = Math.ceil(response.total / this.LPageSize);
this.leftList = response.rows;
this.Ltotal = response.total;
this.Ltotal = response.total;
this.LPageNum = this.leftQueryParams.pageNum;
this.LNextPage = this.leftQueryParams.pageNum+1;
this.LNextPage = this.leftQueryParams.pageNum + 1;
this.loading = false;
});
},
/**左边上一页**/
leftPageNumChange(){
this.leftQueryParams.pageNum = this.LPageNum-1;
leftPageNumChange() {
this.leftQueryParams.pageNum = this.LPageNum - 1;
this.loading = true;
this.getList();
this.getRightListFun();
},
/**左边下一页**/
leftAddPageNumChange(){
leftAddPageNumChange() {
this.leftQueryParams.pageNum = this.LNextPage;
this.loading = true;
this.getList();
@ -194,35 +240,33 @@ export default {
/** 查询已分配产品列表 -------------------------------*/
getRightListFun() {
this.loading = true;
getRightList(this.rightQueryParams).then(response => {
this.RPages = Math.ceil(response.total/this.RPageSize);
getRightList(this.rightQueryParams).then((response) => {
this.RPages = Math.ceil(response.total / this.RPageSize);
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.Rtotal = response.total;
this.Rtotal = response.total;
this.RPageNum = this.rightQueryParams.pageNum;
this.RNextPage = this.rightQueryParams.pageNum+1;
this.RNextPage = this.rightQueryParams.pageNum + 1;
this.loading = false;
});
},
/**右边上一页**/
rightPageNumChange(){
this.rightQueryParams.pageNum = this.RPageNum-1;
rightPageNumChange() {
this.rightQueryParams.pageNum = this.RPageNum - 1;
this.loading = true;
this.getRightListFun();
},
/**右边下一页**/
rightAddPageNumChange(){
rightAddPageNumChange() {
this.rightQueryParams.pageNum = this.RNextPage;
this.loading = true;
this.getRightListFun();
},
//
cancel() {
@ -246,7 +290,7 @@ export default {
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
updateTime: null,
};
},
@ -254,16 +298,21 @@ export default {
handleChange(value, direction, movedKeys) {
if (this.queryParams.routeId != null) {
this.queryParams.selectedValues = value;
addProduct(this.queryParams).then(response => {
this.$modal.msgSuccess("关联成功");
addProduct(this.queryParams).then((response) => {
this.$modal.msgSuccess("关联成功");
});
}
}
}
},
},
};
</script>
<style>
.el-transfer-panel {
width: 350px;
};
width: 350px;
}
.query{
display: flex;
justify-content: space-between;
padding-right: 4px;
}
</style>

@ -0,0 +1,186 @@
<template>
<div>
<el-input
class="transfer_input"
placeholder="请输入内容"
v-model="knowledgeQuery.name"
clearable
@change="filterKonwledgeFn"
>
</el-input>
<el-transfer
v-model="knowledgeIds"
:titles="['选择知识点', '已选择知识点']"
:button-texts="['移除', '添加']"
:data="knowledgeData"
@change="handleKnowledgeChange"
>
<div class="transfer-footer" slot="left-footer">
<el-pagination
:pager-count="3"
@size-change="transferSizeChange"
@current-change="transferCurrentChange"
:current-page="transferCurrentPage"
:page-sizes="[10, 20, 50, 100]"
:page-size="transferPageSize"
layout=" sizes, prev, pager, next"
:total="transferTotal"
>
</el-pagination>
</div>
<div class="transfer-footer" slot="right-footer">
<el-pagination
:pager-count="3"
@size-change="transferSizeChange"
@current-change="transferCurrentChange"
:current-page="transferCurrentPage"
:page-sizes="[10, 20, 50, 100]"
:page-size="transferPageSize"
layout=" sizes, prev, pager, next"
:total="transferTotal"
>
</el-pagination>
</div>
</el-transfer>
</div>
</template>
<script>
import {
getListProduct,
getRightList,
addProduct,
updateProduct,
getProduct,
delProduct,
} from "@/api/technology/routeprodproduct";
export default {
name: "Routeprodproductnew",
data() {
return {
knowledgeQuery: {
//
cursor: 1,
limit: 10,
searchCount: true,
name: "",
},
knowledgeIds: [], // 穿
knowledgeData: [], // 穿
preKnowledgeData: [], // 穿
transferCurrentPage: 1, //穿
transferPageSize: 10, //穿pagesize
transferTotal: 0, //
leftQueryParams: {
routeId: this.routeId,
pageNum: 1,
pageSize: 20
},
};
},
props: {
routeId: undefined,
optType: undefined,
},
created() {
this.getKnowledges();
// this.getRightListFun();
},
methods: {
// 穿id
getKnowledges() {
const _this = this
getListProduct(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;
this.knowledges = response.rows;
this.knowledges.forEach((e) => {
_this.knowledgeIds.push(e.id);
});
});
},
//
getKnowledgesFn() {
getKnowledgesByPage(this.knowledgeQuery).then((res) => {
// 穿
console.log("res章节列表", res);
this.transferTotal = res.result.total;
this.dialogKnowledgeVisible = true;
this.preKnowledgeData = [...this.knowledgeData];
// 穿
this.knowledgeData = res.result.records
.map((item, index) => {
return {
key: item.id,
label: item.name,
};
})
.filter((item, index, self) => {
return self.findIndex((el) => el.key == item.key) === index;
});
// console.log(' this.knowledgeData', this.knowledgeData)
this.getChooseDataFn();
});
},
// pageSize
transferSizeChange(size) {
this.knowledgeQuery.limit = size;
this.getKnowledgesFn();
},
// currentPage
transferCurrentChange(page) {
this.knowledgeQuery.cursor = page;
this.transferCurrentPage = page;
this.getKnowledgesFn();
},
// 穿,
getChooseDataFn() {
this.knowledgeData = this.knowledgeData.filter((item) => {
return !this.knowledgeIds.includes(item.key);
});
// console.log('knowledgeIds_55', this.knowledgeIds)
// knowledgeIds id
const pushArrVal = this.preKnowledgeData.filter((item, index, self) => {
return this.knowledgeIds.includes(item.key);
});
// console.log('pushArrVal', pushArrVal)
this.knowledgeData.push(...pushArrVal);
// console.log('this.knowledgeData888', this.knowledgeData) //
// console.log(' this.preKnowledgeData', this.preKnowledgeData)
},
// 穿
handleKnowledgeChange(value, direction, movedKeys) {
this.knowledges = [];
for (let i = 0; i < value.length; i++) {
this.knowledgeIds[i] = value[i];
for (let j = 0; j < this.knowledgeData.length; j++) {
if (this.knowledgeData[j].key == value[i]) {
this.knowledges.push({
id: this.knowledgeData[j].key,
name: this.knowledgeData[j].label,
category: this.knowledgeData[j].category,
});
}
}
}
},
// 穿
filterKonwledgeFn(val) {
this.transferCurrentPage = 1;
this.knowledgeQuery.cursor = 1;
this.getKnowledgesFn();
},
},
};
</script>
<style>
.el-transfer-panel {
width: 350px;
}
</style>
Loading…
Cancel
Save