Browse Source

【nev-pc】客户退拆暂存

ag_report_nev
安虹睿 1 year ago
parent
commit
c37378f2b4
  1. 9
      fe/PC/src/utils/index.js
  2. 140
      fe/PC/src/views/finishedProductManage/dismantle/StepsFormTree/index.vue
  3. 193
      fe/PC/src/views/finishedProductManage/dismantle/StepsFormTree/index_ischeck.vue
  4. 542
      fe/PC/src/views/finishedProductManage/dismantle/StepsFormTree/okk_currenTable.vue
  5. 108
      fe/PC/src/views/finishedProductManage/dismantle/customerDismantleJob.vue

9
fe/PC/src/utils/index.js

@ -556,3 +556,12 @@ export function initDataToHttpFormat (date) {
export function createNewTabs (url) {
window.open(url, "_blank")
}
// 生成UUID
export function generateUUID() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
const r = crypto.randomBytes(1)[0] % 16 | 0,
v = c === 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}

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

@ -63,7 +63,6 @@
@select="tableHandleSelect"
@select-all="tableHandleSelectAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<!-- todo:第一层只显示名字 -->
<el-table-column
type="selection"
:selectable="((row,index)=>{return index != 0})"
@ -354,6 +353,13 @@ export default {
],
isAllCheck:false,//
selectData:[],//
config:{
id:'id',
parentId:'parentId',
// id:'itemCode',
// parentId:'parentCode',
children:'children'
},
}
},
mounted () {
@ -379,35 +385,55 @@ export default {
filterClearHandle(item,scope){
this.$emit("clear", item,scope);
},
//
findPeer(row,type){
//
findAllPeer(row,data){
let _peerArr = []//
let data = this.CreateFormData.details
if(!data){data = this.CreateFormData.details}
for(let i = 0;i<data.length;i++){
if(data[i].itemCode = row.parentCode){
data[i].isCheck = false
_peerArr = data[i].children;
if(data[i][this.config.id] == row[this.config.parentId]){
_peerArr = data[i][this.config.children];
break
}
else{
this.findPeer(data[i])
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('获取所有同级',_peerArr)
return _peerArr
},
// todo:chilred
//
findChildren(row,data){
let _childrenArr = []//
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 = []//
let _peerArr = null//
for(let i = 0;i<data.length;i++){
if(data[i].itemCode == row.parentCode){
console.log("aaa")
if(data[i][this.config.id] == row[this.config.parentId]){
//
data[i].children.forEach(item=>{
if(item.children && item.children.length > 0){
_peerArr = []
data[i][this.config.children].forEach(item=>{
if(item[this.config.children] && item[this.config.children].length > 0){
let sonHasCheck = 0
item.children.forEach(son=>{
item[this.config.children].forEach(son=>{
if(son.isCheck){sonHasCheck ++}
})
if(sonHasCheck == 0){
@ -422,47 +448,36 @@ export default {
break
}
else {
console.log("bbb")
if(data[i].children && data[i].children.length > 0){
this.findPeerForCheckHandle(row,data[i].children)
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
}
}
}
console.log('获取所有同级(同级下的chilred未被选中的)',_peerArr)
return _peerArr
},
// todo:chilred
findParentPeerForCheckHandle(row,data){
//
findParentRow(row,data){
if(!data){data = this.CreateFormData.details}
let _parentPeerArr = []//
let _parentRow = null//
for(let i = 0;i<data.length;i++){
if(data[i].itemCode == row.parentCode){
console.log(11,data[i].itemCode)
if(data[i][this.config.id] == row[this.config.parentId]){
_parentRow = data[i]
break
}else{
console.log(222)
if(data[i].children && data[i].children.length > 0){
this.findParentPeerForCheckHandle(row,data[i].children)
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
}
}
}
console.log(442,_parentRow)
// if(_parentRow){
// _parentPeerArr = this.findPeerForCheckHandle(_parentRow)
// }
// console.log('chilred',_parentPeerArr)
return _parentPeerArr
},
// todo:,
findPeerForCancleCheckHandle(row){
return _parentRow
},
// 1
// 2
// 3
// 4
//
// todo:isCheck
tableHandleSelect(selection, row){
this.selectData = selection
const isCheck = selection.length && selection.indexOf(row) !== -1
@ -470,21 +485,46 @@ export default {
if (isCheck) {
row.isCheck = true
console.log("勾选",selection, row)
console.log(472,this.CreateFormData.details)
let _peerArr = this.findPeerForCheckHandle(row)
// let _parentPeerArr = this.findParentPeerForCheckHandle(row)
// let _allCheck = [..._peerArr,..._parentPeerArr]
let _parentRow = this.findParentRow(row)
let _parentPeerArr = _parentRow ? this.findPeerForCheckHandle(_parentRow) : []
let _allCheck = [..._peerArr,..._parentPeerArr]
let _childrenArr = this.findChildren(row)
//
this.$nextTick(()=>{
this.toggleSelection(_peerArr,true)
this.toggleSelection(_allCheck,true)
_allCheck.forEach(item=>{item.isCheck = true})
this.toggleSelection([_parentRow],false)
_parentRow.isCheck = false
this.toggleSelection(_childrenArr,false)
_childrenArr.forEach(item=>{item.isCheck = false})
})
}else{
//
row.isCheck = false
let _peerArr = this.findPeer(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
//
_parentPeerArr.forEach(item=>{if(item.isCheck){_parentPeerShow ++}})
console.log(513,_parentRow)
// ,,
this.$nextTick(()=>{
this.toggleSelection(_peerArr,false)
_peerArr.forEach(item=>{item.isCheck = false})
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})
})
//
console.log("取消勾选",selection, row)
}
},
@ -493,11 +533,11 @@ export default {
for (let i = 0; i < root.length; i++) {
if (root[i] == null) return 0
// children
if (!root[i].children?.length) {
if (!root[i][this.config.children]?.length) {
deepArr.push(root[i])
} else {
onePathDeep++
this.getLastFloors(root[i].children, onePathDeep, deepArr)
this.getLastFloors(root[i][this.config.children], onePathDeep, deepArr)
}
}
return deepArr;
@ -651,4 +691,12 @@ export default {
</script>
<style lang="scss" scoped>
@import "./style/index.scss";
// todo:
::v-deep .el-checkbox{
&.is-disabled{
.el-checkbox__inner{
visible:hidden
}
}
}
</style>

193
fe/PC/src/views/finishedProductManage/dismantle/StepsFormTree/okk_el.vue → fe/PC/src/views/finishedProductManage/dismantle/StepsFormTree/index_ischeck.vue

@ -8,7 +8,8 @@
:append-to-body="false"
:modal="false"
:modal-append-to-body="false"
:show-close="false"
:show-close="true"
@close="close(0)"
>
<div id="StepsFormTree">
<el-steps
@ -52,6 +53,7 @@
<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;"
@ -63,27 +65,28 @@
: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="partCode"
label="子物料代码"
:prop="detailsTableColumns[0].prop"
:label="detailsTableColumns[0].label"
width="auto"
>
</el-table-column>
<el-table-column
prop="qty"
label="数量"
:prop="detailsTableColumns[1].prop"
:label="detailsTableColumns[1].label"
width="auto">
</el-table-column>
<el-table-column
prop="rawLocationCode"
label="目标库位">
:prop="detailsTableColumns[2].prop"
:label="detailsTableColumns[2].label"
>
<template slot-scope="scope">
<!-- {{scope.$index}}
{{scope.row}} -->
<filterSelect
:selectModel="scope.row['rawLocationCode']"
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)}"
@ -135,6 +138,9 @@
<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
>
@ -347,6 +353,13 @@ export default {
],
isAllCheck:false,//
selectData:[],//
config:{
id:'id',
parentId:'parentId',
// id:'itemCode',
// parentId:'parentCode',
children:'children'
},
}
},
mounted () {
@ -358,29 +371,158 @@ export default {
}
},
methods: {
//
toggleSelection(rows,type){
rows.forEach(row => {
this.$refs.bomTree_Ref.toggleRowSelection(row,type);
});
},
// filterSelectoption
filterOptionSelectHandle(item,props,val,scope){
console.log(666,item,props,val,scope)
scope.row.rawLocationCode = val
scope.row.rawLocationArea = item.areaCode
scope.row.rawLocationErpCode = item.erpLocationCode
scope.row.rawLocationGroup = item.locationGroupCode
scope.row.warehouseCode = item.warehouseCode
},
// // filterSelect
this.$emit("push", item,props,val,scope);
},
// // filterSelectto
filterClearHandle(item,scope){
console.log(777,this.CreateFormData.details,scope.$index)
scope.row.rawLocationCode = null
this.$emit("clear", item,scope);
},
//
findAllPeer(row,data,isCheck){
let _peerArr = []//
if(!data){data = this.CreateFormData.details}
for(let i = 0;i<data.length;i++){
if(data[i][this.config.id] == row[this.config.parentId]){
data[i].isCheck = isCheck
_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],isCheck)
if(_res) _peerArr = _res
}
}
}
return _peerArr
},
//
findChildren(row,data,isCheck){
let _childrenArr = []//
if(!data){data = this.CreateFormData.details}
for(let i = 0;i<data.length;i++){
if(data[i][this.config.id] == row[this.config.id]){
data[i].isCheck = isCheck
_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],isCheck)
if(_res) _childrenArr = _res
}
}
}
return _childrenArr
},
// chilred
findPeerForCheckHandle(row,data,isCheck){
// 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=isCheck
_peerArr.push(item)
}
}else{
item.isCheck=isCheck
_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],isCheck)
if(_res) _peerArr = _res
}
}
}
return _peerArr
},
//
//
findParentRow(row,data,isCheck){
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]){
data[i].isCheck = isCheck
_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],isCheck)
if(_res) _parentRow = _res
}
}
}
return _parentRow
},
// 1
// 2
// 3
// 4
// todo:toggleSelectionisCheck
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)
let _peerArr = this.findPeerForCheckHandle(row,false,true)
let _parentRow = this.findParentRow(row,false,false)
let _parentPeerArr = _parentRow ? this.findPeerForCheckHandle(_parentRow,false,true) : []
let _allCheck = [..._peerArr,..._parentPeerArr]
let _childrenArr = this.findChildren(row,false,false)
//
this.$nextTick(()=>{
this.toggleSelection(_allCheck,true)
this.toggleSelection([_parentRow],false)
this.toggleSelection(_childrenArr,false)
})
}else{
console.log("取消",selection, row)
//
row.isCheck = false
let _peerArr = this.findAllPeer(row,false,false)//arr
let _parentRow = this.findParentRow(row)//row
let _parentPeerArr = _parentRow ? this.findAllPeer(_parentRow,false,true) : []//arr
let _parentPeerSonArr = []//arr
_parentPeerArr.forEach(item=>{
_parentPeerSonArr = [..._parentPeerSonArr,...this.findChildren(item,false,false)]
})
let _parentPeerShow = 0
//
_parentPeerArr.forEach(item=>{
if(item.isCheck){_parentPeerShow ++}
if(item.id == _parentRow.id){_parentPeerShow ++}
})
console.log(517,_parentRow)
// ,,
this.$nextTick(()=>{
this.toggleSelection(_peerArr,false)
if(_parentPeerShow > 0 && _parentRow.parentId != _parentRow.id)this.toggleSelection([_parentRow],true)
this.toggleSelection(_parentPeerSonArr,false)
})
console.log("取消勾选",selection, row)
}
},
//
@ -388,11 +530,11 @@ export default {
for (let i = 0; i < root.length; i++) {
if (root[i] == null) return 0
// children
if (!root[i].children?.length) {
if (!root[i][this.config.children]?.length) {
deepArr.push(root[i])
} else {
onePathDeep++
this.getLastFloors(root[i].children, onePathDeep, deepArr)
this.getLastFloors(root[i][this.config.children], onePathDeep, deepArr)
}
}
return deepArr;
@ -404,15 +546,16 @@ export default {
console.log("全选",selection)
//
this.selectData = this.getLastFloors(this.CreateFormData.details)
console.log(407,this.$refs.bomTree_Ref)
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})
}
},
//退

