Browse Source

【nev-pc】kitting申请+kitting任务按钮操作开发

ag_report_nev
安虹睿 12 months ago
parent
commit
8c2425ca04
  1. 8
      fe/PC/src/api/wms-job.js
  2. 5
      fe/PC/src/filters/status.js
  3. 394
      fe/PC/src/mixins/drawerMixins.js
  4. 30
      fe/PC/src/views/kittingManage/KittingIssueJob.vue
  5. 42
      fe/PC/src/views/kittingManage/KittingIssueRequest.vue
  6. 337
      fe/PC/src/views/padManage/padKittingPack.vue

8
fe/PC/src/api/wms-job.js

@ -75,6 +75,14 @@ export function open(url, data) {
}) })
} }
//任务流程——完成
export function CompleteAsyncJob(url,data) {
return request({
url: baseURL + url + '/CompleteAsync/' + data.id,
method: 'post',
})
}
//获取详情 //获取详情
export function getDetailed(id, url) { export function getDetailed(id, url) {

5
fe/PC/src/filters/status.js

@ -131,6 +131,11 @@ import store from '@/store/index'
value: 9, value: 9,
background:"#EC5B28", background:"#EC5B28",
}, },
30: {
label: "等待",
value: 30,
background:"#EC5B28",
},
} }
return Enum(status, index, prop) return Enum(status, index, prop)
} }

394
fe/PC/src/mixins/drawerMixins.js

