Browse Source

【nev-pc】退拆暂存

ag_report_nev
安虹睿 1 year ago
parent
commit
cc8f43ba1a
  1. 1
      fe/PC/src/components/filterSelect/index.vue
  2. 78
      fe/PC/src/views/finishedProductManage/dismantle/StepsFormTree/index.vue
  3. 721
      fe/PC/src/views/finishedProductManage/dismantle/StepsFormTree/index_1.vue
  4. 549
      fe/PC/src/views/finishedProductManage/dismantle/StepsFormTree/index_tree.vue
  5. 513
      fe/PC/src/views/finishedProductManage/dismantle/customerDismantleJob-1.vue
  6. 515
      fe/PC/src/views/finishedProductManage/dismantle/customerDismantleJob-tree.vue
  7. 46
      fe/PC/src/views/finishedProductManage/dismantle/customerDismantleJob.vue
  8. 4
      fe/PC/src/views/inventoryManage/Count/CountPlan-ms.vue

1
fe/PC/src/components/filterSelect/index.vue

@ -19,6 +19,7 @@
:loading-text="loadingText"
@change="changeHandle(arguments)"
:class="[selectItem.searchButton ? 'hasSearchButton' : '']"
:size="selectItem.size || 'normal'"
>
<el-option
v-for="item in options"

78
fe/PC/src/views/finishedProductManage/dismantle/StepsFormTree/index.vue

