提交
This commit is contained in:
parent
2872936c77
commit
ce6898816f
|
@ -262,9 +262,11 @@ aside {
|
|||
|
||||
.drawer-content {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
padding: 8px;
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
height: calc(100vh - 100px);
|
||||
}
|
||||
.drawer-operator-box {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
width: 100%;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
padding: 8px 20px;
|
||||
padding: 8px 20px 32px;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,14 +1,6 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" v-show="showSearch" :inline="true" label-width="100px">
|
||||
<el-form-item label="单据ID" prop="erpId">
|
||||
<el-input
|
||||
v-model="queryParams.erpId"
|
||||
placeholder="请输入单据ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据编号" prop="erpBillNo">
|
||||
<el-input
|
||||
v-model="queryParams.erpBillNo"
|
||||
|
@ -82,7 +74,6 @@
|
|||
:width="column.width"
|
||||
>
|
||||
<template slot-scope="d">
|
||||
|
||||
<template v-if="column.key === 'id'">
|
||||
{{d.row[column.key]}}
|
||||
</template>
|
||||
|
@ -98,6 +89,10 @@
|
|||
<template v-else-if="column.key === 'erpIsRework'">
|
||||
<boolean-tag :value="d.row.erpIsRework"/>
|
||||
</template>
|
||||
<template v-else-if="['erpQty', 'erpNoStockInQty'].includes(column.key)">
|
||||
{{d.row[column.key]}}
|
||||
<template v-if="!isEmpty(d.row.unitName)">{{d.row.unitName}}</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{d.row[column.key] | dv}}
|
||||
</template>
|
||||
|
@ -123,7 +118,7 @@ import Price from "@/views/yh/price/index.vue";
|
|||
import DeptTreeSelect from "@/components/Business/Dept/DeptTreeSelect.vue";
|
||||
import {$showColumns} from "@/utils/mixins";
|
||||
import {listPrice} from "@/api/yh/price";
|
||||
import {deepClone} from "@/utils";
|
||||
import {deepClone, isEmpty} from "@/utils";
|
||||
import {listProdOrder} from "@/api/yh/prodOrder";
|
||||
|
||||
const defaultSort = {
|
||||
|
@ -172,7 +167,8 @@ export default {
|
|||
pageSize: 10,
|
||||
orderByColumn: defaultSort.prop,
|
||||
isAsc: defaultSort.order,
|
||||
erpStatusList: []
|
||||
erpStatusList: [],
|
||||
erpIsRework: null,
|
||||
},
|
||||
total: 0,
|
||||
selected: [],
|
||||
|
@ -180,28 +176,30 @@ export default {
|
|||
columns: [
|
||||
{key: 'id', visible: false, label: '生产订单ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'erpId', visible: false, label: '单据ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'erpBillNo', visible: true, label: '单据编号', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'erpBillNo', visible: true, label: '编号', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'erpDocumentStatus', visible: false, label: '单据状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'erpCreateDate', visible: false, label: '创建日期', minWidth: null, sortable: false, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'erpModifyDate', visible: false, label: '修改日期', minWidth: null, sortable: false, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'erpDescription', visible: false, label: '主表备注', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'erpDate', visible: false, label: '单据日期', minWidth: null, sortable: false, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'materialNumber', visible: true, label: '物料编码', minWidth: null, sortable: false, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'erpIsRework', visible: true, label: '是否返工', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'materialNumber', visible: true, label: '物料', minWidth: null, sortable: false, overflow: false, align: 'center', width: null},
|
||||
{key: 'erpIsRework', visible: true, label: '返工', minWidth: null, sortable: false, overflow: false, align: 'center', width: "60"},
|
||||
{key: 'erpRowId', visible: false, label: '行标识', minWidth: null, sortable: true, overflow: true, align: 'center', width: null},
|
||||
{key: 'erpMemoItem', visible: true, label: '备注', minWidth: null, sortable: true, overflow: true, align: 'center', width: "100"},
|
||||
{key: 'erpConveyDate', visible: true, label: '下达日期', minWidth: null, sortable: false, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'erpStatus', visible: true, label: '状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'workShopName', visible: true, label: '车间', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'erpMemoItem', visible: true, label: '备注', minWidth: null, sortable: false, overflow: true, align: 'center', width: null},
|
||||
{key: 'erpConveyDate', visible: true, label: '下达日期', minWidth: null, sortable: false, overflow: false, align: 'center', width: "90"},
|
||||
{key: 'erpStatus', visible: true, label: '状态', minWidth: null, sortable: false, overflow: false, align: 'center', width: "60"},
|
||||
{key: 'workShopName', visible: true, label: '车间', minWidth: null, sortable: false, overflow: false, align: 'center', width: null},
|
||||
{key: 'erpReqSrc', visible: false, label: '需求来源', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'erpQty', visible: true, label: '数量', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'erpNoStockInQty', visible: true, label: '未入库', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'erpBaseUnitQty', visible: false, label: '基本单位数量', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'unitName', visible: true, label: '单位', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'unitName', visible: false, label: '单位', minWidth: null, sortable: false, overflow: false, align: 'center', width: "50"},
|
||||
{key: 'erpQty', visible: true, label: '数量', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'erpBaseUnitQty', visible: false, label: '基本单位数量', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'erpNoStockInQty', visible: true, label: '未入库', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'erpBaseNoStockInQty', visible: false, label: '基本未入库', minWidth: null, sortable: true, overflow: false, align: 'center', width: "120"},
|
||||
],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
console.log("created", this.query);
|
||||
this.queryParams = {
|
||||
...this.queryParams,
|
||||
...this.query,
|
||||
|
@ -216,6 +214,7 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
isEmpty,
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
|
|
|
@ -3,15 +3,14 @@
|
|||
|
||||
<template>
|
||||
<el-dialog :title="title" :visible="show" width="90%" top="2vh" @close="close" :append-to-body="true">
|
||||
<el-scrollbar style="height: 50vh">
|
||||
<prod-order-check
|
||||
v-if="show"
|
||||
ref="check"
|
||||
:multiple="multiple"
|
||||
:init-select="initSelect"
|
||||
v-on="$listeners"
|
||||
:query="query"
|
||||
/>
|
||||
</el-scrollbar>
|
||||
<template #footer>
|
||||
<el-button type="primary" @click="submit()">确定</el-button>
|
||||
</template>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
ref="check"
|
||||
:multiple="multiple"
|
||||
:init-select="initSelect"
|
||||
:query="query"
|
||||
v-on="$listeners"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
@ -85,6 +85,14 @@ export default {
|
|||
type: String,
|
||||
default: 'dialog',
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: "选择生产订单"
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: "点击选择生产订单"
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
64
src/components/DateRangePicker/index.vue
Normal file
64
src/components/DateRangePicker/index.vue
Normal file
|
@ -0,0 +1,64 @@
|
|||
<template>
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:picker-options="pickerOptions"
|
||||
:clearable="false"
|
||||
v-on="$listeners"
|
||||
/>
|
||||
</template>
|
||||
<script >
|
||||
import { getLastDate, getLastMonth } from '@/utils'
|
||||
|
||||
export default {
|
||||
name: "DateRangePicker",
|
||||
props: {
|
||||
value: {
|
||||
type: Array,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
text: '最近一周',
|
||||
onClick(picker) {
|
||||
const end = getLastDate(0);
|
||||
const start = getLastDate(6);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}, {
|
||||
text: '最近一个月',
|
||||
onClick(picker) {
|
||||
const end = getLastDate(0);
|
||||
const start = getLastMonth(1);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}, {
|
||||
text: '最近三个月',
|
||||
onClick(picker) {
|
||||
const end = getLastDate(0);
|
||||
const start = getLastMonth(3);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}]
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dateRange: {
|
||||
get() {
|
||||
return this.value
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('input', val);
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
|
@ -40,6 +40,9 @@ export default {
|
|||
|
||||
<style scoped lang="scss">
|
||||
.table-form-item {
|
||||
margin: 0 0 12px;
|
||||
margin: 0;
|
||||
}
|
||||
.is-error {
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -8,20 +8,11 @@
|
|||
<div class="right-menu">
|
||||
<template v-if="device!=='mobile'">
|
||||
<search id="header-search" class="right-menu-item" />
|
||||
<!-- <screenfull id="screenfull" class="right-menu-item hover-effect" />-->
|
||||
|
||||
<el-tooltip content="源码地址" effect="dark" placement="bottom">
|
||||
<ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
|
||||
</el-tooltip>
|
||||
|
||||
<el-tooltip content="文档地址" effect="dark" placement="bottom">
|
||||
<ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />
|
||||
</el-tooltip>
|
||||
|
||||
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
||||
|
||||
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
||||
<size-select id="size-select" class="right-menu-item hover-effect" />
|
||||
</el-tooltip>
|
||||
<!-- <el-tooltip content="布局大小" effect="dark" placement="bottom">-->
|
||||
<!-- <size-select id="size-select" class="right-menu-item hover-effect" />-->
|
||||
<!-- </el-tooltip>-->
|
||||
|
||||
</template>
|
||||
|
||||
|
|
117
src/main.js
117
src/main.js
|
@ -88,3 +88,120 @@ new Vue({
|
|||
store,
|
||||
render: h => h(App)
|
||||
})
|
||||
|
||||
|
||||
// 全局添加table左右拖动效果的指令
|
||||
Vue.directive('tableMove', {
|
||||
bind: function (el, binding, vnode) {
|
||||
var odiv = el // 获取当前表格元素
|
||||
|
||||
// 修改样式小手标志
|
||||
// el.style.cursor = 'pointer'
|
||||
el.querySelector('.el-table .el-table__body-wrapper').style.cursor = 'pointer'
|
||||
|
||||
var mouseDownAndUpTimer = null
|
||||
var mouseOffset = 0
|
||||
var mouseFlag = false
|
||||
|
||||
let bindRef = binding.value[0] //绑定的表格的ref属性
|
||||
|
||||
|
||||
odiv.onmousedown = (e) => {
|
||||
const ePath = composedPath(e)
|
||||
// 拖拽表头不滑动
|
||||
if (ePath.some(res => {
|
||||
return res && res.className && res.className.indexOf('el-table__header') > -1
|
||||
})) return
|
||||
|
||||
if (e.which !== 1) return
|
||||
|
||||
mouseOffset = e.clientX
|
||||
mouseDownAndUpTimer = setTimeout(function () {
|
||||
mouseFlag = true
|
||||
}, 80)
|
||||
}
|
||||
|
||||
odiv.onmouseup = (e) => {
|
||||
setTimeout(() => {
|
||||
// 解决拖动列宽行不对齐问题--渲染表格
|
||||
vnode.context.$refs[bindRef].doLayout()
|
||||
}, 200)
|
||||
if (mouseFlag) {
|
||||
mouseFlag = false
|
||||
} else {
|
||||
clearTimeout(mouseDownAndUpTimer) // 清除延迟时间
|
||||
}
|
||||
}
|
||||
|
||||
odiv.onmouseleave = (e) => {
|
||||
setTimeout(() => {
|
||||
// 解决拖动列宽行不对齐问题--渲染表格
|
||||
vnode.context.$refs[bindRef].doLayout()
|
||||
}, 200)
|
||||
mouseFlag = false
|
||||
}
|
||||
|
||||
odiv.onmousemove = (e) => {
|
||||
if (e.which !== 1) return
|
||||
|
||||
const divData = odiv.querySelector('.el-table .el-table__body-wrapper')
|
||||
if (mouseFlag && divData) {
|
||||
// 设置水平方向的元素的位置
|
||||
divData.scrollLeft -= (-mouseOffset + (mouseOffset = e.clientX))
|
||||
}
|
||||
}
|
||||
|
||||
// 解决有些时候,在鼠标松开的时候,元素仍然可以拖动;
|
||||
odiv.ondragstart = (e) => {
|
||||
e.preventDefault()
|
||||
}
|
||||
|
||||
odiv.ondragend = (e) => {
|
||||
e.preventDefault()
|
||||
}
|
||||
|
||||
// 点击复制文本
|
||||
// odiv.onclick = (e) => {
|
||||
// setTimeout(() => {
|
||||
// if (mouseFlag) return
|
||||
// if (e.target.nodeName === 'SPAN') {
|
||||
// console.log(mouseFlag, e.target.nodeName, this)
|
||||
// var aux = document.createElement('input')
|
||||
// aux.setAttribute('value', e.target.outerText)
|
||||
// document.body.appendChild(aux)
|
||||
// aux.select()
|
||||
// document.execCommand('copy')
|
||||
// document.body.removeChild(aux)
|
||||
// if (document.execCommand('copy')) {
|
||||
// console.log('复制成功')
|
||||
// } else {
|
||||
// console.log('复制失败')
|
||||
// }
|
||||
// }
|
||||
// }, 300)
|
||||
// }
|
||||
|
||||
// 是否拖拽可选中文字
|
||||
odiv.onselectstart = () => {
|
||||
return false
|
||||
}
|
||||
|
||||
//浏览器Event.path属性不存在
|
||||
function composedPath(e) {
|
||||
// 存在则直接return
|
||||
if (e.path) {
|
||||
return e.path
|
||||
}
|
||||
// 不存在则遍历target节点
|
||||
let target = e.target
|
||||
e.path = []
|
||||
while (target.parentNode !== null) {
|
||||
e.path.push(target)
|
||||
target = target.parentNode
|
||||
}
|
||||
// 最后补上document和window
|
||||
e.path.push(document, window)
|
||||
return e.path
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -29,6 +29,11 @@ export default {
|
|||
return router.push(obj);
|
||||
}
|
||||
},
|
||||
// 关闭当前tab页签,并回到上个页签
|
||||
closeBack() {
|
||||
store.dispatch("tagsView/delView", router.currentRoute);
|
||||
return router.back();
|
||||
},
|
||||
// 关闭指定tab页签
|
||||
closePage(obj) {
|
||||
if (obj === undefined) {
|
||||
|
|
|
@ -71,3 +71,24 @@ export const ReportStatus = {
|
|||
return [this.PASS, this.REJECT].includes(status);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生产订单ERP业务状态
|
||||
*/
|
||||
export const ProdOrderErpStatus = {
|
||||
PLAN: "1", // 计划
|
||||
PLAN_CONFIRM: "2", // 计划确认
|
||||
ISSUED: "3", // 下达
|
||||
START_WORK: "4", // 开工
|
||||
END_WORK: "5", // 完工
|
||||
CLOSED: "6", // 结案
|
||||
FINISHED: "7", // 结算
|
||||
}
|
||||
|
||||
/**
|
||||
* 报表工序类型
|
||||
*/
|
||||
export const ReportPriceType = {
|
||||
PUBLIC: "1", // 公共工序
|
||||
BILL: "2", // 订单工序
|
||||
}
|
||||
|
|
|
@ -442,3 +442,60 @@ export function notNullDecimal(val) {
|
|||
export function isEmpty(val) {
|
||||
return val == null || val.length === 0;
|
||||
}
|
||||
|
||||
// 获取前n天的日期
|
||||
export function getLastDate(n) {
|
||||
let now = new Date();
|
||||
return new Date(now.getTime() - n * 24 * 3600 * 1000)
|
||||
}
|
||||
|
||||
// 获取前n月的日期
|
||||
export function getLastMonth(n) {
|
||||
const date = new Date();
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth();
|
||||
const day = date.getDate();
|
||||
|
||||
// 减去 n 个月
|
||||
date.setMonth(month - n);
|
||||
|
||||
// 确保日期不超过当月的最大天数
|
||||
const maxDay = new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();
|
||||
date.setDate(Math.min(day, maxDay));
|
||||
|
||||
return date;
|
||||
}
|
||||
|
||||
// 获取前n月的日期字符串
|
||||
export function getLastMonthDateStr(n) {
|
||||
let date = getLastMonth(n);
|
||||
return parseTime(date, "{y}-{m}-{d}")
|
||||
}
|
||||
|
||||
// 获取前n天的日期字符串
|
||||
export function getLastDateStr(n) {
|
||||
let date = getLastDate(n);
|
||||
return parseTime(date, "{y}-{m}-{d}");
|
||||
}
|
||||
|
||||
// 获取前n天的日期时间字符串00:00:00
|
||||
export function getLastDateTimeStartStr(n) {
|
||||
let date = getLastDate(n);
|
||||
return parseTime(date, "{y}-{m}-{d} 00:00:00");
|
||||
}
|
||||
|
||||
// 获取前n天的日期时间字符串23:59:59
|
||||
export function getLastDateTimeEndStr(n) {
|
||||
let date = getLastDate(n);
|
||||
return parseTime(date, "{y}-{m}-{d} 23:59:59");
|
||||
}
|
||||
|
||||
// 获取前n天的日期时间00:00:00
|
||||
export function getLastDateTimeStart(n) {
|
||||
return new Date(getLastDateTimeStartStr(n));
|
||||
}
|
||||
|
||||
// 获取前n天的日期时间23:59:59
|
||||
export function getLastDateTimeEnd(n) {
|
||||
return new Date(getLastDateTimeEndStr(n));
|
||||
}
|
||||
|
|
1012
src/views/index.vue
1012
src/views/index.vue
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,27 @@
|
|||
<template>
|
||||
<div class="ipad-container" v-loading="loading">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="报表日期" prop="reportDateRange" label-width="80px">
|
||||
<date-range-picker v-model="queryParams.reportDateRange" @change="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="statusList">
|
||||
<el-checkbox-group v-model="queryParams.statusList" @change="handleQuery">
|
||||
<el-checkbox-button
|
||||
v-for="dict in dict.type.report_status"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}
|
||||
</el-checkbox-button>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="部门" prop="deptId">-->
|
||||
<!-- <dept-tree-select v-model="form.deptId" class="small-tree-select" @change="handleQuery"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div class="top-bar">
|
||||
<el-button
|
||||
|
@ -90,6 +112,8 @@
|
|||
import {$showColumns} from "@/utils/mixins";
|
||||
import {cancelReport, delReport, listReport, submitReport} from "@/api/yh/report";
|
||||
import {ReportStatus} from "@/utils/constants";
|
||||
import DeptTreeSelect from "@/components/Business/Dept/DeptTreeSelect.vue";
|
||||
import DateRangePicker from "@/components/DateRangePicker/index.vue";
|
||||
|
||||
// 默认排序字段
|
||||
const defaultSort = {
|
||||
|
@ -98,6 +122,7 @@ const defaultSort = {
|
|||
}
|
||||
export default {
|
||||
name: "IpadReport",
|
||||
components: {DateRangePicker, DeptTreeSelect},
|
||||
computed: {
|
||||
ReportStatus() {
|
||||
return ReportStatus
|
||||
|
@ -110,18 +135,18 @@ export default {
|
|||
row: {},
|
||||
// 字段列表
|
||||
columns: [
|
||||
{key: 'reportId', visible: false, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'deptName', visible: true, label: '部门', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'reportDate', visible: true, label: '报表日期', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'totalAmount', visible: true, label: '总金额', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'reportId', visible: true, label: '报表编号', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'deptName', visible: false, label: '部门', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'reportDate', visible: false, label: '报表日期', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'status', visible: true, label: '状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'totalAmount', visible: true, label: '总金额', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'remark', visible: true, label: '备注', minWidth: null, sortable: false, overflow: false, align: 'center', width: "180"},
|
||||
{key: 'createBy', visible: true, label: '创建人', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'createTime', visible: true, label: '创建时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: "180"},
|
||||
{key: 'updateBy', visible: true, label: '更新人', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'updateTime', visible: true, label: '更新时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: "180"},
|
||||
{key: 'verifyBy', visible: true, label: '审核人', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'verifyTime', visible: true, label: '审核时间', minWidth: null, sortable: false, overflow: false, align: 'center', width: "180"},
|
||||
{key: 'remark', visible: true, label: '备注', minWidth: null, sortable: false, overflow: false, align: 'center', width: "180"},
|
||||
],
|
||||
// 排序方式
|
||||
orderSorts: ['ascending', 'descending', null],
|
||||
|
@ -159,7 +184,9 @@ export default {
|
|||
verifyId: null,
|
||||
verifyBy: null,
|
||||
updateId: null,
|
||||
updateBy: null
|
||||
updateBy: null,
|
||||
statusList: [],
|
||||
reportDateRange: [],
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
|
@ -192,12 +219,14 @@ export default {
|
|||
}
|
||||
this.loading = true;
|
||||
this.queryParams.pageNum ++;
|
||||
listReport(this.queryParams).then(response => {
|
||||
this.reportList.push(...response.rows) ;
|
||||
this.total = response.total;
|
||||
listReport(this.queryParams).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.reportList.push(...res.rows) ;
|
||||
this.total = res.total;
|
||||
if (this.total <= this.reportList.length) {
|
||||
this.noMore = true;
|
||||
}
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
})
|
||||
|
|
|
@ -1,14 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="单据ID" prop="erpId">
|
||||
<el-input
|
||||
v-model="queryParams.erpId"
|
||||
placeholder="请输入单据ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="单据编号" prop="erpBillNo">
|
||||
<el-input
|
||||
v-model="queryParams.erpBillNo"
|
||||
|
@ -128,6 +120,10 @@
|
|||
<template v-else-if="column.key === 'erpIsRework'">
|
||||
<boolean-tag :value="d.row.erpIsRework"/>
|
||||
</template>
|
||||
<template v-else-if="['erpQty', 'erpNoStockInQty'].includes(column.key)">
|
||||
{{d.row[column.key]}}
|
||||
<template v-if="!isEmpty(d.row.unitName)">{{d.row.unitName}}</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{d.row[column.key]}}
|
||||
</template>
|
||||
|
@ -244,6 +240,7 @@ import { $showColumns } from '@/utils/mixins';
|
|||
import FormCol from "@/components/FormCol/index.vue";
|
||||
import DeptTreeSelect from "@/components/Business/Dept/DeptTreeSelect.vue";
|
||||
import BooleanTag from "@/components/BooleanTag/index.vue";
|
||||
import {isEmpty} from "@/utils";
|
||||
|
||||
// 默认排序字段
|
||||
const defaultSort = {
|
||||
|
@ -277,10 +274,12 @@ export default {
|
|||
{key: 'erpStatus', visible: true, label: '业务状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'workShopName', visible: true, label: '生产车间', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'erpReqSrc', visible: true, label: '需求来源', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'unitName', visible: false, label: '单位', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'erpQty', visible: true, label: '数量', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'erpBaseUnitQty', visible: true, label: '基本', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'unitName', visible: true, label: '单位', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'erpBaseUnitQty', visible: false, label: '基本', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'erpNoStockInQty', visible: true, label: '未入库', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'erpBaseNoStockInQty', visible: false, label: '基本未入库', minWidth: null, sortable: true, overflow: false, align: 'center', width: "130"},
|
||||
{key: 'baseUnitName', visible: false, label: '基本单位', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
],
|
||||
// 排序方式
|
||||
orderSorts: ['ascending', 'descending', null],
|
||||
|
@ -342,6 +341,7 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
isEmpty,
|
||||
handleSync() {
|
||||
syncProdOrder().then(res => {
|
||||
if (res.code === 200) {
|
||||
|
|
|
@ -104,10 +104,10 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="明细信息" align="center" width="160">
|
||||
<template scope="d">
|
||||
<div class="more-row" v-for="(userProd, index) of d.row.userProdList" @click="handleShowMore(d.row)">
|
||||
<div class="more-row" v-for="(userProd, index) of d.row.userProdList" @click="handleShowMore(d.row, d.$index)">
|
||||
{{index + 1}}、{{userProd.userName | dv}} {{userProd.num | dv}} {{d.row.priceUnit}}
|
||||
</div>
|
||||
<div class="more-row" v-for="(order, index) of d.row.orderProdList" @click="handleShowMore(d.row)">
|
||||
<div class="more-row" v-for="(order, index) of d.row.orderProdList" @click="handleShowMore(d.row, d.$index)">
|
||||
{{index + 1}}、{{order.orderErpBillNo}} {{order.num}} {{d.row.priceUnit}}
|
||||
</div>
|
||||
</template>
|
||||
|
@ -115,7 +115,7 @@
|
|||
|
||||
<el-table-column width="160" align="center" label="操作">
|
||||
<template slot-scope="d">
|
||||
<el-button type="text" size="mini" @click="handleShowMore(d.row)" icon="el-icon-edit">编辑</el-button>
|
||||
<el-button type="text" size="mini" @click="handleShowMore(d.row, d.$index)" icon="el-icon-edit">编辑</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
|
@ -128,7 +128,7 @@
|
|||
</el-table>
|
||||
|
||||
<!--编辑明细-->
|
||||
<report-product-row-edit :row="row" :visible.sync="showMore" :rules="rules"/>
|
||||
<report-product-row-edit :row="row" :visible.sync="showMore" :rules="rules" @submit="onSubmitRow"/>
|
||||
|
||||
<!--工序选择-->
|
||||
<price-drawer
|
||||
|
@ -232,6 +232,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
row: {}, // 当前操作行
|
||||
index: {}, // 当前操作行索引
|
||||
selection: [], // 当前选中的所有行
|
||||
showPriceDialog: false,
|
||||
showUserProductBatchDialog: false,
|
||||
|
@ -242,8 +243,13 @@ export default {
|
|||
|
||||
},
|
||||
methods: {
|
||||
handleShowMore(row) {
|
||||
onSubmitRow(data) {
|
||||
console.log("onSubmitRow", data)
|
||||
this.value.splice(this.index, 1, data);
|
||||
},
|
||||
handleShowMore(row, index) {
|
||||
this.row = row;
|
||||
this.index = index;
|
||||
this.showMore = true;
|
||||
},
|
||||
// 添加一行
|
||||
|
@ -347,11 +353,8 @@ export default {
|
|||
totalNum = notNullDecimal(item.num).add(totalNum);
|
||||
})
|
||||
if (totalNum.toNumber() !== rowNum.toNumber()) {
|
||||
if (isEmpty(row.userProdList[0].num)) {
|
||||
row.userProdList[0].num = totalNum.toNumber();
|
||||
} else {
|
||||
row.userProdList[0].num = notNullDecimal(row.userProdList[0].num).add(totalNum.sub(rowNum)).toNumber();
|
||||
}
|
||||
let subtract = rowNum.sub(totalNum); // 差值
|
||||
row.userProdList[0].num = notNullDecimal(row.userProdList[0].num).add(subtract).toNumber();
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -1,35 +1,44 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-table :data="value" style="margin-left: 16px; width: calc(100% - 16px)" size="mini">
|
||||
<el-table-column label="订单" align="center" width="180">
|
||||
<el-table-column label="订单" align="center" min-width="180">
|
||||
<template slot-scope="d">
|
||||
<form-col table label-width="0">
|
||||
<prod-order-input v-model="d.row.orderId" @change="(val) => onChangeProdOrder(d.row, val)"/>
|
||||
<form-col table label-width="0" :prop="`orderProdList[${d.$index}].orderId`" :rules="rules.orderId">
|
||||
<prod-order-input v-model="d.row.orderId" @change="(val) => onChangeProdOrder(d.row, val)" :query="orderQuery"/>
|
||||
</form-col>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="生产数量" align="center" width="180">
|
||||
<el-table-column label="产量" align="center" min-width="180" >
|
||||
<template slot-scope="d">
|
||||
<form-col table label-width="0">
|
||||
<el-input v-model="d.row.num" type="number" :min="0"/>
|
||||
<form-col table label-width="0" :prop="`orderProdList[${d.$index}].num`" :rules="rules.num">
|
||||
<el-input v-model="d.row.num" type="number" :min="0" placeholder="请输入订单产量">
|
||||
<template #suffix v-if="priceUnit != null">{{priceUnit}}</template>
|
||||
</el-input>
|
||||
</form-col>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划" align="center">
|
||||
<!-- <el-table-column label="单位" align="center">-->
|
||||
<!-- <template slot-scope="d">-->
|
||||
<!-- {{d.row.unitName | dv}}-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="计划数量" align="center">
|
||||
<template slot-scope="d">
|
||||
{{d.row.orderErpQty | dv}}
|
||||
<template v-if="!isEmpty(d.row.unitName)"> {{d.row.unitName}}</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="未入库" align="center">
|
||||
<template slot-scope="d">
|
||||
{{d.row.orderErpNoStockInQty | dv}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="进度" align="center">
|
||||
<template slot-scope="d">
|
||||
<el-progress text-inside :stroke-width="16" :percentage="percentage(d.row)" :color="customColors" text-color="#fff"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="已审核数量" align="center">-->
|
||||
<!-- <template slot-scope="d">-->
|
||||
<!-- {{d.row.verifyBaseNum | dv}}-->
|
||||
<!-- <template v-if="!isEmpty(d.row.baseUnitName)"> {{d.row.baseUnitName}}</template>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column label="进度" align="center">-->
|
||||
<!-- <template slot-scope="d">-->
|
||||
<!-- <el-progress text-inside :stroke-width="16" :percentage="percentage(d.row)" :color="customColors" text-color="#fff"/>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column align="center" width="100">
|
||||
<template #header>
|
||||
<el-button
|
||||
|
@ -56,6 +65,7 @@
|
|||
:show.sync="showProdOrderDialog"
|
||||
multiple
|
||||
@select="onSelectProdOrder"
|
||||
:query="orderQuery"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -64,8 +74,10 @@ import FormCol from "@/components/FormCol/index.vue";
|
|||
import ProdOrderInput from "@/components/Business/ProdOrder/ProdOrderInput.vue";
|
||||
import ProdOrderDrawer from "@/components/Business/ProdOrder/ProdOrderDrawer.vue";
|
||||
import HoverShow from "@/components/HoverShow/index.vue";
|
||||
import {notNullDecimal} from "@/utils";
|
||||
import {isEmpty, notNullDecimal} from "@/utils";
|
||||
import Decimal from "decimal.js";
|
||||
import {calcMulDecimal} from "@/utils/money";
|
||||
import {ProdOrderErpStatus} from "@/utils/constants";
|
||||
|
||||
export default {
|
||||
name: "ReportProductOrderListEdit",
|
||||
|
@ -80,6 +92,16 @@ export default {
|
|||
rules: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
// 倍数
|
||||
quantity: {
|
||||
type: Number,
|
||||
default: null
|
||||
},
|
||||
// 工序单位
|
||||
priceUnit: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -97,32 +119,53 @@ export default {
|
|||
// 百分比
|
||||
percentage() {
|
||||
return (row) => {
|
||||
let plan = notNullDecimal(row.orderErpQty); // 计划数量
|
||||
let noStock = notNullDecimal(row.orderErpNoStockInQty); // ERP未入库数量
|
||||
let current = notNullDecimal(row.num); // 当前填入数量
|
||||
let plan = notNullDecimal(row.orderErpBaseUnitQty); // 基本计划数量
|
||||
let noStock = notNullDecimal(row.orderErpBaseNoStockInQty); // ERP基本未入库数量
|
||||
let current = notNullDecimal(calcMulDecimal(row.num, this.quantity)); // 当前填入数量 * 倍数
|
||||
console.log(`plan ${plan} noStock ${noStock} current ${current} quantity ${this.quantity}`)
|
||||
return new Decimal(
|
||||
current.add(plan.sub(noStock)).mul(new Decimal(100)).div(plan).toFixed(2)
|
||||
).toNumber();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 订单查询条件
|
||||
*/
|
||||
orderQuery() {
|
||||
return {
|
||||
erpStatusList: [ProdOrderErpStatus.START_WORK],
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
isEmpty,
|
||||
handleDel(index) {
|
||||
this.value.splice(index, 1)
|
||||
},
|
||||
onChangeProdOrder(row, item) {
|
||||
row.orderErpQty = item.erpQty;
|
||||
row.orderErpBaseUnitQty = item.erpBaseUnitQty;
|
||||
row.orderErpNoStockInQty = item.erpNoStockInQty;
|
||||
row.orderErpBillNo = item.erpBillNo;
|
||||
row.orderErpBaseNoStockInQty = item.erpBaseNoStockInQty;
|
||||
row.unitName = item.unitName;
|
||||
row.verifiedBaseNum = item.verifiedBaseNum;
|
||||
row.baseUnitName = item.baseUnitName;
|
||||
},
|
||||
onSelectProdOrder(list) {
|
||||
let data = list.map(item => {
|
||||
return {
|
||||
orderId: item.id,
|
||||
num: 0,
|
||||
num: null,
|
||||
orderErpBillNo: item.erpBillNo,
|
||||
orderErpQty: item.erpQty,
|
||||
orderErpBaseUnitQty: item.erpBaseUnitQty,
|
||||
orderErpNoStockInQty: item.erpNoStockInQty,
|
||||
orderErpBaseNoStockInQty: item.erpBaseNoStockInQty,
|
||||
unitName: item.unitName,
|
||||
verifiedBaseNum: item.verifiedBaseNum,
|
||||
baseUnitName: item.baseUnitName
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -1,46 +1,58 @@
|
|||
<template>
|
||||
<el-drawer :visible.sync="showMore" :with-header="false" size="800px" :before-close="beforeClose">
|
||||
<el-drawer :visible.sync="showMore" :with-header="false" size="90%" @open="onOpen" :before-close="beforeClose">
|
||||
<div class="drawer-container">
|
||||
<div class="drawer-operator-box">
|
||||
<el-button @click="cancel" icon="el-icon-close">取 消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" icon="el-icon-check">保 存</el-button>
|
||||
</div>
|
||||
<div class="drawer-content">
|
||||
<el-form :model="row" :rules="rules" ref="form" label-width="6em">
|
||||
<el-form :model="form" :rules="rules" ref="form" label-width="6em">
|
||||
<el-row>
|
||||
<form-col :span="span" label="工序" prop="priceId">
|
||||
<price-input v-model="row.priceId" open-type="dialog" @change="onChangePrice" placeholder="点击选择工序" title="选择工序"/>
|
||||
<price-input v-model="form.priceId" open-type="dialog" @change="onChangePrice" placeholder="点击选择工序" title="选择工序"/>
|
||||
</form-col>
|
||||
<form-col :span="span" label="工序类型" prop="priceType">
|
||||
<el-select v-model="row.priceType" style="width: 100%">
|
||||
<el-select v-model="form.priceType" style="width: 100%">
|
||||
<el-option v-for="(item, index) in dict.type.price_type" :key="index" :label="item.label" :value="item.value"/>
|
||||
</el-select>
|
||||
</form-col>
|
||||
<form-col :span="span" label="良品数" prop="num">
|
||||
<el-input v-model="row.num" type="number" :min="0" placeholder="请输入良品数">
|
||||
<el-input v-model="form.num" type="number" :min="0" placeholder="请输入良品数">
|
||||
<template #suffix>
|
||||
{{row.priceUnit}}
|
||||
{{form.priceUnit}}
|
||||
</template>
|
||||
</el-input>
|
||||
</form-col>
|
||||
<form-col :span="span" label="不良品数" prop="defectNum">
|
||||
<el-input v-model="row.defectNum" type="number" :min="0" placeholder="请输入不良品数">
|
||||
<el-input v-model="form.defectNum" type="number" :min="0" placeholder="请输入不良品数">
|
||||
<template #suffix>
|
||||
{{row.priceUnit}}
|
||||
{{form.priceUnit}}
|
||||
</template>
|
||||
</el-input>
|
||||
</form-col>
|
||||
<form-col :span="span" label="单价">
|
||||
{{row.pricePrice | dv}} 元
|
||||
{{form.pricePrice | dv}} 元
|
||||
</form-col>
|
||||
<form-col :span="span" label="总价">
|
||||
{{ calcMulDecimal(row.pricePrice, row.num) | dv }} 元
|
||||
{{ calcMulDecimal(form.pricePrice, form.num) | dv }} 元
|
||||
</form-col>
|
||||
</el-row>
|
||||
|
||||
<div class="edit-title">员工产量</div>
|
||||
<report-product-user-list-edit v-model="row.userProdList" :price="row.pricePrice"/>
|
||||
<report-product-user-list-edit
|
||||
v-model="form.userProdList"
|
||||
:price="form.pricePrice"
|
||||
:price-unit="form.priceUnit"
|
||||
:rules="rules.userProdList"
|
||||
/>
|
||||
|
||||
<div class="edit-title">关联订单</div>
|
||||
<report-product-order-list-edit v-model="row.orderProdList"/>
|
||||
<report-product-order-list-edit
|
||||
v-model="form.orderProdList"
|
||||
:quantity="form.priceQuantity"
|
||||
:price-unit="form.priceUnit"
|
||||
:rules="rules.orderProdList"
|
||||
/>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -53,9 +65,12 @@ import ReportProductUserListEdit from "@/views/yh/report/edit/components/ReportP
|
|||
import FormCol from "@/components/FormCol/index.vue";
|
||||
import PriceInput from "@/components/Business/Price/PriceInput.vue";
|
||||
import {calcMulDecimal} from "@/utils/money";
|
||||
import {deepClone, isEmpty} from "@/utils";
|
||||
import {$reportCheck} from "@/views/yh/report/mixins";
|
||||
|
||||
export default {
|
||||
name: "ReportProductRowEdit",
|
||||
mixins: [$reportCheck],
|
||||
dicts: ['price_type'],
|
||||
components: {PriceInput, FormCol, ReportProductUserListEdit, ReportProductOrderListEdit},
|
||||
props: {
|
||||
|
@ -83,6 +98,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
span: 12,
|
||||
form: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -96,8 +112,11 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen() {
|
||||
this.form = deepClone(this.row);
|
||||
},
|
||||
beforeClose(done) {
|
||||
this.$confirm('确认关闭?', '提示', {
|
||||
this.$confirm('确认取消编辑当前工序?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
|
@ -109,23 +128,48 @@ export default {
|
|||
onSubmit() {
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
this.showMore = false;
|
||||
// 校验产量是否一致
|
||||
let error = this.checkNum(this.form);
|
||||
if (!isEmpty(error)) {
|
||||
this.$message.warning(error);
|
||||
return;
|
||||
}
|
||||
|
||||
this.$confirm('确认保存当前工序?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$emit('submit', this.form);
|
||||
this.showMore = false;
|
||||
})
|
||||
} else {
|
||||
this.$message.warning("表单校验未通过,请检查填写的数据")
|
||||
}
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.$confirm('确认取消编辑当前工序?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.showMore = false;
|
||||
})
|
||||
},
|
||||
// 工序修改后操作
|
||||
onChangePrice(price) {
|
||||
this.row.priceId = price.priceId;
|
||||
this.row.priceCategory = price.category;
|
||||
this.row.priceSize = price.size;
|
||||
this.row.priceName = price.name;
|
||||
this.row.priceSubName = price.subName;
|
||||
this.row.pricePattern = price.pattern;
|
||||
this.row.priceSpec = price.spec;
|
||||
this.row.pricePrice = price.price;
|
||||
this.row.priceUnit = price.unit;
|
||||
this.row.priceClassify = price.classify;
|
||||
this.row.priceQuantity = price.quantity;
|
||||
this.form.priceId = price.priceId;
|
||||
this.form.priceCategory = price.category;
|
||||
this.form.priceSize = price.size;
|
||||
this.form.priceName = price.name;
|
||||
this.form.priceSubName = price.subName;
|
||||
this.form.pricePattern = price.pattern;
|
||||
this.form.priceSpec = price.spec;
|
||||
this.form.pricePrice = price.price;
|
||||
this.form.priceUnit = price.unit;
|
||||
this.form.priceClassify = price.classify;
|
||||
this.form.priceQuantity = price.quantity;
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,18 +1,19 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-table :data="value" style="margin-left: 16px; width: calc(100% - 16px)" size="mini">
|
||||
<el-table-column label="序号" align="center" type="index" width="80"/>
|
||||
<el-table-column label="员工" align="center">
|
||||
<template slot-scope="d">
|
||||
<form-col table label-width="0">
|
||||
<form-col table label-width="0" :prop="`userProdList[${d.$index}].userId`" :rules="rules.userId">
|
||||
<user-input v-model="d.row.userId" open-type="dialog"/>
|
||||
</form-col>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="员工产量" align="center">
|
||||
<el-table-column label="产量" align="center">
|
||||
<template slot-scope="d">
|
||||
<form-col table label-width="0">
|
||||
<el-input v-model="d.row.num" type="number" placeholder="请输入员工产量"/>
|
||||
<form-col table label-width="0" :prop="`userProdList[${d.$index}].num`" :rules="rules.num">
|
||||
<el-input v-model="d.row.num" type="number" placeholder="请输入员工产量">
|
||||
<template #suffix v-if="priceUnit != null">{{priceUnit}}</template>
|
||||
</el-input>
|
||||
</form-col>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -76,6 +77,15 @@ export default {
|
|||
price: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
// 工序单位
|
||||
priceUnit: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
rules: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
|
|
@ -53,9 +53,11 @@ import {mapGetters} from "vuex";
|
|||
import Decimal from "decimal.js";
|
||||
import ReportProductEdit from "@/views/yh/report/edit/components/ReportProductEdit.vue";
|
||||
import {parseTime} from "@/utils/ruoyi";
|
||||
import {$reportCheck} from "@/views/yh/report/mixins";
|
||||
|
||||
export default {
|
||||
name: "ReportEdit",
|
||||
mixins: [$reportCheck],
|
||||
dicts: ['income_mode'],
|
||||
components: {ReportProductEdit, EditHeader, DeptTreeSelect, PriceInput, FormCol},
|
||||
data() {
|
||||
|
@ -99,6 +101,14 @@ export default {
|
|||
num: [
|
||||
{ required: true, message: "产量不能为空", trigger: "change" }
|
||||
]
|
||||
},
|
||||
orderProdList: {
|
||||
orderId: [
|
||||
{ required: true, message: "订单不允许为空", trigger: "change" }
|
||||
],
|
||||
num: [
|
||||
{ required: true, message: "产量不能为空", trigger: "change" }
|
||||
]
|
||||
}
|
||||
},
|
||||
headerCellStyle: {
|
||||
|
@ -143,14 +153,33 @@ export default {
|
|||
this.form.totalAmount = this.totalPrice;
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
// 校验产量是否一致
|
||||
for (let i = 0; i < this.form.productList.length; i++) {
|
||||
let error = this.checkNum(this.form.productList[i]);
|
||||
if (!isEmpty(error)) {
|
||||
return this.$message.warning(`第${i + 1}行工序产量校验未通过:${error}`);
|
||||
}
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
if (this.form.reportId != null) {
|
||||
updateReport(this.form).then(response => {
|
||||
updateReport(this.form).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
});
|
||||
this.$tab.closeBack();
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
})
|
||||
} else {
|
||||
addReport(this.form).then(response => {
|
||||
addReport(this.form).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
});
|
||||
this.$tab.closeBack();
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$message.warning("表单校验未通过,请检查")
|
||||
|
|
29
src/views/yh/report/mixins.js
Normal file
29
src/views/yh/report/mixins.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
import {notNullDecimal} from "@/utils";
|
||||
import Decimal from "decimal.js";
|
||||
|
||||
export const $reportCheck = {
|
||||
methods: {
|
||||
/**
|
||||
* 校验数量是否一致
|
||||
*/
|
||||
checkNum(row) {
|
||||
let num = notNullDecimal(row.num); // 良品数
|
||||
let userNum = new Decimal(0); // 用户良品数
|
||||
row.userProdList.forEach(item => {
|
||||
userNum = userNum.add(notNullDecimal(item.num));
|
||||
})
|
||||
console.log(userNum.toNumber(), num.toNumber())
|
||||
if (userNum.toNumber() > num.toNumber()) {
|
||||
return "员工总产量不允许超过工序总产量,请检查"
|
||||
}
|
||||
|
||||
let orderNum = new Decimal(0); // 订单良品数
|
||||
row.orderProdList.forEach(item => {
|
||||
orderNum = orderNum.add(notNullDecimal(item.num));
|
||||
})
|
||||
if (orderNum.toNumber() > num.toNumber()) {
|
||||
return "订单总产量不允许超过工序总产量,请检查"
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,19 +1,28 @@
|
|||
<template>
|
||||
<el-descriptions border :column="5">
|
||||
<div>
|
||||
<template v-for="(item, index) of data">
|
||||
<el-descriptions-item :key="item.id" label="订单">{{item.orderErpBillNo | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item :key="item.id" label="产量">{{item.num | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item :key="item.id" label="未入库">{{item.num | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item :key="item.id" label="审核中">{{item.num | dv}}</el-descriptions-item>
|
||||
<el-descriptions border :column="4" >
|
||||
<el-descriptions-item :key="item.id" label="订单" :span="2">{{item.orderErpBillNo | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item :key="item.id" label="本次提交产量">{{item.num | dv}} {{priceUnit}}</el-descriptions-item>
|
||||
<el-descriptions-item :key="item.id" label="订单需求数量">{{item.orderErpBaseUnitQty | dv}} {{item.baseUnitName}}</el-descriptions-item>
|
||||
<el-descriptions-item :key="item.id" label="订单未入库数量">{{item.orderErpBaseNoStockInQty | dv}} {{item.baseUnitName}}</el-descriptions-item>
|
||||
<el-descriptions-item :key="item.id" label="审核中产量">{{item.verifyingBaseNum | dv}} {{item.baseUnitName}}</el-descriptions-item>
|
||||
<el-descriptions-item :key="item.id" label="已审核产量">{{item.verifiedBaseNum | dv}} {{item.baseUnitName}}</el-descriptions-item>
|
||||
<el-descriptions-item :key="item.id" label="进度">
|
||||
<el-progress text-inside :stroke-width="16" :percentage="20" :color="customColors" text-color="#fff" style="width: 100px"/>
|
||||
<el-progress text-inside :stroke-width="16" :percentage="percentage(item)" :color="customColors" text-color="#fff" style="width: 80px"/>
|
||||
</el-descriptions-item>
|
||||
</template>
|
||||
</el-descriptions>
|
||||
<br/>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {notNullDecimal} from "@/utils";
|
||||
import {calcMulDecimal} from "@/utils/money";
|
||||
import Decimal from "decimal.js";
|
||||
|
||||
export default {
|
||||
name: "ReportOrderProdDescriptions",
|
||||
props: {
|
||||
|
@ -22,6 +31,14 @@ export default {
|
|||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
priceUnit: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
priceQuantity: {
|
||||
type: Number,
|
||||
default: null,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -35,6 +52,22 @@ export default {
|
|||
}
|
||||
},
|
||||
computed: {
|
||||
// 百分比
|
||||
percentage() {
|
||||
return (row) => {
|
||||
let verifiedBaseNum = notNullDecimal(row.verifiedBaseNum); // 已经审核的量
|
||||
let num = notNullDecimal(row.num).mul(notNullDecimal(this.priceQuantity)); // 提交数量 * 倍数
|
||||
let orderErpBaseUnitQty = notNullDecimal(row.orderErpBaseUnitQty); // 基础总需求量
|
||||
console.log("percentage", verifiedBaseNum.toNumber(), num.toNumber(), orderErpBaseUnitQty.toNumber());
|
||||
|
||||
// 结果 = (已审核量 + 本次提交量 * 倍数) / 基础总需求量 * 100
|
||||
let result = new Decimal(
|
||||
verifiedBaseNum.add(num).mul(new Decimal(100)).div(orderErpBaseUnitQty).toFixed(2)
|
||||
).toNumber();
|
||||
console.log('result', result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<el-descriptions border>
|
||||
<template v-for="(item, index) of data">
|
||||
<el-descriptions-item :key="item.id" label="员工">{{item.userName | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item :key="item.id" label="产量">{{item.num | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item :key="item.id" label="产量">{{item.num | dv}} {{priceUnit}}</el-descriptions-item>
|
||||
<el-descriptions-item :key="item.id" label="工资">{{totalPrice(item) | dv}} 元</el-descriptions-item>
|
||||
</template>
|
||||
</el-descriptions>
|
||||
|
@ -19,6 +19,10 @@ export default {
|
|||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
priceUnit: {
|
||||
type: String,
|
||||
default: null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
|
@ -69,24 +69,25 @@
|
|||
@expand-change="onExpandChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" v-if="listConfig.showSelection"/>
|
||||
<el-table-column type="expand" width="55" align="left">
|
||||
<el-table-column type="expand" width="55" align="left" fixed="left">
|
||||
<template slot-scope="d">
|
||||
<div class="expand-container">
|
||||
<el-descriptions border>
|
||||
<el-descriptions-item label="类别">{{d.row.priceCategory | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="大小">{{d.row.priceSize | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="图案">{{d.row.pricePattern | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="规格">{{d.row.priceSpec | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="分类">{{d.row.priceClassify | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="倍数">{{d.row.priceQuantity | dv}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<template v-if="!isEmpty(d.row.userProdList)">
|
||||
<div class="edit-title">员工产量</div>
|
||||
<!-- <report-user-prod-->
|
||||
<!-- v-has-permi="['yh:reportUserProd:list']"-->
|
||||
<!-- :query="{prodId: d.row.id, pageSize: 99999}"-->
|
||||
<!-- :hide-columns="['reportDate', 'reportStatus', 'priceName', 'pricePrice']"-->
|
||||
<!-- :custom-config="expandCustomConfig"-->
|
||||
<!-- />-->
|
||||
<report-user-prod-descriptions :data="d.row.userProdList"/>
|
||||
<report-user-prod-descriptions :data="d.row.userProdList" :price-unit="d.row.priceUnit"/>
|
||||
</template>
|
||||
<template v-if="!isEmpty(d.row.orderProdList)">
|
||||
<div class="edit-title">订单产量</div>
|
||||
<report-order-prod-descriptions :data="d.row.orderProdList"/>
|
||||
<report-order-prod-descriptions :data="d.row.orderProdList" :price-unit="d.row.priceUnit" :price-quantity="d.row.priceQuantity"/>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -219,7 +220,7 @@ import {$listConfig, $showColumns, $showSearch} from '@/utils/mixins';
|
|||
import FormCol from "@/components/FormCol/index.vue";
|
||||
import SearchFormItem from "@/components/SearchFormItem/index.vue";
|
||||
import ReportUserProd from "@/views/yh/reportUserProd/index.vue";
|
||||
import {calcMulDecimal} from "../../../utils/money";
|
||||
import {calcMulDecimal} from "@/utils/money";
|
||||
import ReportUserProdDescriptions from "@/views/yh/reportProd/components/ReportUserProdDescriptions.vue";
|
||||
import {isEmpty} from "@/utils";
|
||||
import ReportOrderProdDescriptions from "@/views/yh/reportProd/components/ReportOrderProdDescriptions.vue";
|
||||
|
@ -273,17 +274,17 @@ export default {
|
|||
{key: 'priceType', visible: true, label: '类型', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'priceName', visible: true, label: '工序', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'priceSubName', visible: true, label: '子工序', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'priceCategory', visible: true, label: '类别', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'priceSize', visible: true, label: '大小', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'pricePattern', visible: true, label: '图案', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'priceSpec', visible: true, label: '规格', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'priceClassify', visible: true, label: '分类', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'priceQuantity', visible: true, label: '倍数', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'num', visible: true, label: '良品', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'defectNum', visible: true, label: '不良品', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'pricePrice', visible: true, label: '单价', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'priceUnit', visible: true, label: '单位', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'pricePrice', visible: true, label: '单价', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'totalAmount', visible: true, label: '总价', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'priceCategory', visible: false, label: '类别', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'priceSize', visible: false, label: '大小', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'pricePattern', visible: false, label: '图案', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'priceSpec', visible: false, label: '规格', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'priceClassify', visible: false, label: '分类', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'priceQuantity', visible: false, label: '倍数', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
],
|
||||
// 排序方式
|
||||
orderSorts: ['ascending', 'descending', null],
|
||||
|
|
Loading…
Reference in New Issue
Block a user