@ -11,7 +11,8 @@ import {
close, close,
cancel, cancel,
cancelAccept, cancelAccept,
open open,
CompleteAsyncJob
} from '@/api/wms-job' } from '@/api/wms-job'
export const drawerMixins = { export const drawerMixins = {
data() { data() {
@ -57,186 +58,317 @@ export const drawerMixins = {
// 申请业务 流程按钮实现 // 申请业务 流程按钮实现
// 【提交】操作 // 【提交】操作
if (val == requestDataNames.submit) { if (val == requestDataNames.submit) {
that.Loading.appMainLoading = true this.$confirm('是否确定提交?', '提示', {
processRequest(that.propsData.id, that.URL + '/submit/').then(res => { confirmButtonText: '确定',
that.$successMsg('已提交') cancelButtonText: '取消',
getDetailed(that.propsData.id, that.URL).then(res => { type: 'warning'
that.propsData = res }).then(() => {
that.Loading.appMainLoading = true
processRequest(that.propsData.id, that.URL + '/submit/').then(res => {
that.$successMsg('已提交')
getDetailed(that.propsData.id, that.URL).then(res => {
that.propsData = res
})
that.paging()
that.Loading.appMainLoading = false
}).catch(err => {
console.log(err)
that.Loading.appMainLoading = false
}) })
that.paging()
that.Loading.appMainLoading = false
}).catch(err => {
console.log(err)
that.Loading.appMainLoading = false
}) })
.catch(() => {
});
} }
// 【审批】操作 // 【审批】操作
else if (val == requestDataNames.agree) { else if (val == requestDataNames.agree) {
that.Loading.appMainLoading = true this.$confirm('是否确定审批?', '提示', {
processRequest(that.propsData.id, that.URL + '/agree/').then(res => { confirmButtonText: '确定',
that.$successMsg('已同意') cancelButtonText: '取消',
getDetailed(that.propsData.id, that.URL).then(res => { type: 'warning'
that.propsData = res }).then(() => {
that.Loading.appMainLoading = true
processRequest(that.propsData.id, that.URL + '/agree/').then(res => {
that.$successMsg('已同意')
getDetailed(that.propsData.id, that.URL).then(res => {
that.propsData = res
})
that.paging()
that.Loading.appMainLoading = false
}).catch(err => {
console.log(err)
that.Loading.appMainLoading = false
}) })
that.paging()
that.Loading.appMainLoading = false
}).catch(err => {
console.log(err)
that.Loading.appMainLoading = false
}) })
.catch(() => {
});
} }
// 【处理】操作 // 【处理】操作
else if (val == requestDataNames.handle) { else if (val == requestDataNames.handle) {
that.Loading.appMainLoading = true this.$confirm('是否确定处理?', '提示', {
processRequest(that.propsData.id, that.URL + '/handle/').then(res => { confirmButtonText: '确定',
that.$successMsg('处理完成') cancelButtonText: '取消',
getDetailed(that.propsData.id, that.URL).then(res => { type: 'warning'
that.propsData = res }).then(() => {
that.Loading.appMainLoading = true
processRequest(that.propsData.id, that.URL + '/handle/').then(res => {
that.$successMsg('处理完成')
getDetailed(that.propsData.id, that.URL).then(res => {
that.propsData = res
})
that.paging()
that.Loading.appMainLoading = false
}).catch(err => {
console.log(err)
that.Loading.appMainLoading = false
}) })
that.paging()
that.Loading.appMainLoading = false
}).catch(err => {
console.log(err)
that.Loading.appMainLoading = false
}) })
.catch(() => {
});
} }
// 【执行】操作 // 【执行】操作
else if (val == requestDataNames.againHandle) { // 针对部分完成情况下,再次执行任务操作 else if (val == requestDataNames.againHandle) { // 针对部分完成情况下,再次执行任务操作
that.Loading.appMainLoading = true this.$confirm('是否确定执行?', '提示', {
processRequest(that.propsData.id, that.URL + '/handle/').then(res => { confirmButtonText: '确定',
that.$successMsg('执行成功') cancelButtonText: '取消',
getDetailed(that.propsData.id, that.URL).then(res => { type: 'warning'
that.propsData = res }).then(() => {
that.Loading.appMainLoading = true
processRequest(that.propsData.id, that.URL + '/handle/').then(res => {
that.$successMsg('执行成功')
getDetailed(that.propsData.id, that.URL).then(res => {
that.propsData = res
})
that.paging()
that.Loading.appMainLoading = false
}).catch(err => {
console.log(err)
that.Loading.appMainLoading = false
}) })
that.paging()
that.Loading.appMainLoading = false
}).catch(err => {
console.log(err)
that.Loading.appMainLoading = false
}) })
.catch(() => {
});
} }
// 【中止】操作 // 【中止】操作
else if (val == requestDataNames.abort) { else if (val == requestDataNames.abort) {
that.Loading.appMainLoading = true this.$confirm('是否确定中止?', '提示', {
processRequest(that.propsData.id, that.URL + '/abort/').then(res => { confirmButtonText: '确定',
that.$successMsg('已中止') cancelButtonText: '取消',
getDetailed(that.propsData.id, that.URL).then(res => { type: 'warning'
that.propsData = res }).then(() => {
that.Loading.appMainLoading = true
processRequest(that.propsData.id, that.URL + '/abort/').then(res => {
that.$successMsg('已中止')
getDetailed(that.propsData.id, that.URL).then(res => {
that.propsData = res
})
that.paging()
that.Loading.appMainLoading = false
}).catch(err => {
console.log(err)
that.Loading.appMainLoading = false
}) })
that.paging()
that.Loading.appMainLoading = false
}).catch(err => {
console.log(err)
that.Loading.appMainLoading = false
}) })
.catch(() => {
});
} }
// 【执行完成】操作 // 【执行完成】操作
else if (val == 'completeRequest') { else if (val == 'completeRequest') {
that.Loading.appMainLoading = true this.$confirm('是否确定完成?', '提示', {
processRequest(that.propsData.id, that.URL + '/complete/').then(res => { confirmButtonText: '确定',
that.$successMsg('执行完成') cancelButtonText: '取消',
getDetailed(that.propsData.id, that.URL).then(res => { type: 'warning'
that.propsData = res }).then(() => {
that.Loading.appMainLoading = true
processRequest(that.propsData.id, that.URL + '/complete/').then(res => {
that.$successMsg('执行完成')
getDetailed(that.propsData.id, that.URL).then(res => {
that.propsData = res
})
that.paging()
that.Loading.appMainLoading = false
}).catch(err => {
console.log(err)
that.Loading.appMainLoading = false
}) })
that.paging()
that.Loading.appMainLoading = false
}).catch(err => {
console.log(err)
that.Loading.appMainLoading = false
}) })
.catch(() => {
});
} }
// 【取消】操作 // 【取消】操作
else if (val == requestDataNames.cancel) { else if (val == requestDataNames.cancel) {
that.Loading.appMainLoading = true this.$confirm('是否确定取消?', '提示', {
processRequest(that.propsData.id, that.URL + '/cancel/').then(res => { confirmButtonText: '确定',
that.$successMsg('已取消') cancelButtonText: '取消',
getDetailed(that.propsData.id, that.URL).then(res => { type: 'warning'
that.propsData = res }).then(() => {
that.Loading.appMainLoading = true
processRequest(that.propsData.id, that.URL + '/cancel/').then(res => {
that.$successMsg('已取消')
getDetailed(that.propsData.id, that.URL).then(res => {
that.propsData = res
})
that.paging()
that.Loading.appMainLoading = false
}).catch(err => {
console.log(err)
that.Loading.appMainLoading = false
}) })
that.paging()
that.Loading.appMainLoading = false
}).catch(err => {
console.log(err)
that.Loading.appMainLoading = false
}) })
.catch(() => {
});
} }
// 【驳回】操作 // 【驳回】操作
else if (val == requestDataNames.refuse) { else if (val == requestDataNames.refuse) {
that.Loading.appMainLoading = true this.$confirm('是否确定驳回?', '提示', {
processRequest(that.propsData.id, that.URL + '/refuse/').then(res => { confirmButtonText: '确定',
that.$successMsg('已驳回') cancelButtonText: '取消',
getDetailed(that.propsData.id, that.URL).then(res => { type: 'warning'
that.propsData = res }).then(() => {
that.Loading.appMainLoading = true
processRequest(that.propsData.id, that.URL + '/refuse/').then(res => {
that.$successMsg('已驳回')
getDetailed(that.propsData.id, that.URL).then(res => {
that.propsData = res
})
that.paging()
that.Loading.appMainLoading = false
}).catch(err => {
console.log(err)
that.Loading.appMainLoading = false
}) })
that.paging()
that.Loading.appMainLoading = false
}).catch(err => {
console.log(err)
that.Loading.appMainLoading = false
}) })
.catch(() => {
});
} }
// 任务 流程按钮实现 // 任务 流程按钮实现
if (val == 'acceptJob') { if (val == 'acceptJob') {
that.Loading.appMainLoading = true this.$confirm('是否确定接受任务?', '提示', {
accept(that.URL, {id: that.propsData.id}).then(res => { confirmButtonText: '确定',
that.$successMsg('已接任务') cancelButtonText: '取消',
that.Loading.appMainLoading = false type: 'warning'
getDetailed(that.propsData.id, that.URL).then(res => { }).then(() => {
that.propsData = res that.Loading.appMainLoading = true
accept(that.URL, {id: that.propsData.id}).then(res => {
that.$successMsg('已接任务')
that.Loading.appMainLoading = false
getDetailed(that.propsData.id, that.URL).then(res => {
that.propsData = res
})
that.paging();
}).catch(err => {
that.Loading.appMainLoading = false
}) })
that.paging();
}).catch(err => {
that.Loading.appMainLoading = false
}) })
} else if(val == 'closeJob'){ .catch(() => {
that.Loading.appMainLoading = true });
close(that.URL, {id: that.propsData.id}).then(res => { }
that.$successMsg('已关闭任务') else if(val == 'closeJob'){
that.Loading.appMainLoading = false this.$confirm('是否确定关闭任务?', '提示', {
getDetailed(that.propsData.id, that.URL).then(res => { confirmButtonText: '确定',
that.propsData = res cancelButtonText: '取消',
type: 'warning'
}).then(() => {
that.Loading.appMainLoading = true
close(that.URL, {id: that.propsData.id}).then(res => {
that.$successMsg('已关闭任务')
that.Loading.appMainLoading = false
getDetailed(that.propsData.id, that.URL).then(res => {
that.propsData = res
})
that.paging();
}).catch(err => {
that.Loading.appMainLoading = false
})
})
.catch(() => {
});
}
else if(val == 'invalidJob'){
this.$confirm('是否确定作废任务?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
that.Loading.appMainLoading = true
cancel(that.URL, {id: that.propsData.id}).then(res => {
that.$successMsg('已作废任务')
that.Loading.appMainLoading = false
getDetailed(that.propsData.id, that.URL).then(res => {
that.propsData = res
})
that.paging();
}).catch(err => {
that.Loading.appMainLoading = false
}) })
that.paging();
}).catch(err => {
that.Loading.appMainLoading = false
}) })
} else if(val == 'invalidJob'){ .catch(() => {
that.Loading.appMainLoading = true });
cancel(that.URL, {id: that.propsData.id}).then(res => { }
that.$successMsg('已作废任务') // 新版独立操作
that.Loading.appMainLoading = false else if(val == 'CompleteAsyncJob'){
getDetailed(that.propsData.id, that.URL).then(res => { this.$confirm('是否确定完成任务?', '提示', {
that.propsData = res confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
that.Loading.appMainLoading = true
CompleteAsyncJob(that.URL, {id: that.propsData.id}).then(res => {
that.$successMsg('任务已完成')
that.Loading.appMainLoading = false
getDetailed(that.propsData.id, that.URL).then(res => {
that.propsData = res
})
that.paging();
}).catch(err => {
that.Loading.appMainLoading = false
}) })
that.paging();
}).catch(err => {
that.Loading.appMainLoading = false
}) })
} else if(val == 'cancelAcceptJob'){ .catch(() => {
that.Loading.appMainLoading = true });
cancelAccept(that.URL, {id: that.propsData.id}).then(res => { }
that.$successMsg('已取消接受任务') else if(val == 'cancelAcceptJob'){
that.Loading.appMainLoading = false this.$confirm('是否确定取消接受任务?', '提示', {
getDetailed(that.propsData.id, that.URL).then(res => { confirmButtonText: '确定',
that.propsData = res cancelButtonText: '取消',
type: 'warning'
}).then(() => {
that.Loading.appMainLoading = true
cancelAccept(that.URL, {id: that.propsData.id}).then(res => {
that.$successMsg('已取消接受任务')
that.Loading.appMainLoading = false
getDetailed(that.propsData.id, that.URL).then(res => {
that.propsData = res
})
that.paging();
}).catch(err => {
that.Loading.appMainLoading = false
}) })
that.paging();
}).catch(err => {
that.Loading.appMainLoading = false
}) })
} else if(val == 'openJob'){ .catch(() => {
that.Loading.appMainLoading = true });
open(that.URL, {id: that.propsData.id}).then(res => { }
that.$successMsg('已打开任务') else if(val == 'openJob'){
that.Loading.appMainLoading = false this.$confirm('是否确定打开任务?', '提示', {
getDetailed(that.propsData.id, that.URL).then(res => { confirmButtonText: '确定',
that.propsData = res cancelButtonText: '取消',
type: 'warning'
}).then(() => {
that.Loading.appMainLoading = true
open(that.URL, {id: that.propsData.id}).then(res => {
that.$successMsg('已打开任务')
that.Loading.appMainLoading = false
getDetailed(that.propsData.id, that.URL).then(res => {
that.propsData = res
})
that.paging();
}).catch(err => {
that.Loading.appMainLoading = false
}) })
that.paging();
}).catch(err => {
that.Loading.appMainLoading = false
}) })
} else if(val == 'handleJob'){ .catch(() => {
});
}
else if(val == 'handleJob'){
// 请在主页写相关执行任务操作代码 // 请在主页写相关执行任务操作代码
console.log('请在主页写相关执行任务操作代码') console.log('请在主页写相关执行任务操作代码')
} }

30
fe/PC/src/views/kittingManage/KittingIssueJob.vue

@ -43,8 +43,9 @@
:drawer="displayDialog.detailsDialog" :drawer="displayDialog.detailsDialog"
:propsData="propsData" :propsData="propsData"
:tabsDesTions="tabsDesTions" :tabsDesTions="tabsDesTions"
:Butttondata="[]" :Butttondata="DrawerButtonData"
@drawerShut="(val) => (displayDialog.detailsDialog = val)" @drawerShut="(val) => (displayDialog.detailsDialog = val)"
@drawerbutton="drawerbutton"
@handleCommand="drawerHandle" @handleCommand="drawerHandle"
@close-value="closeValue" @close-value="closeValue"
:tableColumns="detailsTableColumns" :tableColumns="detailsTableColumns"
@ -61,6 +62,8 @@
import { drawerMixins } from "@/mixins/drawerMixins"; import { drawerMixins } from "@/mixins/drawerMixins";
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins"; import { TableHeaderMixins } from "@/mixins/TableHeaderMixins";
import { mixins } from "@/mixins/mixins"; import { mixins } from "@/mixins/mixins";
import { complete } from "@/api/wms-job";
export default { export default {
name: "KittingIssueJob", name: "KittingIssueJob",
mixins: [ mixins: [
@ -70,6 +73,19 @@
TableHeaderMixins, TableHeaderMixins,
mixins, mixins,
], ],
computed: {
hideButton: function () {
return function (val) {
let data = true
val.forEach(key => {
if (this.propsData.jobStatus == key) {
data = false
}
})
return data
}
},
},
data() { data() {
return { return {
URL: "wms/store/kitting-issue-job", URL: "wms/store/kitting-issue-job",
@ -80,11 +96,21 @@
this.defaultFreshBtn(),// this.defaultFreshBtn(),//
this.defaultFilterBtn(),// this.defaultFilterBtn(),//
], ],
DrawerButtonData: [
{
type: 'success',
label: '完成',
hide: false,
name: "CompleteAsyncJob",
hide: () => { return this.hideButton([1,2,4]) },
size: 'mini'
},
],
}; };
}, },
mounted() { mounted() {
this.paging(); this.paging();
}, }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

42
fe/PC/src/views/kittingManage/KittingIssueRequest.vue

@ -43,8 +43,9 @@
:drawer="displayDialog.detailsDialog" :drawer="displayDialog.detailsDialog"
:propsData="propsData" :propsData="propsData"
:tabsDesTions="tabsDesTions" :tabsDesTions="tabsDesTions"
:Butttondata="[]" :Butttondata="DrawerButtonData"
@drawerShut="(val) => (displayDialog.detailsDialog = val)" @drawerShut="(val) => (displayDialog.detailsDialog = val)"
@drawerbutton="drawerbutton"
@handleCommand="drawerHandle" @handleCommand="drawerHandle"
@close-value="closeValue" @close-value="closeValue"
:tableColumns="detailsTableColumns" :tableColumns="detailsTableColumns"
@ -70,6 +71,19 @@
TableHeaderMixins, TableHeaderMixins,
mixins, mixins,
], ],
computed: {
hideButton: function () {
return function (val) {
let data = true
val.forEach(key => {
if (this.propsData.requestStatus == key) {
data = false
}
})
return data
}
},
},
data() { data() {
return { return {
URL: "wms/store/kitting-issue-request", URL: "wms/store/kitting-issue-request",
@ -80,6 +94,32 @@
this.defaultFreshBtn(),// this.defaultFreshBtn(),//
this.defaultFilterBtn(),// this.defaultFilterBtn(),//
], ],
DrawerButtonData: [
{
type: 'warning',
label: '执行',
hide: false,
name: "againHandleRequest",
hide: () => { return this.hideButton([1,5,9]) },
size: 'mini'
},
{
type: 'danger',
label: '取消',
hide: false,
name: "cancelRequest",
hide: () => { return this.hideButton([1,5,9]) },
size: 'mini'
},
{
type: 'success',
label: '完成',
hide: false,
name: "completeRequest",
hide: () => { return this.hideButton([1,5,9]) },
size: 'mini'
},
],
}; };
}, },
mounted() { mounted() {

337
fe/PC/src/views/padManage/padKittingPack.vue

@ -7,88 +7,96 @@
v-for="(item,index) of leftButtons" v-for="(item,index) of leftButtons"
:key="index" :key="index"
class="left-button" class="left-button"
@click="letButtonClick(item)" @click="getPageLockList(item)"
:style="{ :style="{
background:(currentKittingInfo && (item.code==currentKittingInfo.code)?'#ff9000':'#409EFF'), background:(currentKittingInfo && (item.code==currentKittingInfo.code)?'#ff6000':'#409EFF'),
}" }"
> >
<p class="code">{{ item.code }}</p> <p class="code">{{ item.code }}</p>
<p class="name">{{ item.name }}</p> <p class="name">{{ item.name }}</p>
</div> </div>
</div> </div>
<!-- 中间底盘号 --> <!-- 整个右侧 -->
<div class="centerChassisContain"> <div class="rightBigBox">
<div class="title">底盘号</div> <div class="lockShadow" v-if="isLock">{{lockTip}}</div>
<ul class="chassisList" v-if="centerChassisList.length > 0"> <!-- 中间底盘号 -->
<li <div class="centerChassisContain">
v-for="(item,index) of centerChassisList" <div class="title">底盘号</div>
:style="{ <ul class="chassisList" v-if="centerChassisList.length > 0">
color:(item.canSelect?'#000':'#aaa'), <li
cursor:(item.canSelect?'pointer':'no-drop'), v-for="(item,index) of centerChassisList"
background:(item.isSelect?'#bdddfd':'#fff'), :style="{
}" color:(item.canSelect?'#000':'#aaa'),
:key="index" cursor:(item.canSelect?'pointer':'no-drop'),
@click="selectCenterChassis(item,index)" background:(item.isSelect?'#bdddfd':'#fff'),
>{{ item.chassisNumber }}</li> }"
</ul> :key="index"
<div class="noDataTipper" v-if="centerChassisList.length <= 0">暂无数据</div> @click="selectCenterChassis(item,index)"
<div class="footer-button"><el-button type="primary" @click="createChassisHandle()">创建底盘组</el-button></div> >{{ item.chassisNumber }}</li>
</div> </ul>
<!-- 右侧底盘组 --> <div class="noDataTipper" v-if="centerChassisList.length <= 0">暂无数据</div>
<div class="rightChassisGroup"> <div class="footer-button"><el-button :disabled="isLock" type="primary" @click="createChassisHandle()">创建底盘组</el-button></div>
<!-- 右上组 -->
<div class="rightTopTable">
<el-table
:border="true"
:data="rightTopChassisGroup"
:height="'100%'"
:header-cell-style="{ background: '#e3f0ff',color:'#333'}"
style="width: 100%">
<el-table-column
prop="chassisNumber"
label="底盘组"
></el-table-column>
<el-table-column
prop="creationTime"
label="时间"
>
<template slot-scope="scope">
{{ formatDate(scope.row.creationTime) }}
</template>
</el-table-column>
</el-table>
</div> </div>
<!-- 右下bom --> <!-- 右侧底盘组 -->
<div class="rightBottomBomData"> <div class="rightChassisGroup">
<el-table <!-- 右上组 -->
:border="true" <div class="rightTopTable">
:data="rightBottomBomData" <el-table
:header-cell-style="{ background: '#e3f0ff',color:'#333'}" :border="true"
style="width: 100%"> :data="rightTopChassisGroup"
<el-table-column :height="'100%'"
prop="itemCode" :header-cell-style="{ background: '#e3f0ff',color:'#333'}"
label="Kitting组别Bom" style="width: 100%">
></el-table-column> <el-table-column
<el-table-column prop="chassisNumber"
prop="qty" label="底盘组"
label="底盘组物品数量" ></el-table-column>
></el-table-column> <el-table-column
<!-- todo: Kiting组数量字段确定--> prop="creationTime"
<el-table-column label="时间"
prop="qty1" >
label="Kiting组数量" <template slot-scope="scope">
></el-table-column> {{ formatDate(scope.row.creationTime) }}
</el-table> </template>
</el-table-column>
</el-table>
</div>
<!-- 右下bom -->
<div class="rightBottomBomData">
<el-table
:border="true"
:data="rightBottomBomData"
:header-cell-style="{ background: '#e3f0ff',color:'#333'}"
style="width: 100%">
<el-table-column
prop="itemCode"
label="Kitting组别Bom"
></el-table-column>
<el-table-column
prop="qty"
label="底盘组物品数量"
></el-table-column>
<!-- todo: Kiting组数量字段确定-->
<el-table-column
prop="qty1"
label="Kiting组数量"
></el-table-column>
</el-table>
</div>
<div class="footer-button">
<el-button :disabled="isLock" type="success" @click="finishChassisHandle">完成该组底盘</el-button>
<el-button class="flesh-btn" type="warning" @click="initData">刷新数据</el-button>
</div>
</div> </div>
<div class="footer-button"><el-button type="success">完成该组底盘</el-button></div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { getPageList } from '@/api/wms-api' import { getPageList,postCreate } from '@/api/wms-api'
import { ChassisGetListWithNextCount } from '@/api/wms-pad' import { ChassisGetListWithNextCount,pageLockToLogin,pageLockToLogout } from '@/api/wms-pad'
import { formatTimeStrToStr } from "@/utils/formatTime" import { formatTimeStrToStr } from "@/utils/formatTime"
import store from '@/store'
export default { export default {
name: "padKittingPack", name: "padKittingPack",
data() { data() {
@ -106,6 +114,10 @@ export default {
rightTopChassisGroup:[], rightTopChassisGroup:[],
// bom // bom
rightBottomBomData:[], rightBottomBomData:[],
//
isLock:false,
//
lockTip:'该菜单已有用户锁定',
}; };
}, },
mounted(){ mounted(){
@ -117,14 +129,11 @@ export default {
}, localStorage.getItem('padKittingPackUpdate') || 180000) }, localStorage.getItem('padKittingPackUpdate') || 180000)
}, },
destroyed() { destroyed() {
clearInterval(this.intervalId) clearInterval(this.intervalId)
}, },
methods:{ methods:{
initData(){ initData(){
this.getKittingList() this.getKittingList()
if(this.currentKittingInfo){
this.letButtonClick(this.currentKittingInfo)
}
}, },
// //
formatDate (time) { formatDate (time) {
@ -133,6 +142,68 @@ export default {
} }
return formatTimeStrToStr(time) return formatTimeStrToStr(time)
}, },
// -
getPageLockList(selectItem){
let _data = {
condition: {
filters: [
{
logic: "And",
column: "menuCode",
action: "==",
value: this.$route.name + '_' + selectItem.code,
},
{
logic: "And",
column: "userAccount",
action: "!=",
value: store.getters.name.name,
}
]
},
Sorting: "",
SkipCount: 0,
MaxResultCount: 9999,
}
this.loading = true
getPageList(_data, 'auth/auth/page-lock').then(res => {
this.currentKittingInfo = selectItem;
//
if(res.items.length <= 0){
this.isLock = false
this.lockUserHandle()
}
//
else{
this.isLock = true
this.initKittingData()
}
}).catch(err => {
this.loading = false
})
},
//
lockUserHandle(){
let _data = {
menuCode:this.$route.name + '_' + this.currentKittingInfo.code,
userAccount:store.getters.name.name,
}
pageLockToLogin(_data)
.then(res=>{
this.initKittingData()
})
.catch(err=>{})
},
// 退todo:
async LogoutUserHandle(e){
let _data = {
menuCode:this.$route.name + '_' + this.currentKittingInfo.code,
userAccount:store.getters.name.name,
}
pageLockToLogout(_data)
.then(res=>{})
.catch(err=>{})
},
// kitting // kitting
getKittingList(){ getKittingList(){
let _data = { let _data = {
@ -146,17 +217,21 @@ export default {
this.loading = true this.loading = true
getPageList(_data, 'basedata/kitting',true).then(res => { getPageList(_data, 'basedata/kitting',true).then(res => {
this.leftButtons = res.items this.leftButtons = res.items
this.loading = false // kitting
if(this.currentKittingInfo){
this.getPageLockList(this.currentKittingInfo)
}else{
this.loading = false
}
}).catch(err => { }).catch(err => {
this.loading = false this.loading = false
}) })
}, },
// //
letButtonClick(selectItem){ initKittingData(){
this.currentKittingInfo = selectItem;
let _data = { let _data = {
count:30, count:30,
kittingCode:selectItem.code kittingCode:this.currentKittingInfo.code
} }
this.loading = true this.loading = true
// //
@ -165,13 +240,13 @@ export default {
this.rightTopChassisGroup = [] this.rightTopChassisGroup = []
// //
// chassisQty // chassisQty
if(res.items.length<Number(selectItem.chassisQty)){ if(res.items.length<Number(this.currentKittingInfo.chassisQty)){
this.centerChassisList = res.items this.centerChassisList = res.items
} }
// chassisQty: // chassisQty:
else{ else{
res.items.forEach((item,index)=>{ res.items.forEach((item,index)=>{
if(index < Number(selectItem.chassisQty)){ if(index < Number(this.currentKittingInfo.chassisQty)){
this.rightTopChassisGroup.push(item) this.rightTopChassisGroup.push(item)
}else{ }else{
item.isSelect = false item.isSelect = false
@ -181,7 +256,7 @@ export default {
}) })
} }
this.centerChassisList[0].canSelect = true this.centerChassisList[0].canSelect = true
this.rightBottomBomData = selectItem.details this.rightBottomBomData = this.currentKittingInfo.details
this.loading = false this.loading = false
}).catch(err => { }).catch(err => {
this.loading = false this.loading = false
@ -214,6 +289,7 @@ export default {
}, },
// //
createChassisHandle(){ createChassisHandle(){
if(this.isLock)return
let _selectItems = this.centerChassisList.filter(item=>{return item.isSelect}) let _selectItems = this.centerChassisList.filter(item=>{return item.isSelect})
if(!_selectItems || _selectItems.length <= 0){ if(!_selectItems || _selectItems.length <= 0){
this.$warningMsg("请选择至少一项") this.$warningMsg("请选择至少一项")
@ -235,8 +311,63 @@ export default {
..._selectItems ..._selectItems
] ]
}).catch(() => { }).catch(() => {
}); });
},
//
finishChassisHandle(){
if(this.isLock)return
this.$confirm('是否确定完成该组底盘', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let _data = {
extraProperties: {},
worker: store.getters.name.userName,
kittingCode: this.currentKittingInfo.code,
depDetails: [],//
details: [],//
}
// depDetails
this.rightTopChassisGroup.forEach(item=>{
let _item = {
itemCode: item.itemCode,
itemName: item.itemName,
itemDesc1: item.itemDesc1,
itemDesc2: item.itemDesc2,
chassisNumber: item.chassisNumber,//
kittingCode: this.currentKittingInfo.code,//code
chassisSortNumber: item.sortNumber,//sortNumber
}
_data.depDetails.push(_item)
})
// details
this.rightBottomBomData.forEach(item=>{
let _item = {
itemCode: item.itemCode,
itemName: item.itemName,
itemDesc1: item.itemDesc1,
itemDesc2: item.itemDesc2,
qty: item.qty,
kittingCode: this.currentKittingInfo.code
}
_data.details.push(_item)
})
this.finishHandleHttp(_data)
}).catch(() => {
});
},
finishHandleHttp(_data){
console.log(286,_data)
return
this.loading = true
postCreate(_data, 'wms/store/KittingPackagingNote').then(res => {
this.initData()
this.loading = false
}).catch(err => {
this.loading = false
})
} }
}, },
}; };
@ -286,18 +417,46 @@ $footerBtn_height:60px;
width:100%; width:100%;
flex-shrink:0; flex-shrink:0;
margin:0; margin:0;
padding:0; padding:0 10px;
font-size:14px;
&.code{ &.code{
font-size:20px font-size:20px
} }
&.name{
overflow: hidden;
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
font-size:14px;
}
} }
} }
} }
.rightBigBox{
display:flex;
width:100%;
position:relative;
.lockShadow{
position:absolute;
left:0;
right:0;
top:0;
bottom:0;
background:rgba(255,255,255,0.7);
z-index:100;
text-align:center;
line-height:50vh;
cursor:no-drop;
color:#ff6000
}
}
.centerChassisContain{ .centerChassisContain{
position:relative; position:relative;
width:calc(30% - 20px); width:calc(35% - 20px);
min-width:260px; min-width:260px;
border:$boxBorder; border:$boxBorder;
padding:$boxPadding; padding:$boxPadding;
@ -343,7 +502,7 @@ $footerBtn_height:60px;
} }
.rightChassisGroup{ .rightChassisGroup{
position:relative; position:relative;
width:55%; width:65%;
min-width:600px; min-width:600px;
border:$boxBorder; border:$boxBorder;
padding:$boxPadding; padding:$boxPadding;
@ -356,13 +515,13 @@ $footerBtn_height:60px;
top:0; top:0;
left:0; left:0;
right:0; right:0;
height:30%; height:40%;
overflow:auto; overflow:auto;
} }
.rightBottomBomData{ .rightBottomBomData{
position:absolute; position:absolute;
top:calc(30% + 30px); top:calc(40% + 10px);
left:0; left:0;
right:0; right:0;
bottom:$footerBtn_height; bottom:$footerBtn_height;
@ -383,6 +542,12 @@ $footerBtn_height:60px;
width:180px; width:180px;
margin-top:10px margin-top:10px
} }
.flesh-btn{
position:absolute;
right:15px;
width:100px
}
} }
} }
</style> </style>
Loading…
Cancel
Save