@ -374,6 +374,7 @@ export default {
//
toggleSelection(rows,type){
rows.forEach(row => {
row.isCheck = type
this.$refs.bomTree_Ref.toggleRowSelection(row,type);
});
},
@ -387,9 +388,10 @@ export default {
},
//
findAllPeer(row,data){
let _peerArr = []//
let _peerArr = null//
if(!data){data = this.CreateFormData.details}
for(let i = 0;i<data.length;i++){
console.log(393,data[i][this.config.id],row[this.config.parentId],data[i])
if(data[i][this.config.id] == row[this.config.parentId]){
_peerArr = data[i][this.config.children];
break
@ -401,11 +403,12 @@ export default {
}
}
}
console.log(405,_peerArr,row[this.config.parentId])
return _peerArr
},
//
findChildren(row,data){
let _childrenArr = []//
let _childrenArr = null//
if(!data){data = this.CreateFormData.details}
for(let i = 0;i<data.length;i++){
if(data[i][this.config.id] == row[this.config.id]){
@ -477,7 +480,7 @@ export default {
// 2
// 3
// 4
// todo:isCheck
//
tableHandleSelect(selection, row){
this.selectData = selection
const isCheck = selection.length && selection.indexOf(row) !== -1
@ -490,42 +493,50 @@ export default {
let _parentPeerArr = _parentRow ? this.findPeerForCheckHandle(_parentRow) : []
let _allCheck = [..._peerArr,..._parentPeerArr]
let _childrenArr = this.findChildren(row)
//
// +
this.$nextTick(()=>{
this.toggleSelection(_allCheck,true)
_allCheck.forEach(item=>{item.isCheck = true})
// 1+
if(_allCheck){ this.toggleSelection(_allCheck,true) }
// 2
this.toggleSelection([_parentRow],false)
_parentRow.isCheck = false
this.toggleSelection(_childrenArr,false)
_childrenArr.forEach(item=>{item.isCheck = false})
// 3
if(_childrenArr){ this.toggleSelection(_childrenArr,false) }
})
}else{
//
row.isCheck = false
console.log("取消勾选",selection, row)
let _peerArr = this.findAllPeer(row)//arr
let _parentRow = this.findParentRow(row)//row
let _parentPeerArr = _parentRow ? this.findAllPeer(_parentRow) : []//arr
let _parentPeerSonArr = []//arr
_parentPeerArr.forEach(item=>{
item.isCheck = false
_parentPeerSonArr = [..._parentPeerSonArr,...this.findChildren(item)]
})
let _parentPeerShow = 0
//
let _parentPeerShow = 0
_parentPeerArr.forEach(item=>{if(item.isCheck){_parentPeerShow ++}})
console.log(513,_parentRow)
// let _parentPeerSonArr = []//arr
// if(_parentPeerArr){
// _parentPeerArr.forEach(item=>{
// if(this.findChildren(item)){
// _parentPeerSonArr = [..._parentPeerSonArr,...this.findChildren(item)]
// }
// })
// }
console.log("父节点",_parentRow)
console.log("父级同级",_parentPeerArr)
console.log("同级",_peerArr)
// ,,
this.$nextTick(()=>{
this.toggleSelection(_peerArr,false)
_peerArr.forEach(item=>{item.isCheck = false})
// 1
if(_peerArr){ this.toggleSelection(_peerArr,false) }
console.log(111,this.CreateFormData.details)
// 2,
if((_parentPeerShow > 0 || row.parentId == _parentRow.id) && _parentRow.id != _parentRow.parentId){
this.toggleSelection([_parentRow],true)
_parentRow.isCheck = true
}
this.toggleSelection(_parentPeerSonArr,false)
_parentPeerSonArr.forEach(item=>{item.isCheck = false})
// // 3
// if(_parentPeerSonArr){
// this.toggleSelection(_parentPeerSonArr,false)
// }
})
console.log("取消勾选",selection, row)
}
},
//
@ -550,10 +561,7 @@ export default {
//
this.selectData = this.getLastFloors(this.CreateFormData.details)
this.$refs.bomTree_Ref.clearSelection();
this.selectData.forEach(item=>{
item.isCheck = true
this.$refs.bomTree_Ref.toggleRowSelection(item,true);
})
this.toggleSelection(this.selectData,true)
}else{
console.log("全不选",selection)
this.$refs.bomTree_Ref.clearSelection();
@ -592,6 +600,22 @@ export default {
this.loading = false
})
},
getBomAllSelect(data){
if(!data){
data = this.CreateFormData.details
this.selectData = []
}
data.forEach(item=>{
if(item.isCheck){
this.selectData.push(item)
}
if(item.children){
this.getBomAllSelect(item.children)
}
})
console.log(616,this.selectData)
return this.selectData
},
editFormClick (val) {
// Moment(this.CreateFormData.arriveTime).format()
// if (val[0] == 0) {
@ -625,6 +649,8 @@ export default {
parent.PalletlFunction(this.active).then(res => {
//
this.loading = false
console.log(6666,this.CreateFormData.details)
console.log(6666222,this.getBomAllSelect())
parent.stepsSubmit().then(res => {
this.pageStatus = 'success'
this.active++

721
fe/PC/src/views/finishedProductManage/dismantle/StepsFormTree/index_1.vue

@ -0,0 +1,721 @@
<template>
<el-dialog
:title="formTitle"
v-loading="loading"
v-if="displayDialog.newDialog"
:visible="true"
:fullscreen="true"
:append-to-body="false"
:modal="false"
:modal-append-to-body="false"
:show-close="true"
@close="close(0)"
>
<div id="StepsFormTree">
<el-steps
:active="active"
process-status="finish"
finish-status="success"
:align-center="true"
>
<el-step
v-for="(item, index) in stepFilters"
:key="index"
:title="item"
></el-step>
</el-steps>
<curren-Form
v-if="active == 0"
class="page1"
size="medium"
ref="page1"
:searchData="CreateFormData"
:searchForm="CreateForm"
:searchOptions="Options"
:searchHandle="editHandle"
:rules="Rules"
@changeInput="changeInput"
@changeSelect="changeSelect"
@push="DataPush(arguments)"
@submitForm="editFormClick(arguments)"
>
</curren-Form>
<curren-Form
v-if="active === 1"
class="page2"
size="medium"
:searchData="CreateFormData"
:searchHandle="editHandle"
:rules="Rules"
@submitForm="editFormClick(arguments)"
>
<template>
<el-form-item class="formTable-box " prop="details" v-if="active == 1">
<b style="font-size:20px;padding-bottom:10px">父级物料代码{{ propsData.details[0].itemCode }}</b>
<el-table
height="85%"
ref="bomTree_Ref"
:data="CreateFormData.details"
style="width: 100%;margin-bottom: 20px;"
row-key="id"
:border="true"
default-expand-all
@select="tableHandleSelect"
@select-all="tableHandleSelectAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column
type="selection"
:selectable="((row,index)=>{return index != 0})"
width="55">
</el-table-column>
<el-table-column
:prop="detailsTableColumns[0].prop"
:label="detailsTableColumns[0].label"
width="auto"
>
</el-table-column>
<el-table-column
:prop="detailsTableColumns[1].prop"
:label="detailsTableColumns[1].label"
width="auto">
</el-table-column>
<el-table-column
:prop="detailsTableColumns[2].prop"
:label="detailsTableColumns[2].label"
>
<template slot-scope="scope">
<filterSelect
v-if="scope.$index != 0"
:selectModel="scope.row[detailsTableColumns[2].prop]"
:selectItem="detailsTableColumns[2]"
:tableScope="scope"
@filterOptionSelectHandle="(item,props,val)=>{filterOptionSelectHandle(item,props,val,scope)}"
@filterClearHandle="(item)=>{filterClearHandle(item,scope)}"
></filterSelect>
</template>
</el-table-column>
</el-table>
</el-form-item>
</template>
</curren-Form>
<div
v-if="active === step.length - 1 && pageStatus === 'success'"
class="page4"
>
<el-result
icon="success"
title="成功提示"
:subTitle="formTitle + '成功'"
>
<template slot="extra">
<!-- <el-button type="primary" size="medium" @click="tuoFormPrint"
>打印托标签</el-button
>
<el-button type="primary" size="medium" @click="xbqFormPrint"
>打印箱标签</el-button
> -->
<el-button
v-for="item in successHandle"
:key="item.label"
:type="item.type"
size="medium"
@click="item.click()"
>{{ item.label }}</el-button
>
<!-- @click="successClick(item.click())" -->
<el-button type="primary" size="medium" @click="close(1)"
>退出</el-button
>
</template>
</el-result>
</div>
<div
v-if="active === step.length - 1 && pageStatus === 'error'"
class="page4"
>
<el-result icon="error" title="错误提示" :subTitle="formTitle + '失败'">
<template slot="extra">
<el-button type="primary" size="medium" @click="resubmit()"
>重新提交</el-button
>
<el-button type="primary" size="medium" @click="active--"
>上一步</el-button
>
<el-button type="primary" size="medium" @click="close(1)"
>退出</el-button
>
</template>
</el-result>
</div>
</div>
</el-dialog>
</template>
<script>
import currenForm from "@/components/currenForm"
import currenTable from "@/components/currenTable"
import filterSelect from "@/components/filterSelect"
export default {
name: 'StepsFormTree',
components: {
currenForm,
currenTable,
filterSelect
},
watch: {
active (val) {
if(val == 0){
if(this.hideFirstActiveCancel){
this.editHandle=[
{ label: "下一步", type: "primary", name: "determine" },
];
}else{
this.editHandle=[
{ label: "取消", name: "cancel" },
{ label: "下一步", type: "primary", name: "determine" },
];
}
}else if(val == 1){
this.editHandle=[
{ label: "上一步", name: "cancel" },
{ label: "提交", type: "primary", name: "determine" },
];
}
},
stepArray(newVal, oldVal){
this.step = newVal
}
},
filters: {
formData (val) {
let data = JSON.parse(JSON.stringify(val))
val.forEach((key, index) => {
data[index].disabled = "true"
delete data[index].focus
if (key.type == "autocomplete" || key.type == "import") {
data[index].type = "input"
}
});
return data
},
formDataDetails (val) {
let data = JSON.parse(JSON.stringify(val))
val.forEach((key, index) => {
data[index].disabled = true
delete data[index].focus
delete data[index].rules
if (key.type == "autocomplete" || key.type == "import") {
delete data[index].type
} else if (key.type == "objectAutocomplete") {
data[index].type = "object"
} else if (key.prop == "containerCode" && key.type == "input") {
data[index].disabled = false
} else if (key.isChange) {
//
data[index].disabled = false
}
});
return data
}
},
props: {
//
formTitle: {
type: String,
default: ''
},
//
displayDialog: {
type: Object,
default: () => {
return {
newDialog: false
}
}
},
//
propsData: {
type: Object,
default: () => {
return {}
}
},
//
CreateFormData: {
type: Object,
default: () => {
return {}
}
},
//form
CreateForm: {
type: Array,
default: () => {
return []
}
},
//
Rules: {
type: Object,
default: () => {
return {}
}
},
//
Options: {
type: Object,
default: () => {
return {}
}
},
//table
detailsTableColumns: {
type: Array,
default: () => {
return []
}
},
//
childTableData: {
type: Array,
default: () => {
return []
}
},
//
successHandle: {
type: Array,
default: () => {
return []
}
},
//
stepArray: {
type: Array,
default: () => {
return ["总体信息", "明细", "结果"]
}
},
//
addClickButton: {
type: Boolean,
default: () => {
return true
}
},
//
importFormButton: {
type: Boolean,
default: () => {
return false
}
},
//
isShowDeleteButton: {
type: Boolean,
default: () => {
return true
}
},
//
isHideFirstActiveCancel:{
type: Boolean,
default: () => {
return false
}
},
},
computed: {
stepFilters () {
let stepFilters = []
const routeName = this.$route.meta.title
this.step.forEach(key => {
stepFilters.push(routeName.concat(key))
})
return stepFilters
},
},
data () {
return {
active: 0,
formReveal: 1,
activeStep: 1,
pageStatus: '',
addClick: this.addClickButton,//
importForm:this.importFormButton,//
showDeleteButton: this.isShowDeleteButton,//-
hideFirstActiveCancel:this.isHideFirstActiveCancel,//
loading: false,
session: null,
step: this.stepArray,
editHandle: [
{ label: "取消", name: "cancel" },
{ label: "下一步", type: "primary", name: "determine" },
],
isAllCheck:false,//
selectData:[],//
config:{
id:'id',
parentId:'parentId',
// id:'itemCode',
// parentId:'parentCode',
children:'children'
},
}
},
mounted () {
this.session = JSON.parse(JSON.stringify(this.CreateFormData))
if(this.hideFirstActiveCancel){
this.editHandle=[
{ label: "下一步", type: "primary", name: "determine" },
];
}
},
methods: {
//
toggleSelection(rows,type){
rows.forEach(row => {
this.$refs.bomTree_Ref.toggleRowSelection(row,type);
});
},
// filterSelectoption
filterOptionSelectHandle(item,props,val,scope){
this.$emit("push", item,props,val,scope);
},
// // filterSelectto
filterClearHandle(item,scope){
this.$emit("clear", item,scope);
},
//
findAllPeer(row,data){
let _peerArr = null//
if(!data){data = this.CreateFormData.details}
for(let i = 0;i<data.length;i++){
console.log(393,data[i][this.config.id],row[this.config.parentId],data[i])
if(data[i][this.config.id] == row[this.config.parentId]){
_peerArr = data[i][this.config.children];
break
}
else{
if(data[i][this.config.children] && data[i][this.config.children].length > 0){
const _res = this.findAllPeer(row,data[i][this.config.children])
if(_res) _peerArr = _res
}
}
}
console.log(405,_peerArr,row[this.config.parentId])
return _peerArr
},
//
findChildren(row,data){
let _childrenArr = null//
if(!data){data = this.CreateFormData.details}
for(let i = 0;i<data.length;i++){
if(data[i][this.config.id] == row[this.config.id]){
_childrenArr = data[i][this.config.children];
break
}
else{
if(data[i][this.config.children] && data[i][this.config.children].length > 0){
const _res = this.findChildren(row,data[i][this.config.children])
if(_res) _childrenArr = _res
}
}
}
return _childrenArr
},
// chilred
findPeerForCheckHandle(row,data){
// debugger
if(!data){data = this.CreateFormData.details}
let _peerArr = null//
for(let i = 0;i<data.length;i++){
if(data[i][this.config.id] == row[this.config.parentId]){
//
_peerArr = []
data[i][this.config.children].forEach(item=>{
if(item[this.config.children] && item[this.config.children].length > 0){
let sonHasCheck = 0
item[this.config.children].forEach(son=>{
if(son.isCheck){sonHasCheck ++}
})
if(sonHasCheck == 0){
item.isCheck=true
_peerArr.push(item)
}
}else{
item.isCheck=true
_peerArr.push(item)
}
})
break
}
else {
if(data[i][this.config.children] && data[i][this.config.children].length > 0){
const _res = this.findPeerForCheckHandle(row,data[i][this.config.children])
if(_res) _peerArr = _res
}
}
}
return _peerArr
},
//
findParentRow(row,data){
if(!data){data = this.CreateFormData.details}
let _parentRow = null//
for(let i = 0;i<data.length;i++){
if(data[i][this.config.id] == row[this.config.parentId]){
_parentRow = data[i]
break
}else{
if(data[i][this.config.children] && data[i][this.config.children].length > 0){
const _res = this.findParentRow(row,data[i][this.config.children])
if(_res) _parentRow = _res
}
}
}
return _parentRow
},
// 1
// 2
// 3
// 4
// todo:isCheck
tableHandleSelect(selection, row){
this.selectData = selection
const isCheck = selection.length && selection.indexOf(row) !== -1
if(selection.length <= 0){}
if (isCheck) {
row.isCheck = true
console.log("勾选",selection, row)
console.log(111,this.CreateFormData.details)
let _peerArr = this.findPeerForCheckHandle(row)
let _parentRow = this.findParentRow(row)
let _parentPeerArr = _parentRow ? this.findPeerForCheckHandle(_parentRow) : []
let _allCheck = [..._peerArr,..._parentPeerArr]
let _childrenArr = this.findChildren(row)
//
this.$nextTick(()=>{
// 1
if(_allCheck){ this.toggleSelection(_allCheck,true) }
// 2
this.toggleSelection([_parentRow],false)
_parentRow.isCheck = false
// 3
if(_childrenArr){
this.toggleSelection(_childrenArr,false)
_childrenArr.forEach(item=>{ item.isCheck = false })
}
})
}else{
//
row.isCheck = false
let _peerArr = this.findAllPeer(row)//arr
let _parentRow = this.findParentRow(row)//row
let _parentPeerArr = _parentRow ? this.findAllPeer(_parentRow) : []//arr
let _parentPeerSonArr = []//arr
if(_parentPeerArr){
_parentPeerArr.forEach(item=>{
if(this.findChildren(item)){
_parentPeerSonArr = [..._parentPeerSonArr,...this.findChildren(item)]
}
})
}
let _parentPeerShow = 0
//
_parentPeerArr.forEach(item=>{if(item.isCheck){_parentPeerShow ++}})
console.log("父节点",_parentRow)
console.log("父级同级",_parentPeerArr)
console.log("同级",_peerArr)
// ,,
this.$nextTick(()=>{
// 1
if(_peerArr){
this.toggleSelection(_peerArr,false)
_peerArr.forEach(item=>{item.isCheck = false})
}
// 2,
if((_parentPeerShow > 0 || row.parentId == _parentRow.id) && _parentRow.id != _parentRow.parentId){
this.toggleSelection([_parentRow],true)
_parentRow.isCheck = true
}
// 3
if(_parentPeerSonArr){
this.toggleSelection(_parentPeerSonArr,false)
_parentPeerSonArr.forEach(item=>{item.isCheck = false})
}
})
console.log("取消勾选",selection, row)
}
},
//
getLastFloors(root, onePathDeep = 1, deepArr = []){
for (let i = 0; i < root.length; i++) {
if (root[i] == null) return 0
// children
if (!root[i][this.config.children]?.length) {
deepArr.push(root[i])
} else {
onePathDeep++
this.getLastFloors(root[i][this.config.children], onePathDeep, deepArr)
}
}
return deepArr;
},
//
tableHandleSelectAll(selection){
this.isAllCheck = !this.isAllCheck
if(this.isAllCheck){
console.log("全选",selection)
//
this.selectData = this.getLastFloors(this.CreateFormData.details)
this.$refs.bomTree_Ref.clearSelection();
this.selectData.forEach(item=>{
item.isCheck = true
this.$refs.bomTree_Ref.toggleRowSelection(item,true);
})
}else{
console.log("全不选",selection)
this.$refs.bomTree_Ref.clearSelection();
this.selectData = []
this.CreateFormData.details.forEach(item=>{item.isCheck = false})
}
},
//退
close (val) {
this.isAllCheck = false
this.selectData = []
this.active = 0
// const pageRef = this.Refs[1]
const data = JSON.parse(JSON.stringify(this.session))
this.$emit('close', data, val)
},
//autoComplete
DataPush (val) {
this.$emit("DataPush", val)
},
// //
// tuoFormPrint () {
// this.$emit('tuoFormPrint')
// },
// //
// xbqFormPrint () {
// this.$emit('xbqFormPrint')
// },
successClick (val) {
this.loading = true
val.then(res => {
this.loading = false
}, reason => {
this.loading = false
}).catch(err=>{
this.loading = false
})
},
editFormClick (val) {
// Moment(this.CreateFormData.arriveTime).format()
// if (val[0] == 0) {
if (val[2].name == "cancel") {
if (this.active == 0) {
// debugger
// this.active = ''
this.close(0)
} else {
// if (this.active == 2) {
// this.active = this.active - this.activeStep
// } else {
this.active--
// }
}
} else {
val[1].validate((valid) => {
if (valid) {
const parent = this.$parent
if(this.active == 0){
parent.PalletlFunction(this.active).then(res => {
//
this.active++
this.loading = false
}, reason => {
this.loading = false
}).catch(err=>{
this.loading = false
})
}else{
parent.PalletlFunction(this.active).then(res => {
//
this.loading = false
parent.stepsSubmit().then(res => {
this.pageStatus = 'success'
this.active++
this.loading = false
}, reason => {
this.loading = false
if(reason=="return")return
this.pageStatus = 'error'
this.active++
this.loading = false
}).catch(err=>{
this.loading = false
})
}, reason => {
this.loading = false
}).catch(err=>{
this.loading = false
})
}
} else {
this.$errorMsg('请检查表单')
}
})
}
},
resubmit(){
const parent = this.$parent
this.loading = true
parent.stepsSubmit().then(res => {
this.pageStatus = 'success'
this.loading = false
}, reason => {
this.loading = false
if(reason=="return")return
this.pageStatus = 'error'
this.loading = false
}).catch(err=>{
this.loading = false
})
},
//
openAddNew () {
const parent = this.$parent
parent.openAddNew()
},
//
openImportForm(){
const parent = this.$parent
parent.openImportFormHandle()
// this.displayDialog.importDialog = true
},
childTable (e, val) {
const parent = this.$parent
parent.childTable(e, val)
},
changeInput(prop,val){
this.$emit("changeInput", prop, val)
},
changeSelect(prop,val){
this.$emit("changeSelect", prop, val)
},
}
}
</script>
<style lang="scss" scoped>
@import "./style/index.scss";
// todo:
::v-deep .el-checkbox{
&.is-disabled{
.el-checkbox__inner{
visible:hidden
}
}
}
</style>

549
fe/PC/src/views/finishedProductManage/dismantle/StepsFormTree/index_tree.vue

@ -0,0 +1,549 @@
<template>
<el-dialog
:title="formTitle"
v-loading="loading"
v-if="displayDialog.newDialog"
:visible="true"
:fullscreen="true"
:append-to-body="false"
:modal="false"
:modal-append-to-body="false"
:show-close="true"
@close="close(0)"
>
<div id="StepsFormTree">
<el-steps
:active="active"
process-status="finish"
finish-status="success"
:align-center="true"
>
<el-step
v-for="(item, index) in stepFilters"
:key="index"
:title="item"
></el-step>
</el-steps>
<curren-Form
v-if="active == 0"
class="page1"
size="medium"
ref="page1"
:searchData="CreateFormData"
:searchForm="CreateForm"
:searchOptions="Options"
:searchHandle="editHandle"
:rules="Rules"
@changeInput="changeInput"
@changeSelect="changeSelect"
@push="DataPush(arguments)"
@submitForm="editFormClick(arguments)"
>
</curren-Form>
<curren-Form
v-if="active === 1"
class="page2"
size="medium"
:searchData="CreateFormData"
:searchHandle="editHandle"
:rules="Rules"
@submitForm="editFormClick(arguments)"
>
<template>
<el-form-item class="formTable-box " prop="details" v-if="active == 1">
<b style="font-size:20px;padding-bottom:10px">父级物料代码{{ propsData.details[0].itemCode }}</b>
<el-tree
:check-strictly="true"
ref="bomTree_Ref"
:size="'normal'"
style="width:800px"
:data="CreateFormData.details"
show-checkbox
node-key="id"
default-expand-all
@check="handleNodeCheck"
:expand-on-click-node="false">
<div class="custom-tree-node" slot-scope="{ node, data }">
<div>{{ data.itemCode }}</div>
<div class="right">
<div class="qty">{{ data.qty }}</div>
<div class="locationCode">
<filterSelect
:selectModel="data[detailsTableColumns[2].prop]"
:selectItem="detailsTableColumns[2]"
:tableScope="node"
@filterOptionSelectHandle="(item,props,val)=>{filterOptionSelectHandle(item,props,val,data)}"
@filterClearHandle="(item)=>{filterClearHandle(item,data)}"
></filterSelect>
</div>
</div>
</div>
</el-tree>
</el-form-item>
</template>
</curren-Form>
<div
v-if="active === step.length - 1 && pageStatus === 'success'"
class="page4"
>
<el-result
icon="success"
title="成功提示"
:subTitle="formTitle + '成功'"
>
<template slot="extra">
<!-- <el-button type="primary" size="medium" @click="tuoFormPrint"
>打印托标签</el-button
>
<el-button type="primary" size="medium" @click="xbqFormPrint"
>打印箱标签</el-button
> -->
<el-button
v-for="item in successHandle"
:key="item.label"
:type="item.type"
size="medium"
@click="item.click()"
>{{ item.label }}</el-button
>
<!-- @click="successClick(item.click())" -->
<el-button type="primary" size="medium" @click="close(1)"
>退出</el-button
>
</template>
</el-result>
</div>
<div
v-if="active === step.length - 1 && pageStatus === 'error'"
class="page4"
>
<el-result icon="error" title="错误提示" :subTitle="formTitle + '失败'">
<template slot="extra">
<el-button type="primary" size="medium" @click="resubmit()"
>重新提交</el-button
>
<el-button type="primary" size="medium" @click="active--"
>上一步</el-button
>
<el-button type="primary" size="medium" @click="close(1)"
>退出</el-button
>
</template>
</el-result>
</div>
</div>
</el-dialog>
</template>
<script>
import currenForm from "@/components/currenForm"
import currenTable from "@/components/currenTable"
import filterSelect from "@/components/filterSelect"
export default {
name: 'StepsFormTree',
components: {
currenForm,
currenTable,
filterSelect
},
watch: {
active (val) {
if(val == 0){
if(this.hideFirstActiveCancel){
this.editHandle=[
{ label: "下一步", type: "primary", name: "determine" },
];
}else{
this.editHandle=[
{ label: "取消", name: "cancel" },
{ label: "下一步", type: "primary", name: "determine" },
];
}
}else if(val == 1){
this.editHandle=[
{ label: "上一步", name: "cancel" },
{ label: "提交", type: "primary", name: "determine" },
];
}
},
stepArray(newVal, oldVal){
this.step = newVal
}
},
filters: {
formData (val) {
let data = JSON.parse(JSON.stringify(val))
val.forEach((key, index) => {
data[index].disabled = "true"
delete data[index].focus
if (key.type == "autocomplete" || key.type == "import") {
data[index].type = "input"
}
});
return data
},
formDataDetails (val) {
let data = JSON.parse(JSON.stringify(val))
val.forEach((key, index) => {
data[index].disabled = true
delete data[index].focus
delete data[index].rules
if (key.type == "autocomplete" || key.type == "import") {
delete data[index].type
} else if (key.type == "objectAutocomplete") {
data[index].type = "object"
} else if (key.prop == "containerCode" && key.type == "input") {
data[index].disabled = false
} else if (key.isChange) {
//
data[index].disabled = false
}
});
return data
}
},
props: {
//
formTitle: {
type: String,
default: ''
},
//
displayDialog: {
type: Object,
default: () => {
return {
newDialog: false
}
}
},
//
propsData: {
type: Object,
default: () => {
return {}
}
},
//
CreateFormData: {
type: Object,
default: () => {
return {}
}
},
//form
CreateForm: {
type: Array,
default: () => {
return []
}
},
//
Rules: {
type: Object,
default: () => {
return {}
}
},
//
Options: {
type: Object,
default: () => {
return {}
}
},
//table
detailsTableColumns: {
type: Array,
default: () => {
return []
}
},
//
childTableData: {
type: Array,
default: () => {
return []
}
},
//
successHandle: {
type: Array,
default: () => {
return []
}
},
//
stepArray: {
type: Array,
default: () => {
return ["总体信息", "明细", "结果"]
}
},
//
addClickButton: {
type: Boolean,
default: () => {
return true
}
},
//
importFormButton: {
type: Boolean,
default: () => {
return false
}
},
//
isShowDeleteButton: {
type: Boolean,
default: () => {
return true
}
},
//
isHideFirstActiveCancel:{
type: Boolean,
default: () => {
return false
}
},
},
computed: {
stepFilters () {
let stepFilters = []
const routeName = this.$route.meta.title
this.step.forEach(key => {
stepFilters.push(routeName.concat(key))
})
return stepFilters
},
},
data () {
return {
active: 0,
formReveal: 1,
activeStep: 1,
pageStatus: '',
addClick: this.addClickButton,//
importForm:this.importFormButton,//
showDeleteButton: this.isShowDeleteButton,//-
hideFirstActiveCancel:this.isHideFirstActiveCancel,//
loading: false,
session: null,
step: this.stepArray,
editHandle: [
{ label: "取消", name: "cancel" },
{ label: "下一步", type: "primary", name: "determine" },
],
isAllCheck:false,//
selectData:[],//
config:{
id:'id',
parentId:'parentId',
// id:'itemCode',
// parentId:'parentCode',
children:'children'
},
}
},
mounted () {
this.session = JSON.parse(JSON.stringify(this.CreateFormData))
if(this.hideFirstActiveCancel){
this.editHandle=[
{ label: "下一步", type: "primary", name: "determine" },
];
}
},
methods: {
handleNodeCheck(data,node){
console.log(data,node)
},
// filterSelectoption
filterOptionSelectHandle(item,props,val,scope){
this.$emit("push", item,props,val,scope);
},
// // filterSelectto
filterClearHandle(item,scope){
this.$emit("clear", item,scope);
},
//
getLastFloors(root, onePathDeep = 1, deepArr = []){
for (let i = 0; i < root.length; i++) {
if (root[i] == null) return 0
// children
if (!root[i][this.config.children]?.length) {
deepArr.push(root[i])
} else {
onePathDeep++
this.getLastFloors(root[i][this.config.children], onePathDeep, deepArr)
}
}
return deepArr;
},
//退
close (val) {
this.isAllCheck = false
this.selectData = []
this.active = 0
// const pageRef = this.Refs[1]
const data = JSON.parse(JSON.stringify(this.session))
this.$emit('close', data, val)
},
//autoComplete
DataPush (val) {
this.$emit("DataPush", val)
},
// //
// tuoFormPrint () {
// this.$emit('tuoFormPrint')
// },
// //
// xbqFormPrint () {
// this.$emit('xbqFormPrint')
// },
getCheckedNodesHandle(){
return this.$refs.bomTree_Ref.getCheckedNodes()
},
successClick (val) {
this.loading = true
val.then(res => {
this.loading = false
}, reason => {
this.loading = false
}).catch(err=>{
this.loading = false
})
},
editFormClick (val) {
// Moment(this.CreateFormData.arriveTime).format()
// if (val[0] == 0) {
if (val[2].name == "cancel") {
if (this.active == 0) {
// debugger
// this.active = ''
this.close(0)
} else {
// if (this.active == 2) {
// this.active = this.active - this.activeStep
// } else {
this.active--
// }
}
} else {
val[1].validate((valid) => {
if (valid) {
const parent = this.$parent
if(this.active == 0){
parent.PalletlFunction(this.active).then(res => {
//
this.active++
this.loading = false
}, reason => {
this.loading = false
}).catch(err=>{
this.loading = false
})
}else{
parent.PalletlFunction(this.active).then(res => {
//
this.loading = false
parent.stepsSubmit().then(res => {
this.pageStatus = 'success'
this.active++
this.loading = false
}, reason => {
this.loading = false
if(reason=="return")return
this.pageStatus = 'error'
this.active++
this.loading = false
}).catch(err=>{
this.loading = false
})
}, reason => {
this.loading = false
}).catch(err=>{
this.loading = false
})
}
} else {
this.$errorMsg('请检查表单')
}
})
}
},
resubmit(){
const parent = this.$parent
this.loading = true
parent.stepsSubmit().then(res => {
this.pageStatus = 'success'
this.loading = false
}, reason => {
this.loading = false
if(reason=="return")return
this.pageStatus = 'error'
this.loading = false
}).catch(err=>{
this.loading = false
})
},
//
openAddNew () {
const parent = this.$parent
parent.openAddNew()
},
//
openImportForm(){
const parent = this.$parent
parent.openImportFormHandle()
// this.displayDialog.importDialog = true
},
childTable (e, val) {
const parent = this.$parent
parent.childTable(e, val)
},
changeInput(prop,val){
this.$emit("changeInput", prop, val)
},
changeSelect(prop,val){
this.$emit("changeSelect", prop, val)
},
}
}
</script>
<style lang="scss" scoped>
@import "./style/index.scss";
// todo:
::v-deep .el-checkbox{
&.is-disabled{
.el-checkbox__inner{
visible:hidden
}
}
}
::v-deep .el-tree-node__content{
margin-bottom:10px
}
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
.right{
flex: 1;
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 14px;
padding-right: 8px;
}
.qty{
padding-right:200px
}
}
</style>

513
fe/PC/src/views/finishedProductManage/dismantle/customerDismantleJob-1.vue

@ -0,0 +1,513 @@
<template>
<div class="page-box" v-loading="Loading.appMainLoading">
<tablePagination
:currenButtonData="currenButtonData"
:tableData="tableData"
:tableLoading="Loading.tableLoading"
:tableColumns="tableColumns"
@rowDrop="rowDrop"
:totalCount="totalCount"
:multipleSelection="multipleSelection"
:MaxResultCount="PageListParams.MaxResultCount"
@topbutton="topbutton"
@inlineDialog="inlineDialog"
@sortChange="sortChange"
@alertoldSkipCount="alertoldSkipCount"
@alterResultCount="alterResultCount"
@handleSelectionChange="handleSelectionChange"
:currentPageProps="oldSkipCount"
:quicklySearchOption="quicklySearchOption"
@quicklySearchClick="quicklySearchClick"
@quicklySearchClear="quicklySearchClear"
:primarySearchOption="primarySearchOption"
@overallSearchFormClick="overallSearchFormClick"
:httpOverallSearchData="httpOverallSearchData"
>
</tablePagination>
<curren-Drawer
:title="tableColumns"
:DrawerLoading="Loading.DrawerLoading"
:drawer="displayDialog.detailsDialog"
:propsData="propsData"
:Butttondata="DrawerButtonData"
:tabsDesTions="tabsDesTions"
@drawerShut="(val) => (displayDialog.detailsDialog = val)"
@drawerbutton="drawerbuttonHandle"
@handleCommand="drawerHandle"
@close-value="closeValue"
:tableColumns="detailsTableColumns"
:totalCount="totalCountDetails"
:MaxResultCount="MaxResultCountDetails"
@alterResultCountDetails="alterResultCountDetails"
@alertoldSkipCountDetails="alertoldSkipCountDetails"
:dropdownTabsData="[]"
:firstTabs="firstTabs"
></curren-Drawer>
<!--编辑-->
<StepsFormTree
ref="StepsFormTree_Ref"
:propsData="propsData"
:formTitle="formTitle"
:displayDialog="displayDialog"
:CreateFormData="CreateFormData"
:CreateForm="CreateForm"
:Rules="editRules.cerateRule"
:Options="editOptions"
:detailsTableColumns="AddDetailsTableColumns"
:childTableData="childTableData"
@push="FormTreePush"
@clear="FormTreeClear"
@close="stepsCloseHandle(arguments)"
:isShowDeleteButton="false"
:addClickButton="false"
:successHandle="successHandle"
></StepsFormTree>
</div>
</template>
<script>
import {
getDetailed,
getPageList,
getBomByComponentTree,
productRecycleNoteExport,
productionRecycleJobHandle,
// productionRecycleJobComplete
} from "@/api/wms-api";
import { tableMixins } from "@/mixins/TableMixins"
import { LoadingMixins } from "@/mixins/LoadingMixins"
import { drawerMixins } from "@/mixins/drawerMixins"
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins"
import { mixins } from "@/mixins/mixins"
import { filterSelectMixins } from '@/mixins/filter-Select'
import store from '@/store'
import StepsFormTree from './StepsFormTree'
export default {
name: "customerDismantleJob",
mixins: [
tableMixins,
LoadingMixins,
drawerMixins,
TableHeaderMixins,
mixins,
filterSelectMixins,
],
computed: {
hideButton: function () {
return function (val) {
let data = true
val.forEach(key => {
if (this.propsData.jobStatus == key) {
data = false
}
})
return data
}
},
},
components:{StepsFormTree},
data () {
return {
URL: 'wms/store/production-recycle-job',
//
currenButtonData: [
// this.defaultAddBtn(),//
//
this.defaultExportBtn(),
this.defaultFieldSettingBtn(),//
this.defaultFreshBtn(),//
this.defaultFilterBtn(),//
],
DrawerButtonData: [
{
type: 'warning',
label: '执行',
name: "handle",
// ++
hide: () => { return this.hideButton([1,2,4]) },
size: 'mini'
},
// {
// type: 'success',
// label: '',
// name: "complete",
// // todo:
// hide: () => { return this.hideButton([1]) },
// size: 'mini'
// },
],
//
CreateFormData: {
qty:null,
details:[]
},
CreateForm: [
{ type: "inputNumber", label: "数量", prop: "qty",colSpan: 12,min:1},
],
editRules: {
cerateRule: {
qty: [
{ required: true, trigger: "blur", message: "不可为空" },
{
type: "number",
trigger: ["blur"],
validator: (rule, value, callback) => {
//
let _InventoryQty = Number(this.propsData.details[0].qty) - Number(this.propsData.details[0].executedQty)
if(_InventoryQty < value){
return callback(new Error(`数量不能大于未完成数量${_InventoryQty}`))
}else{
callback()
}
}
}
],
},
},
AddDetailsTableColumns: [
{ label: "子物料代码", prop: "itemCode",width:"auto",align:'left' },
{ label: "数量", prop: 'qty',width:"auto" },
{ type: "filterSelect", label: "目标库位", prop: "locationCode", optionsLabel: "name", optionsValue: "code",
focus: (type,val) => { return this.getFilterList(type, val, "basedata/Location",this.isFilter("type", "5"))},
// searchButton: (val) => { this.showSerarchPage(val, 'basedata/Location', 'InventoryBalance', '', this.CreateFormData) },
width:"auto",
},
],
childTableData:[{
itemCode:undefined,
qty:undefined,
locationCode:undefined,
locationArea:undefined,
locationErpCode:undefined,
locationGroup:undefined,
warehouseCode:undefined,
parentId:undefined
}],
successHandle:[
{
label:"下载报告",
click:(()=>{
this.downloadReport()
})
}
],
bomList:null,
submitRes:null,//
getBomLoading:false,//bom
};
},
mounted () {
this.paging();
},
methods: {
FormTreePush(item,props,val,scope){
console.log(props)
if(props.prop == "locationCode"){
scope.row.locationCode = val
scope.row.locationArea = item.areaCode
scope.row.locationErpCode = item.erpLocationCode
scope.row.locationGroup = item.locationGroupCode
scope.row.warehouseCode = item.warehouseCode
}
},
FormTreeClear(item,scope){
console.log(item)
if(item.prop == "locationCode"){
scope.row.locationCode = null
}
},
// bom
buildTree(jsonArr){
// console.log(220,this.getCycleColor(10,true,'1'))
//
const result = [];
const id = 'id';
const parentId = 'parentId';
const children = 'children';
const len = jsonArr.length;
// id()
const hash = {};
jsonArr.forEach(item => {
hash[item[id]] = item;
});
for (let j = 0; j < len; j++) {
jsonArr[j].parent = jsonArr[j - 1]
const jsonArrItem = jsonArr[j];
const hashItem = hash[jsonArrItem[parentId]];
if (hashItem) {
// children
!hashItem[children] && (hashItem[children] = []);
hashItem[children].push(jsonArrItem);
} else {
result.push(jsonArrItem);
}
}
return result;
},
drawerbuttonHandle(val){
//
if (val == "handle") {
this.formTitle = this.$route.meta.title + "执行";
this.CreateFormData = JSON.parse(JSON.stringify(this.propsData));
//
let _qty = Number(this.propsData.details[0].qty) - Number(this.propsData.details[0].executedQty)
this.$set(this.CreateFormData, "qty", _qty)
this.childTableData = [{
itemCode:undefined,
qty:undefined,
locationCode:undefined,
locationArea:undefined,
locationErpCode:undefined,
locationGroup:undefined,
warehouseCode:undefined,
parentId:undefined
}]
this.theEvent = "edit"
this.displayDialog.newDialog = true
}
//
// else if(val == "complete"){
// // todo:,wsm-apiproductionRecycleJobComplete
// this.Loading.appMainLoading = true
// productionRecycleJobComplete(this.propsData.id).then(res => {
// this.Loading.appMainLoading = false
// this.paging()
// this.displayDialog.detailsDialog = false
// }).catch(err => {
// this.Loading.appMainLoading = false
// })
// }
else{
this.drawerbutton(val)
}
},
//
isFilter (val, data) {
let filter = [
{
logic: "And",
column: val,
action: "==",
value: data
}
]
return filter
},
//
downloadReport(){
//
let _data = {
maxResultCount: 20,
skipCount: 0,
sorting: "",
route: "wms/store/product-recycle-note/export-product-recycle",
function: "客户退拆记录",//
condition: {
filters: [
{
logic: "And",
column: "number",
action: "==",
value: this.submitRes.remark
}
]
}
}
this.Loading.appMainLoading = true
productRecycleNoteExport(_data)
.then(res=>{
this.Loading.appMainLoading = false
this.blob(res,'客户退拆记录报告')//
})
.catch(err=>{
this.Loading.appMainLoading = false
})
},
//
checkSelectDG(list){
for (let i = 0; i < list.length; i++) {
}
},
//
checkSelectData(){
// todo:
// todo:
let _isSelectData = this.$refs.StepsFormTree_Ref.selectData
let _select_ids = []
_isSelectData.forEach(item=>{_select_ids.push(item.id)})
if(!_isSelectData || _isSelectData.length <= 0){
this.$warningMsg("请选择数据")
return
}
console.log(111,_isSelectData)
console.log(222,this.bomList)
console.log(333,_select_ids)
// this.bomList.forEach(item=>{
// if()
// })
// this.checkSelectDG(_isSelectData)
return
this.submitHttp()
},
//
submitHttp(){
this.bomList.forEach((item,index)=>{
let _item = {
itemCode: item.component,
qty: _tableList[index].qty,
locationCode: _tableList[index].rawLocationCode,
locationArea: _tableList[index].rawLocationArea,
locationGroup: _tableList[index].rawLocationGroup,
locationErpCode: _tableList[index].rawLocationErpCode,
warehouseCode: _tableList[index].warehouseCode,
}
_data.details[0].materialDetails.push(_item)
})
this.Loading.appMainLoading = true
this.submitRes = null
productionRecycleJobHandle(_jobInfo.id,_data).then(res => {
this.Loading.appMainLoading = false
this.submitRes = res
resolve();
}).catch(err => {
this.Loading.appMainLoading = false
reject();
})
},
//
getCycleColor(number,isCreate,alpha = 1,colors,append){
// let _color_item = {
// r:parseInt(Math.random() * 255),
// g:parseInt(Math.random() * 255),
// b:parseInt(Math.random() * 255)
// }
// let _colors = colors || ['#3ca170','#5470c6', '#91cd77','#ef6567', '#f9c956','#75bedc','#529FDB','#FF8000','#88D36C','#FCC12B',
// '#D38C6C','#AB9DF3','#40C03A','#ED94F5','#6CBED3']
let _colors = [
{r:"1",g:"110",b:"244"},
{r:"60",g:"161",b:"112"},
{r:"84",g:"112",b:"198"},
{r:"145",g:"205",b:"119"},
{r:"239",g:"101",b:"103"},
{r:"249",g:"201",b:"86"},
{r:"117",g:"190",b:"220"},
{r:"82",g:"159",b:"219"},
{r:"255",g:"128",b:"0"},
{r:"136",g:"211",b:"108"},
{r:"252",g:"193",b:"43"},
{r:"211",g:"140",b:"108"},
{r:"171",g:"157",b:"243"},
{r:"64",g:"192",b:"58"},
{r:"237",g:"148",b:"245"},
{r:"108",g:"190",b:"211"},
]
if(colors){_colors = append ? _colors.concat(colors) : colors}
let _all = []
let _length = number ? Math.ceil(number/_colors.length) : 1
for(let i = 0;i<_length;i++){
_all= _all.concat(_colors)
}
if(isCreate){
let _create = []
_all.forEach(item=>{
let _item = `rgba(${item.r},${item.g},${item.b},${alpha})`
_create.push(_item)
})
_all = _create
}
return _all
},
stepsSubmit (val) {
//
return new Promise((resolve, reject) => {
let _tableList = this.CreateFormData.details
let _empty = 0
console.log(381,_tableList)
_tableList.forEach(item=>{
if(!item.locationCode || item.locationCode.length <= 0){
_empty ++
}
})
if(_empty > 0){
this.$errorMsg("目标库位不可为空")
return
}
let _jobInfo = this.propsData
let _itemInfo = this.propsData.details[0]
let _data = JSON.parse(JSON.stringify(_jobInfo))
_data.details[0].materialDetails = [],//
_data.details[0].qty = Number(this.CreateFormData.qty)
this.checkSelectData()
});
},
stepsCloseHandle(data){
//
this.displayDialog.detailsDialog = false
this.stepsClose(data)
},
PalletlFunction (val) {
return new Promise((resolve, reject) => {
if(val == 0){
this.Loading.appMainLoading = true
// bom
let _itemInfo = this.propsData.details[0]
getBomByComponentTree(_itemInfo.itemCode)
.then(res=>{
this.bomList = res
this.Loading.appMainLoading = false
if(res.length > 0){
let _first = this.propsData.details[0]
this.CreateFormData.details = []
let _faterLevelId = null//bomID
res.forEach(item=>{
if(item.product == _first.itemCode){ _faterLevelId = item.remark }
let _item={
id:item.id,
itemCode:item.component,
parentCode:item.product,
// detailsqtyqty
qty:Number(item.componentQty) * Number(this.CreateFormData.qty),
locationCode:_itemInfo.rawLocationCode,
locationArea:_itemInfo.rawLocationArea,
locationGroup:_itemInfo.rawLocationGroup,
locationErpCode:_itemInfo.rawLocationErpCode,
warehouseCode:_itemInfo.warehouseCode,
parentId:item.remark
}
this.CreateFormData.details.push(_item)
})
let _tree = [{
id: _faterLevelId,
itemCode: _first.itemCode,
parentCode: _first.itemCode,
isCheck: false,
children:this.buildTree(JSON.parse(JSON.stringify(this.CreateFormData.details))),
parentId:_faterLevelId
}]
this.CreateFormData.details = _tree
// this.CreateFormData.details = this.buildTree(JSON.parse(JSON.stringify(this.CreateFormData.details)))
resolve();
}else{
this.$errorMsg(`并未找到${_itemInfo.itemCode}对应的bom数据`)
reject()
}
})
.catch(err=>{
this.Loading.appMainLoading = false
reject()
})
}
//
if(val == 1){
resolve()
}
});
},
}
};
</script>
<style lang="scss" scoped>
@import "../../../styles/basicData.scss";
</style>

515
fe/PC/src/views/finishedProductManage/dismantle/customerDismantleJob-tree.vue

@ -0,0 +1,515 @@
<template>
<div class="page-box" v-loading="Loading.appMainLoading">
<tablePagination
:currenButtonData="currenButtonData"
:tableData="tableData"
:tableLoading="Loading.tableLoading"
:tableColumns="tableColumns"
@rowDrop="rowDrop"
:totalCount="totalCount"
:multipleSelection="multipleSelection"
:MaxResultCount="PageListParams.MaxResultCount"
@topbutton="topbutton"
@inlineDialog="inlineDialog"
@sortChange="sortChange"
@alertoldSkipCount="alertoldSkipCount"
@alterResultCount="alterResultCount"
@handleSelectionChange="handleSelectionChange"
:currentPageProps="oldSkipCount"
:quicklySearchOption="quicklySearchOption"
@quicklySearchClick="quicklySearchClick"
@quicklySearchClear="quicklySearchClear"
:primarySearchOption="primarySearchOption"
@overallSearchFormClick="overallSearchFormClick"
:httpOverallSearchData="httpOverallSearchData"
>
</tablePagination>
<curren-Drawer
:title="tableColumns"
:DrawerLoading="Loading.DrawerLoading"
:drawer="displayDialog.detailsDialog"
:propsData="propsData"
:Butttondata="DrawerButtonData"
:tabsDesTions="tabsDesTions"
@drawerShut="(val) => (displayDialog.detailsDialog = val)"
@drawerbutton="drawerbuttonHandle"
@handleCommand="drawerHandle"
@close-value="closeValue"
:tableColumns="detailsTableColumns"
:totalCount="totalCountDetails"
:MaxResultCount="MaxResultCountDetails"
@alterResultCountDetails="alterResultCountDetails"
@alertoldSkipCountDetails="alertoldSkipCountDetails"
:dropdownTabsData="[]"
:firstTabs="firstTabs"
></curren-Drawer>
<!--编辑-->
<StepsFormTree
ref="StepsFormTree_Ref"
:propsData="propsData"
:formTitle="formTitle"
:displayDialog="displayDialog"
:CreateFormData="CreateFormData"
:CreateForm="CreateForm"
:Rules="editRules.cerateRule"
:Options="editOptions"
:detailsTableColumns="AddDetailsTableColumns"
:childTableData="childTableData"
@push="FormTreePush"
@clear="FormTreeClear"
@close="stepsCloseHandle(arguments)"
:isShowDeleteButton="false"
:addClickButton="false"
:successHandle="successHandle"
></StepsFormTree>
</div>
</template>
<script>
import {
getDetailed,
getPageList,
getBomByComponentTree,
productRecycleNoteExport,
productionRecycleJobHandle,
// productionRecycleJobComplete
} from "@/api/wms-api";
import { tableMixins } from "@/mixins/TableMixins"
import { LoadingMixins } from "@/mixins/LoadingMixins"
import { drawerMixins } from "@/mixins/drawerMixins"
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins"
import { mixins } from "@/mixins/mixins"
import { filterSelectMixins } from '@/mixins/filter-Select'
import store from '@/store'
import StepsFormTree from './StepsFormTree'
export default {
name: "customerDismantleJob",
mixins: [
tableMixins,
LoadingMixins,
drawerMixins,
TableHeaderMixins,
mixins,
filterSelectMixins,
],
computed: {
hideButton: function () {
return function (val) {
let data = true
val.forEach(key => {
if (this.propsData.jobStatus == key) {
data = false
}
})
return data
}
},
},
components:{StepsFormTree},
data () {
return {
URL: 'wms/store/production-recycle-job',
//
currenButtonData: [
// this.defaultAddBtn(),//
//
this.defaultExportBtn(),
this.defaultFieldSettingBtn(),//
this.defaultFreshBtn(),//
this.defaultFilterBtn(),//
],
DrawerButtonData: [
{
type: 'warning',
label: '执行',
name: "handle",
// ++
hide: () => { return this.hideButton([1,2,4]) },
size: 'mini'
},
// {
// type: 'success',
// label: '',
// name: "complete",
// // todo:
// hide: () => { return this.hideButton([1]) },
// size: 'mini'
// },
],
//
CreateFormData: {
qty:null,
details:[]
},
CreateForm: [
{ type: "inputNumber", label: "数量", prop: "qty",colSpan: 12,min:1},
],
editRules: {
cerateRule: {
qty: [
{ required: true, trigger: "blur", message: "不可为空" },
{
type: "number",
trigger: ["blur"],
validator: (rule, value, callback) => {
//
let _InventoryQty = Number(this.propsData.details[0].qty) - Number(this.propsData.details[0].executedQty)
if(_InventoryQty < value){
return callback(new Error(`数量不能大于未完成数量${_InventoryQty}`))
}else{
callback()
}
}
}
],
},
},
AddDetailsTableColumns: [
{ label: "子物料代码", prop: "itemCode",width:"auto",align:'left' },
{ label: "数量", prop: 'qty',width:"auto" },
{ type: "filterSelect", label: "目标库位", prop: "locationCode", optionsLabel: "name", optionsValue: "code",
focus: (type,val) => { return this.getFilterList(type, val, "basedata/Location",this.isFilter("type", "5"))},
// searchButton: (val) => { this.showSerarchPage(val, 'basedata/Location', 'InventoryBalance', '', this.CreateFormData) },
width:"auto",size:"mini"
},
],
childTableData:[{
itemCode:undefined,
qty:undefined,
locationCode:undefined,
locationArea:undefined,
locationErpCode:undefined,
locationGroup:undefined,
warehouseCode:undefined,
parentId:undefined
}],
successHandle:[
{
label:"下载报告",
click:(()=>{
this.downloadReport()
})
}
],
bomList:null,
submitRes:null,//
getBomLoading:false,//bom
};
},
mounted () {
this.paging();
},
methods: {
FormTreePush(item,props,val,scope){
console.log(203,props)
console.log(2034,scope)
if(props.prop == "locationCode"){
scope.locationCode = val
scope.locationArea = item.areaCode
scope.locationErpCode = item.erpLocationCode
scope.locationGroup = item.locationGroupCode
scope.warehouseCode = item.warehouseCode
}
},
FormTreeClear(item,scope){
console.log(item)
if(item.prop == "locationCode"){
scope.locationCode = null
}
},
// bom
buildTree(jsonArr){
// console.log(220,this.getCycleColor(10,true,'1'))
//
const result = [];
const id = 'id';
const parentId = 'parentId';
const children = 'children';
const len = jsonArr.length;
// id()
const hash = {};
jsonArr.forEach(item => {
hash[item[id]] = item;
});
for (let j = 0; j < len; j++) {
jsonArr[j].parent = jsonArr[j - 1]
const jsonArrItem = jsonArr[j];
const hashItem = hash[jsonArrItem[parentId]];
if (hashItem) {
// children
!hashItem[children] && (hashItem[children] = []);
hashItem[children].push(jsonArrItem);
} else {
result.push(jsonArrItem);
}
}
return result;
},
drawerbuttonHandle(val){
//
if (val == "handle") {
this.formTitle = this.$route.meta.title + "执行";
this.CreateFormData = JSON.parse(JSON.stringify(this.propsData));
//
let _qty = Number(this.propsData.details[0].qty) - Number(this.propsData.details[0].executedQty)
this.$set(this.CreateFormData, "qty", _qty)
this.childTableData = [{
itemCode:undefined,
qty:undefined,
locationCode:undefined,
locationArea:undefined,
locationErpCode:undefined,
locationGroup:undefined,
warehouseCode:undefined,
parentId:undefined
}]
this.theEvent = "edit"
this.displayDialog.newDialog = true
}
//
// else if(val == "complete"){
// // todo:,wsm-apiproductionRecycleJobComplete
// this.Loading.appMainLoading = true
// productionRecycleJobComplete(this.propsData.id).then(res => {
// this.Loading.appMainLoading = false
// this.paging()
// this.displayDialog.detailsDialog = false
// }).catch(err => {
// this.Loading.appMainLoading = false
// })
// }
else{
this.drawerbutton(val)
}
},
//
isFilter (val, data) {
let filter = [
{
logic: "And",
column: val,
action: "==",
value: data
}
]
return filter
},
//
downloadReport(){
//
let _data = {
maxResultCount: 20,
skipCount: 0,
sorting: "",
route: "wms/store/product-recycle-note/export-product-recycle",
function: "客户退拆记录",//
condition: {
filters: [
{
logic: "And",
column: "number",
action: "==",
value: this.submitRes.remark
}
]
}
}
this.Loading.appMainLoading = true
productRecycleNoteExport(_data)
.then(res=>{
this.Loading.appMainLoading = false
this.blob(res,'客户退拆记录报告')//
})
.catch(err=>{
this.Loading.appMainLoading = false
})
},
//
checkSelectDG(list){
for (let i = 0; i < list.length; i++) {
}
},
//
checkSelectData(){
console.log(335,this.$refs.StepsFormTree_Ref.getCheckedNodesHandle())
// todo:
// todo:
let _isSelectData = this.$refs.StepsFormTree_Ref.selectData
let _select_ids = []
_isSelectData.forEach(item=>{_select_ids.push(item.id)})
if(!_isSelectData || _isSelectData.length <= 0){
this.$warningMsg("请选择数据")
return
}
console.log(111,_isSelectData)
console.log(222,this.bomList)
console.log(333,_select_ids)
// this.bomList.forEach(item=>{
// if()
// })
// this.checkSelectDG(_isSelectData)
return
this.submitHttp()
},
//
submitHttp(){
this.bomList.forEach((item,index)=>{
let _item = {
itemCode: item.component,
qty: _tableList[index].qty,
locationCode: _tableList[index].rawLocationCode,
locationArea: _tableList[index].rawLocationArea,
locationGroup: _tableList[index].rawLocationGroup,
locationErpCode: _tableList[index].rawLocationErpCode,
warehouseCode: _tableList[index].warehouseCode,
}
_data.details[0].materialDetails.push(_item)
})
this.Loading.appMainLoading = true
this.submitRes = null
productionRecycleJobHandle(_jobInfo.id,_data).then(res => {
this.Loading.appMainLoading = false
this.submitRes = res
resolve();
}).catch(err => {
this.Loading.appMainLoading = false
reject();
})
},
//
getCycleColor(number,isCreate,alpha = 1,colors,append){
// let _color_item = {
// r:parseInt(Math.random() * 255),
// g:parseInt(Math.random() * 255),
// b:parseInt(Math.random() * 255)
// }
// let _colors = colors || ['#3ca170','#5470c6', '#91cd77','#ef6567', '#f9c956','#75bedc','#529FDB','#FF8000','#88D36C','#FCC12B',
// '#D38C6C','#AB9DF3','#40C03A','#ED94F5','#6CBED3']
let _colors = [
{r:"1",g:"110",b:"244"},
{r:"60",g:"161",b:"112"},
{r:"84",g:"112",b:"198"},
{r:"145",g:"205",b:"119"},
{r:"239",g:"101",b:"103"},
{r:"249",g:"201",b:"86"},
{r:"117",g:"190",b:"220"},
{r:"82",g:"159",b:"219"},
{r:"255",g:"128",b:"0"},
{r:"136",g:"211",b:"108"},
{r:"252",g:"193",b:"43"},
{r:"211",g:"140",b:"108"},
{r:"171",g:"157",b:"243"},
{r:"64",g:"192",b:"58"},
{r:"237",g:"148",b:"245"},
{r:"108",g:"190",b:"211"},
]
if(colors){_colors = append ? _colors.concat(colors) : colors}
let _all = []
let _length = number ? Math.ceil(number/_colors.length) : 1
for(let i = 0;i<_length;i++){
_all= _all.concat(_colors)
}
if(isCreate){
let _create = []
_all.forEach(item=>{
let _item = `rgba(${item.r},${item.g},${item.b},${alpha})`
_create.push(_item)
})
_all = _create
}
return _all
},
stepsSubmit (val) {
//
return new Promise((resolve, reject) => {
let _tableList = this.CreateFormData.details
let _empty = 0
console.log(381,_tableList)
_tableList.forEach(item=>{
if(!item.locationCode || item.locationCode.length <= 0){
_empty ++
}
})
if(_empty > 0){
this.$errorMsg("目标库位不可为空")
return
}
let _jobInfo = this.propsData
let _itemInfo = this.propsData.details[0]
let _data = JSON.parse(JSON.stringify(_jobInfo))
_data.details[0].materialDetails = [],//
_data.details[0].qty = Number(this.CreateFormData.qty)
this.checkSelectData()
});
},
stepsCloseHandle(data){
//
this.displayDialog.detailsDialog = false
this.stepsClose(data)
},
PalletlFunction (val) {
return new Promise((resolve, reject) => {
if(val == 0){
this.Loading.appMainLoading = true
// bom
let _itemInfo = this.propsData.details[0]
getBomByComponentTree(_itemInfo.itemCode)
.then(res=>{
this.bomList = res
this.Loading.appMainLoading = false
if(res.length > 0){
let _first = this.propsData.details[0]
this.CreateFormData.details = []
let _faterLevelId = null//bomID
res.forEach(item=>{
if(item.product == _first.itemCode){ _faterLevelId = item.remark }
let _item={
id:item.id,
itemCode:item.component,
parentCode:item.product,
// detailsqtyqty
qty:Number(item.componentQty) * Number(this.CreateFormData.qty),
locationCode:_itemInfo.rawLocationCode,
locationArea:_itemInfo.rawLocationArea,
locationGroup:_itemInfo.rawLocationGroup,
locationErpCode:_itemInfo.rawLocationErpCode,
warehouseCode:_itemInfo.warehouseCode,
parentId:item.remark
}
this.CreateFormData.details.push(_item)
})
// let _tree = [{
// id: _faterLevelId,
// itemCode: _first.itemCode,
// parentCode: _first.itemCode,
// isCheck: false,
// children:this.buildTree(JSON.parse(JSON.stringify(this.CreateFormData.details))),
// parentId:_faterLevelId
// }]
// this.CreateFormData.details = _tree
this.CreateFormData.details = this.buildTree(JSON.parse(JSON.stringify(this.CreateFormData.details)))
resolve();
}else{
this.$errorMsg(`并未找到${_itemInfo.itemCode}对应的bom数据`)
reject()
}
})
.catch(err=>{
this.Loading.appMainLoading = false
reject()
})
}
//
if(val == 1){
resolve()
}
});
},
}
};
</script>
<style lang="scss" scoped>
@import "../../../styles/basicData.scss";
</style>

46
fe/PC/src/views/finishedProductManage/dismantle/customerDismantleJob.vue

@ -217,8 +217,6 @@ export default {
},
// bom
buildTree(jsonArr){
// console.log(220,this.getCycleColor(10,true,'1'))
//
const result = [];
const id = 'id';
@ -233,6 +231,7 @@ export default {
});
for (let j = 0; j < len; j++) {
jsonArr[j].parent = jsonArr[j - 1]
const jsonArrItem = jsonArr[j];
const hashItem = hash[jsonArrItem[parentId]];
if (hashItem) {
@ -375,49 +374,6 @@ export default {
reject();
})
},
//
getCycleColor(number,isCreate,alpha = 1,colors,append){
// let _color_item = {
// r:parseInt(Math.random() * 255),
// g:parseInt(Math.random() * 255),
// b:parseInt(Math.random() * 255)
// }
// let _colors = colors || ['#3ca170','#5470c6', '#91cd77','#ef6567', '#f9c956','#75bedc','#529FDB','#FF8000','#88D36C','#FCC12B',
// '#D38C6C','#AB9DF3','#40C03A','#ED94F5','#6CBED3']
let _colors = [
{r:"1",g:"110",b:"244"},
{r:"60",g:"161",b:"112"},
{r:"84",g:"112",b:"198"},
{r:"145",g:"205",b:"119"},
{r:"239",g:"101",b:"103"},
{r:"249",g:"201",b:"86"},
{r:"117",g:"190",b:"220"},
{r:"82",g:"159",b:"219"},
{r:"255",g:"128",b:"0"},
{r:"136",g:"211",b:"108"},
{r:"252",g:"193",b:"43"},
{r:"211",g:"140",b:"108"},
{r:"171",g:"157",b:"243"},
{r:"64",g:"192",b:"58"},
{r:"237",g:"148",b:"245"},
{r:"108",g:"190",b:"211"},
]
if(colors){_colors = append ? _colors.concat(colors) : colors}
let _all = []
let _length = number ? Math.ceil(number/_colors.length) : 1
for(let i = 0;i<_length;i++){
_all= _all.concat(_colors)
}
if(isCreate){
let _create = []
_all.forEach(item=>{
let _item = `rgba(${item.r},${item.g},${item.b},${alpha})`
_create.push(_item)
})
_all = _create
}
return _all
},
stepsSubmit (val) {
//
return new Promise((resolve, reject) => {

4
fe/PC/src/views/inventoryManage/Count/CountPlan-ms.vue

@ -219,7 +219,7 @@ export default {
},
CreateForm: [
{ type: "select", label: "盘点根据", prop: "countMethod", options: "countMethod", colSpan: 12 },
{ type: "select", label: "盘点类型", prop: "requestType", options: "requestType", colSpan: 12 },
// { type: "select", label: "", prop: "requestType", options: "requestType", colSpan: 12 },
// { type: "select", label: "", prop: "type", options: "checkType", colSpan: 12 },
// { type: "dateTime", label: "", prop: "beginTime", colSpan: 12 },
// { type: "dateTime", label: "", prop: "endTime", colSpan: 12 },
@ -231,7 +231,7 @@ export default {
editRules: {
cerateRule: {
number: [{ required: true, trigger: ["blur", "change"], message: "不可为空" }],
requestType: [{ required: true, trigger: ["blur", "change"], message: "不可为空" }],
// requestType: [{ required: true, trigger: ["blur", "change"], message: "" }],
inventoryMode: [{ required: true, trigger: ["blur", "change"], message: "不可为空" }],
// type: [{ required: true, trigger: "change", message: "" }],//
status: [{ required: true, trigger: "blur", message: "不可为空" }],

Loading…
Cancel
Save