542
fe/PC/src/views/finishedProductManage/dismantle/StepsFormTree/okk_currenTable.vue

@ -1,542 +0,0 @@
<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="false"
>
<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">
<div class="heder">
<el-button
v-if="addClick"
type="primary"
@click="openAddNew"
icon="el-icon-plus"
size="mini"
>添加一行</el-button>
<el-button
v-if="importFormButton"
type="success"
icon="el-icon-download"
@click="openImportForm"
size="mini"
>导入</el-button>
</div>
<b style="font-size:20px;padding-bottom:10px">父级物料代码{{ propsData.details[0].itemCode }}</b>
<currenTable
ref="bomTree_Ref"
:tableData="CreateFormData.details"
:searchOptions="Options"
:tableColumns="detailsTableColumns"
:selectionTable="true"
@push="detailsDataPush(arguments)"
@clear="detailsClear(arguments)"
@tableHandleSelect="tableHandleSelect"
@tableHandleSelectAll="tableHandleSelectAll"
:isDefaultExpandAll="true"
:treeProps="{children: 'children', hasChildren: 'hasChildren'}"
>
<template v-if="showDeleteButton">
<el-table-column
label="操作"
align="center"
fixed="right"
width="100px"
>
<template slot-scope="scope">
<div class="childTable" @click="childTable($event, scope)">
<span>删除</span>
</div>
</template>
</el-table-column>
</template>
</currenTable>
</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="close(1)"
>退出</el-button
>
</template>
</el-result>
</div>
</div>
</el-dialog>
</template>
<script>
import currenForm from "@/components/currenForm"
import currenTable from "@/components/currenTable"
export default {
name: 'StepsFormTree',
components: {
currenForm,
currenTable
},
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:[],//
}
},
mounted () {
this.session = JSON.parse(JSON.stringify(this.CreateFormData))
if(this.hideFirstActiveCancel){
this.editHandle=[
{ label: "下一步", type: "primary", name: "determine" },
];
}
},
methods: {
//
tableHandleSelect(selection, row){
this.selectData = selection
const isCheck = selection.length && selection.indexOf(row) !== -1
if(selection.length <= 0){}
if (isCheck) {
console.log("勾选",selection, row)
}else{
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].children?.length) {
deepArr.push(root[i])
} else {
onePathDeep++
this.getLastFloors(root[i].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.$refs.multipleTable.clearSelection();
this.selectData.forEach(item=>{
this.$refs.bomTree_Ref.$refs.multipleTable.toggleRowSelection(item,true);
})
}else{
console.log("全不选",selection)
this.$refs.bomTree_Ref.$refs.multipleTable.clearSelection();
this.selectData = []
}
},
//退
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)
},
//autoComplete
detailsDataPush (val) {
this.$emit("detailsDataPush", val)
},
detailsClear(val) {
this.$emit("detailsClear", 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";
</style>

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

@ -180,6 +180,7 @@ export default {
locationErpCode:undefined,
locationGroup:undefined,
warehouseCode:undefined,
parentId:undefined
}],
successHandle:[
{
@ -191,6 +192,7 @@ export default {
],
bomList:null,
submitRes:null,//
getBomLoading:false,//bom
};
},
mounted () {
@ -214,35 +216,35 @@ export default {
}
},
// bom
buildTree(list){
let pidStr = 'parentCode';
let idStr = 'itemCode';
let childrenStr = 'children';
buildTree(jsonArr){
// console.log(220,this.getCycleColor(10,true,'1'))
let listOjb = {}; // {key: obj}
let treeList = []; //
//
const result = [];
const id = 'id';
const parentId = 'parentId';
const children = 'children';
const len = jsonArr.length;
// {key: obj}便
for (let i = 0; i < list.length; i++) {
listOjb[list[i][idStr]] = list[i]
}
// id()
const hash = {};
jsonArr.forEach(item => {
hash[item[id]] = item;
});
for (let j = 0; j < list.length; j++) {
//
let haveParent = listOjb[list[j][pidStr]]
if (haveParent) {
// childrenchildren
!haveParent[childrenStr] && (haveParent[childrenStr] = [])
//
haveParent[childrenStr].push(list[j])
for (let j = 0; j < len; j++) {
const jsonArrItem = jsonArr[j];
const hashItem = hash[jsonArrItem[parentId]];
if (hashItem) {
// children
!hashItem[children] && (hashItem[children] = []);
hashItem[children].push(jsonArrItem);
} else {
//
treeList.push(list[j])
result.push(jsonArrItem);
}
}
return treeList
return result;
},
drawerbuttonHandle(val){
//
if (val == "handle") {
@ -259,6 +261,7 @@ export default {
locationErpCode:undefined,
locationGroup:undefined,
warehouseCode:undefined,
parentId:undefined
}]
this.theEvent = "edit"
this.displayDialog.newDialog = true
@ -328,6 +331,7 @@ export default {
},
//
checkSelectData(){
// todo:
// todo:
let _isSelectData = this.$refs.StepsFormTree_Ref.selectData
let _select_ids = []
@ -336,13 +340,13 @@ export default {
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)
console.log(111,_isSelectData)
console.log(222,this.bomList)
console.log(333,_select_ids)
return
this.submitHttp()
},
@ -371,11 +375,55 @@ 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) => {
let _tableList = this.CreateFormData.details
let _empty = 0
console.log(381,_tableList)
_tableList.forEach(item=>{
if(!item.locationCode || item.locationCode.length <= 0){
_empty ++
@ -409,8 +457,11 @@ export default {
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,
@ -422,16 +473,17 @@ export default {
locationGroup:_itemInfo.rawLocationGroup,
locationErpCode:_itemInfo.rawLocationErpCode,
warehouseCode:_itemInfo.warehouseCode,
parentId:item.remark
}
this.CreateFormData.details.push(_item)
})
let _first = this.propsData.details[0]
let _tree = [{
id: _first.id,
id: _faterLevelId,
itemCode: _first.itemCode,
parentCode: _first.itemCode,
isCheck: false,
children:this.buildTree(JSON.parse(JSON.stringify(this.CreateFormData.details)))
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)))

Loading…
Cancel
Save