init project
This commit is contained in:
82
mes/qd/src/views/wms/pcs/orderproc/importOrder.vue
Normal file
82
mes/qd/src/views/wms/pcs/orderproc/importOrder.vue
Normal file
@@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="采购订单接口导入"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
:show-close="true"
|
||||
width="500px"
|
||||
v-loading.fullscreen.lock="fullscreenLoading"
|
||||
@close="close"
|
||||
>
|
||||
<div class="head-container">
|
||||
<div>
|
||||
<!-- 搜索 -->
|
||||
<el-date-picker
|
||||
v-model="form.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
/>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="queryStruct">确认</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||
import crudOrderproc from "@/api/wms/pcs/orderproc";
|
||||
|
||||
export default {
|
||||
name: 'importOrder',
|
||||
components: { rrOperation, pagination, DateRangePicker },
|
||||
cruds() {
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
fullscreenLoading: false,
|
||||
dialogVisible: false,
|
||||
form :{}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
this.form = {}
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', this.rows)
|
||||
},
|
||||
queryStruct() {
|
||||
debugger
|
||||
this.fullscreenLoading = true
|
||||
crudOrderproc.importData(this.form).then(res => {
|
||||
this.fullscreenLoading = false
|
||||
this.crud.notify('导入成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
265
mes/qd/src/views/wms/pcs/orderproc/index.vue
Normal file
265
mes/qd/src/views/wms/pcs/orderproc/index.vue
Normal file
@@ -0,0 +1,265 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="订单编号">
|
||||
<el-input
|
||||
v-model="query.VBILLCODE"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="订单编号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态">
|
||||
<el-select
|
||||
v-model="query.proc_status"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in procStatusList"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单日期">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="物料名称、编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="供应商">
|
||||
<label slot="label">供 应 商:</label>
|
||||
<el-input
|
||||
v-model="query.supp_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="供应商名称、编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料类别">
|
||||
<treeselect
|
||||
v-model="query.material_type_id"
|
||||
:load-options="loadClass"
|
||||
:options="classes"
|
||||
style="width: 230px;"
|
||||
placeholder="请选择物料类别"
|
||||
size="mini"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-arrow-down"
|
||||
size="mini"
|
||||
@click="Import"
|
||||
>
|
||||
导入
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
@click="finish"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
>
|
||||
强制完成
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column fixed type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="id" label="id" />
|
||||
<el-table-column prop="supp_name" label="供应商" min-width="220px" show-overflow-tooltip/>
|
||||
<el-table-column prop="create_date" label="订单日期" width="150px" />
|
||||
<el-table-column prop="vbillcode" label="订单编号" min-width="100px" show-overflow-tooltip/>
|
||||
<el-table-column prop="crowno" label="明细行号" />
|
||||
<el-table-column prop="material_code" label="物料编码" width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="material_name" label="物料名称" min-width="200px" show-overflow-tooltip/>
|
||||
<el-table-column prop="qty" label="采购重量" width="120px" :formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="receive_qty" label="到货重量" width="100px" :formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="instor_qty" label="入库重量" width="100px" :formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="surplus_qty" label="剩余重量" width="100px" :formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="unit_name" label="单位" />
|
||||
<el-table-column prop="proc_status" label="处理状态" :formatter="formaterStatus" />
|
||||
<el-table-column show-overflow-tooltip prop="contract_no" label="合同编码" />
|
||||
<el-table-column show-overflow-tooltip prop="price" label="无税单价" :formatter="crud.formatNum3" />
|
||||
<el-table-column show-overflow-tooltip prop="price_tax" label="含税单价" :formatter="crud.formatNum3" />
|
||||
<el-table-column prop="input_optname" label="导入人" />
|
||||
<el-table-column prop="update_optname" label="更新人" />
|
||||
<el-table-column prop="input_time" label="导入时间" width="150px" />
|
||||
<el-table-column prop="update_time" label="更新时间" width="150px" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<importOrder :dialog-show.sync="viewShow" @tableChanged="querytable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudOrderproc from '@/api/wms/pcs/orderproc'
|
||||
import CRUD, { presenter, header, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import importOrder from '@/views/wms/pcs/orderproc/importOrder'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
||||
import crudMaterialbase from "@/api/wms/basedata/master/materialbase";
|
||||
|
||||
export default {
|
||||
name: 'PcsIfPurchaseorderproc',
|
||||
components: { importOrder, pagination, crudOperation, rrOperation, udOperation, DateRangePicker, Treeselect },
|
||||
mixins: [presenter(), header(),crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '采购订单导入',
|
||||
url: 'api/purchaseorderproc',
|
||||
idField: 'id',
|
||||
sort: 'id,desc',
|
||||
crudMethod: { ...crudOrderproc },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
classes: [],
|
||||
viewShow : false,
|
||||
class_idStr: null,
|
||||
procStatusList: [],
|
||||
permission: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
const param = {
|
||||
'materOpt_code': '00'
|
||||
}
|
||||
crudMaterialbase.getMaterOptType(param).then(res => {
|
||||
this.class_idStr = res.class_idStr
|
||||
this.crud.query.class_idStr = res.class_idStr
|
||||
this.crud.toQuery()
|
||||
this.queryClassId()
|
||||
})
|
||||
crudOrderproc.getProcStatus().then(res => {
|
||||
this.procStatusList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
queryClassId() {
|
||||
const param = {
|
||||
'class_idStr': this.class_idStr
|
||||
}
|
||||
crudClassstandard.queryClassById(param).then(res => {
|
||||
this.classes = res.content.map(obj => {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
})
|
||||
},
|
||||
// 获取弹窗内部门数据
|
||||
loadClass({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
|
||||
parentNode.children = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
setTimeout(() => {
|
||||
callback()
|
||||
}, 100)
|
||||
})
|
||||
}
|
||||
},
|
||||
querytable() {
|
||||
this.crud.toQuery()
|
||||
} ,
|
||||
Import() {
|
||||
this.viewShow = true
|
||||
},
|
||||
finish() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
if (!_selectData || _selectData.length !== 1) {
|
||||
this.crud.notify('请选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
const row = _selectData[0]
|
||||
if (row.proc_status === '09') {
|
||||
this.crud.notify('此订单已完成', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
return false
|
||||
}
|
||||
crudOrderproc.finish(_selectData[0]).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
formaterStatus(row, column) {
|
||||
for (const item of this.procStatusList) {
|
||||
if (item.code === row.proc_status) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
398
mes/qd/src/views/wms/pcs/productplanproc/index.vue
Normal file
398
mes/qd/src/views/wms/pcs/productplanproc/index.vue
Normal file
@@ -0,0 +1,398 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="年月">
|
||||
<label slot="label">年 月:</label>
|
||||
<el-date-picker
|
||||
v-model="query.plan_month"
|
||||
type="month"
|
||||
style="width: 250px"
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
value-format="yyyyMM"
|
||||
placeholder="选择年月"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="部门">
|
||||
<label slot="label">部 门:</label>
|
||||
<el-select
|
||||
v-model="query.plan_org_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 250px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deptList"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="物料编码">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入物料编码"
|
||||
style="width: 250px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="生产方式">
|
||||
<el-select
|
||||
v-model="query.product_type_name"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 250px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_mode"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<rrOperation />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="open"
|
||||
>
|
||||
导入Excel
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
|
||||
<!-- 文件上传弹出框-->
|
||||
<el-dialog
|
||||
title="提示"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%"
|
||||
:before-close="handleClose"
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
:before-upload="beforeUpload"
|
||||
:auto-upload="false"
|
||||
:headers="headers"
|
||||
:file-list="fileList"
|
||||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
:on-exceed="handleExceed"
|
||||
:action="fileUploadApi + '?name=1111222'"
|
||||
>
|
||||
<div class="eladmin-upload"><i class="el-icon-upload" /> 添加文件</div>
|
||||
<div slot="tip" class="el-upload__tip">可上传任意格式文件,且不超过100M</div>
|
||||
</el-upload>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="upload">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="600px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="150px">
|
||||
<el-form-item label="计划编号" prop="plan_code">
|
||||
<el-input v-model="form.plan_code" style="width: 300px;" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划月份" prop="plan_month">
|
||||
<el-input v-model="form.plan_month" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申报单位编码" prop="plan_org_code">
|
||||
<el-input v-model="form.plan_org_code" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申报单位名称" prop="plan_org_name">
|
||||
<el-input v-model="form.plan_org_name" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码" prop="material_code">
|
||||
<el-input v-model="form.material_code" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生产方式" prop="product_type_name">
|
||||
<el-select
|
||||
v-model="form.product_type_name"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 300px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_mode"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="重量单位" prop="weight_unit_name">
|
||||
<el-input v-model="form.weight_unit_name" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="重量" prop="product_weight">
|
||||
<el-input-number
|
||||
size="mini"
|
||||
v-model="form.product_weight"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
:min="0"
|
||||
style="width: 300px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="交货日期" prop="plan_finish_date">
|
||||
<el-input v-model="form.plan_finish_date" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" show-summary :summary-method="getSum" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<!-- <el-table-column type="selection" width="55" />-->
|
||||
<el-table-column v-permission="['admin','productplanproc:edit','productplanproc:del']" fixed="right" label="操作" width="120px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="false" prop="plan_id" label="计划标识" />
|
||||
<el-table-column v-if="false" prop="plan_code" label="计划编号" />
|
||||
<el-table-column prop="plan_org_name" label="申报单位名称" />
|
||||
<el-table-column prop="plan_month" label="年月度" />
|
||||
<el-table-column v-if="false" prop="material_id" label="物料标识" />
|
||||
<el-table-column prop="material_code" label="物料编码" min-width="120" show-overflow-tooltip/>
|
||||
<el-table-column prop="product_type_name" label="生产方式" />
|
||||
<el-table-column prop="product_weight" label="重量(Kg)" :formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="plan_finish_date" label="交货日期" />
|
||||
<el-table-column prop="plan_code" label="需求编码" />
|
||||
<el-table-column prop="input_optname" label="导入人" />
|
||||
<el-table-column prop="input_time" label="导入时间" width="150px" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudProductplanproc from '@/api/wms/pcs/productplanproc'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
const defaultForm = {
|
||||
plan_id: null,
|
||||
plan_code: null,
|
||||
plan_month: null,
|
||||
plan_org_code: null,
|
||||
plan_org_name: null,
|
||||
material_id: null,
|
||||
material_code: null,
|
||||
material_name: null,
|
||||
material_spec: null,
|
||||
product_type_name: null,
|
||||
weight_unit_id: null,
|
||||
weight_unit_name: null,
|
||||
product_weight: null,
|
||||
fact_weight: null,
|
||||
plan_finish_date: null,
|
||||
input_optid: null,
|
||||
input_optname: null,
|
||||
input_time: null,
|
||||
is_proc: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null
|
||||
}
|
||||
export default {
|
||||
name: 'Productplanproc',
|
||||
dicts: ['product_mode'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '月需求计划',
|
||||
url: 'api/productplanproc',
|
||||
idField: 'plan_id',
|
||||
sort: 'plan_id,desc',
|
||||
crudMethod: { ...crudProductplanproc },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
headers: { 'Authorization': getToken() },
|
||||
dialogVisible: false,
|
||||
deptList: [],
|
||||
fileList: [],
|
||||
rules: {
|
||||
plan_code: [
|
||||
{ required: true, message: '计划编号不能为空', trigger: 'blur' }
|
||||
],
|
||||
plan_month: [
|
||||
{ required: true, message: '计划月份不能为空', trigger: 'blur' }
|
||||
],
|
||||
plan_org_code: [
|
||||
{ required: true, message: '申报单位编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
plan_org_name: [
|
||||
{ required: true, message: '申报单位名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
material_code: [
|
||||
{ required: true, message: '物料编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
product_weight: [
|
||||
{ required: true, message: '重量不能为空', trigger: 'blur' }
|
||||
],
|
||||
plan_finish_date: [
|
||||
{ required: true, message: '交货日期不能为空', trigger: 'blur' }
|
||||
],
|
||||
product_type_name: [
|
||||
{ required: true, message: '生产方式不能为空', trigger: 'blur' }
|
||||
],
|
||||
weight_unit_name: [
|
||||
{ required: true, message: '重量计量单位不能为空', trigger: 'blur' }
|
||||
]
|
||||
}}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'baseApi',
|
||||
'fileUploadApi'
|
||||
])
|
||||
},
|
||||
created() {
|
||||
crudProductplanproc.getDept().then(res => {
|
||||
this.deptList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
beforeUpload(file) {
|
||||
let isLt2M = true
|
||||
isLt2M = file.size / 1024 / 1024 < 100
|
||||
if (!isLt2M) {
|
||||
this.loading = false
|
||||
this.$message.error('上传文件大小不能超过 100MB!')
|
||||
}
|
||||
this.form.name = file.name
|
||||
return isLt2M
|
||||
},
|
||||
handleSuccess(response, file, fileList) {
|
||||
const id = response.id
|
||||
crudProductplanproc.importExcel(id).then(res => {
|
||||
this.crud.notify('上传成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
// 监听上传失败
|
||||
handleError(e, file, fileList) {
|
||||
const msg = JSON.parse(e.message)
|
||||
this.$notify({
|
||||
title: msg.message,
|
||||
type: 'error',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
open() {
|
||||
const a = this.fileList
|
||||
this.fileList = a.splice(0, 0)
|
||||
this.dialogVisible = true
|
||||
},
|
||||
upload() {
|
||||
this.$refs.upload.submit()
|
||||
this.dialogVisible = false
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.$message.warning('当前限制只能选择 1 个文件')
|
||||
},
|
||||
getSum(param) {
|
||||
// 将某一列进行合计 如果多个列就用if 和 || 进行判断
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
let values = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 1) {
|
||||
sums[index] = '合计'
|
||||
return
|
||||
}
|
||||
values = data.map(item => Number(item['product_weight']))
|
||||
if (column.property === 'product_weight') {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] += 'kg'
|
||||
} else {
|
||||
sums[index] = '--'
|
||||
}
|
||||
})
|
||||
this.$store.commit('product_weight', sums[5])
|
||||
return sums
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
204
mes/qd/src/views/wms/pcs/productplansum/SumShowDialog.vue
Normal file
204
mes/qd/src/views/wms/pcs/productplansum/SumShowDialog.vue
Normal file
@@ -0,0 +1,204 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="汇总查询"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
fullscreen
|
||||
destroy-on-close
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-date-picker
|
||||
v-model="form.plan_month"
|
||||
type="month"
|
||||
style="width: 180px"
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
value-format="yyyy-MM"
|
||||
/>
|
||||
|
||||
<el-select
|
||||
v-model="form.plan_org_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="默认为全部部门"
|
||||
class="filter-item"
|
||||
style="width: 180px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deptList"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
<el-input
|
||||
v-model="form.material_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入物料编码"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="sumQuery"
|
||||
>
|
||||
汇总查询
|
||||
</el-button>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="aa"
|
||||
>
|
||||
导出
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tableData"
|
||||
style="width: 100%;"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column prop="plan_org_name" label="申报单位名称" />
|
||||
<el-table-column prop="plan_month" label="计划月份" />
|
||||
<el-table-column prop="material_code" label="物料编码" />
|
||||
<el-table-column prop="material_name" label="物料名称" />
|
||||
<el-table-column prop="num" label="需求数量" :formatter="crud.formatNum3" />
|
||||
<el-table-column prop="ivt_qty" label="当前库存" :formatter="crud.formatNum3" />
|
||||
<el-table-column prop="unit_name" label="计量单位" />
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudProductplansum from '@/api/wms/pcs/productplansum'
|
||||
import CRUD, { crud, form, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import { downloadFile } from '@/utils/index'
|
||||
import { download } from '@/api/data'
|
||||
import crudStorattr from "@/api/wms/basedata/st/storattr";
|
||||
|
||||
|
||||
export default {
|
||||
name: 'SunShowDialog',
|
||||
components: { rrOperation, crudOperation, udOperation },
|
||||
mixins: [presenter(),crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '月需求计划汇总',
|
||||
url: 'api/productplansum',
|
||||
crudMethod: { ...crudProductplansum },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: false
|
||||
}
|
||||
})
|
||||
},
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
form:{
|
||||
plan_org_name: null,
|
||||
material_code: null,
|
||||
plan_month: new Date().format('yyyy-MM')
|
||||
},
|
||||
tableData: [],
|
||||
dialogVisible: false,
|
||||
deptList: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
crudProductplansum.getDept().then(res => {
|
||||
this.deptList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
open() {
|
||||
this.form.plan_month = new Date().format('yyyy-MM')
|
||||
},
|
||||
aa() {
|
||||
if (this.form.plan_month === '') {
|
||||
this.crud.notify('请选择导出年月!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
if (this.tableData.length === 0) {
|
||||
this.crud.notify('导出数据不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
download('/api/productplansum/download', this.form).then(result => {
|
||||
downloadFile(result, '月需求计划汇总('+this.form.plan_month+")", 'xlsx')
|
||||
crud.downloadLoading = false
|
||||
}).catch(() => {
|
||||
crud.downloadLoading = false
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.tableData = []
|
||||
this.form.plan_month = ''
|
||||
this.form.plan_org_code = ''
|
||||
this.form.material_code = ''
|
||||
},
|
||||
sumQuery() {
|
||||
const data = this.form
|
||||
crudProductplansum.sumQuery(data).then(res => {
|
||||
this.tableData = res
|
||||
this.crud.notify('汇总完成', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
446
mes/qd/src/views/wms/pcs/productplansum/index.vue
Normal file
446
mes/qd/src/views/wms/pcs/productplansum/index.vue
Normal file
@@ -0,0 +1,446 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="年月">
|
||||
<label slot="label">年 月:</label>
|
||||
<el-date-picker
|
||||
v-model="query.plan_month"
|
||||
type="month"
|
||||
style="width: 250px"
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
value-format="yyyyMM"
|
||||
placeholder="选择年月"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="部门">
|
||||
<label slot="label">部 门:</label>
|
||||
<el-select
|
||||
v-model="query.plan_org_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 250px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deptList"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="物料编码">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入物料编码"
|
||||
style="width: 250px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="生产方式">
|
||||
<el-select
|
||||
v-model="query.product_type_name"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 250px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_mode"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<rrOperation />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="open"
|
||||
>
|
||||
导入Excel
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="sumShow"
|
||||
>
|
||||
汇总
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
|
||||
<!-- 文件上传弹出框-->
|
||||
<el-dialog
|
||||
title="提示"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%"
|
||||
:before-close="handleClose"
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
:before-upload="beforeUpload"
|
||||
:on-exceed="handleExceed"
|
||||
:auto-upload="false"
|
||||
:file-list="fileList"
|
||||
:headers="headers"
|
||||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
:action="fileUploadApi + '?name=1111222'"
|
||||
>
|
||||
<div class="eladmin-upload"><i class="el-icon-upload" /> 添加文件</div>
|
||||
<div slot="tip" class="el-upload__tip">可上传任意格式文件,且不超过100M</div>
|
||||
</el-upload>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="upload">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="150px">
|
||||
<el-form-item label="计划编号" prop="plan_code">
|
||||
<el-input v-model="form.plan_code" style="width: 300px;" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划月份" prop="plan_month">
|
||||
<el-input v-model="form.plan_month" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申报单位编码" prop="plan_org_code">
|
||||
<el-input v-model="form.plan_org_code" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申报单位名称" prop="plan_org_name">
|
||||
<el-input v-model="form.plan_org_name" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码" prop="material_code">
|
||||
<el-input v-model="form.material_code" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生产方式" prop="product_type_name">
|
||||
<el-select
|
||||
v-model="form.product_type_name"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 300px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_mode"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="重量单位" prop="weight_unit_name">
|
||||
<el-input v-model="form.weight_unit_name" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="重量" prop="product_weight">
|
||||
<el-input-number
|
||||
size="mini"
|
||||
v-model="form.product_weight"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
:min="0"
|
||||
style="width: 300px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="交货日期" prop="plan_finish_date">
|
||||
<el-input v-model="form.plan_finish_date" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading"
|
||||
:highlight-current-row="true"
|
||||
show-summary :summary-method="getSum"
|
||||
:data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column v-permission="['admin','productplanproc:edit','productplanproc:del']" fixed="right" label="操作" width="120px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="false" prop="plan_id" label="计划标识" />
|
||||
<el-table-column v-if="false" prop="plan_code" label="计划编号" />
|
||||
<el-table-column prop="plan_org_name" label="申报单位名称" width="120px" />
|
||||
<el-table-column prop="plan_month" label="年月度" />
|
||||
<el-table-column v-if="false" prop="material_id" label="物料标识" />
|
||||
<el-table-column prop="material_code" label="物料编码" width="130px" />
|
||||
<el-table-column prop="product_type_name" label="生产方式" width="120px" />
|
||||
<el-table-column prop="product_weight" label="重量(Kg)" width="100px" :formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="plan_finish_date" label="交货日期" width="120px" />
|
||||
<el-table-column prop="plan_code" label="需求编码" />
|
||||
<el-table-column prop="is_proc" label="状态" :formatter="formatName" />
|
||||
<el-table-column prop="input_optname" label="导入人" />
|
||||
<el-table-column prop="input_time" label="导入时间" width="150px" />
|
||||
<el-table-column prop="update_optname" label="更新人" />
|
||||
<el-table-column prop="update_time" label="更新时间" width="150px" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<SumShowDialog :dialog-show.sync="sumShowDialog" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudProductplansum from '@/api/wms/pcs/productplansum'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { mapGetters } from 'vuex'
|
||||
import SumShowDialog from '@/views/wms/pcs/productplansum/SumShowDialog'
|
||||
|
||||
const defaultForm = {
|
||||
plan_id: null,
|
||||
plan_code: null,
|
||||
plan_month: null,
|
||||
plan_org_code: null,
|
||||
plan_org_name: null,
|
||||
material_id: null,
|
||||
material_code: null,
|
||||
material_name: null,
|
||||
material_spec: null,
|
||||
product_type_name: null,
|
||||
weight_unit_id: null,
|
||||
weight_unit_name: null,
|
||||
product_weight: null,
|
||||
fact_weight: null,
|
||||
plan_finish_date: null,
|
||||
input_optid: null,
|
||||
input_optname: null,
|
||||
input_time: null,
|
||||
is_proc: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null
|
||||
}
|
||||
export default {
|
||||
name: 'Productplanproc',
|
||||
dicts: ['product_mode'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, SumShowDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '月需求计划汇总',
|
||||
url: 'api/productplansum',
|
||||
idField: 'plan_id',
|
||||
sort: 'plan_id,desc',
|
||||
crudMethod: { ...crudProductplansum },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
headers: { 'Authorization': getToken() },
|
||||
dialogVisible: false,
|
||||
deptList: [],
|
||||
isProcList: [],
|
||||
fileList: [],
|
||||
openParam: {},
|
||||
sumShowDialog: false,
|
||||
rules: {
|
||||
plan_code: [
|
||||
{ required: true, message: '计划编号不能为空', trigger: 'blur' }
|
||||
],
|
||||
plan_month: [
|
||||
{ required: true, message: '计划月份不能为空', trigger: 'blur' }
|
||||
],
|
||||
plan_org_code: [
|
||||
{ required: true, message: '申报单位编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
plan_org_name: [
|
||||
{ required: true, message: '申报单位名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
material_code: [
|
||||
{ required: true, message: '物料编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
product_weight: [
|
||||
{ required: true, message: '重量不能为空', trigger: 'blur' }
|
||||
],
|
||||
plan_finish_date: [
|
||||
{ required: true, message: '交货日期不能为空', trigger: 'blur' }
|
||||
],
|
||||
product_type_name: [
|
||||
{ required: true, message: '生产方式不能为空', trigger: 'blur' }
|
||||
],
|
||||
weight_unit_name: [
|
||||
{ required: true, message: '重量计量单位不能为空', trigger: 'blur' }
|
||||
]
|
||||
}}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'baseApi',
|
||||
'fileUploadApi'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
sumShowDialog: {
|
||||
handler(newValue, oldValue) {
|
||||
this.sumShowDialog = newValue
|
||||
if (!newValue) {
|
||||
this.crud.toQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudProductplansum.getDept().then(res => {
|
||||
this.deptList = res
|
||||
})
|
||||
crudProductplansum.getIsProc().then(res => {
|
||||
this.isProcList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
open() {
|
||||
const a = this.fileList
|
||||
this.fileList = a.splice(0, 0)
|
||||
this.dialogVisible = true
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.$message.warning('当前限制只能选择 1 个文件')
|
||||
},
|
||||
beforeUpload(file) {
|
||||
let isLt2M = true
|
||||
isLt2M = file.size / 1024 / 1024 < 100
|
||||
if (!isLt2M) {
|
||||
this.loading = false
|
||||
this.$message.error('上传文件大小不能超过 100MB!')
|
||||
}
|
||||
this.form.name = file.name
|
||||
return isLt2M
|
||||
},
|
||||
handleSuccess(response, file, fileList) {
|
||||
const id = response.id
|
||||
crudProductplansum.importExcel(id).then(res => {
|
||||
this.crud.notify('上传成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
// 监听上传失败
|
||||
handleError(e, file, fileList) {
|
||||
const msg = JSON.parse(e.message)
|
||||
this.$notify({
|
||||
title: msg.message,
|
||||
type: 'error',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
upload() {
|
||||
this.$refs.upload.submit()
|
||||
this.dialogVisible = false
|
||||
},
|
||||
formatName(row, column) {
|
||||
for (const item of this.isProcList) {
|
||||
if (item.code === row.is_proc) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
},
|
||||
sumShow() {
|
||||
const data = this.crud.data
|
||||
this.openParam = {
|
||||
optType: 'sum',
|
||||
optRow: data
|
||||
}
|
||||
|
||||
this.sumShowDialog = true
|
||||
},
|
||||
getSum(param) {
|
||||
// 将某一列进行合计 如果多个列就用if 和 || 进行判断
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
let values = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 1) {
|
||||
sums[index] = '合计'
|
||||
return
|
||||
}
|
||||
values = data.map(item => Number(item['product_weight']))
|
||||
if (column.property === 'product_weight') {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] += 'kg'
|
||||
} else {
|
||||
sums[index] = '--'
|
||||
}
|
||||
})
|
||||
this.$store.commit('product_weight', sums[5])
|
||||
return sums
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
411
mes/qd/src/views/wms/pcs/receivemst/AddShowDialog.vue
Normal file
411
mes/qd/src/views/wms/pcs/receivemst/AddShowDialog.vue
Normal file
@@ -0,0 +1,411 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="crud.status.title"
|
||||
append-to-body
|
||||
fullscreen
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
|
||||
>
|
||||
<el-row v-show="crud.status.cu > 0" :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
:loading="crud.cu === 2"
|
||||
type="primary"
|
||||
@click="crud.submitCU"
|
||||
>保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form
|
||||
ref="form"
|
||||
:inline="true"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;"
|
||||
class="demo-form-inline"
|
||||
size="mini"
|
||||
label-width="auto"
|
||||
label-position="right"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="到货单号" prop="receive_code">
|
||||
<el-input
|
||||
v-model="form.receive_code"
|
||||
disabled
|
||||
placeholder="系统生成"
|
||||
size="mini"
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="到货日期" prop="receive_date">
|
||||
<el-date-picker
|
||||
v-model="form.receive_date"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
style="width: 210px"
|
||||
value-format="yyyy-MM-dd"
|
||||
:disabled="crud.status.view > 0"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型" prop="receive_type">
|
||||
<el-select
|
||||
v-model="form.receive_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择业务类型"
|
||||
class="filter-item"
|
||||
style="width: 210px;"
|
||||
:disabled="crud.status.view > 0"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_INV_TYPE_RC"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属仓库" prop="stor_id">
|
||||
<el-select
|
||||
v-model="form.stor_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择仓库"
|
||||
class="filter-item"
|
||||
style="width: 210px;"
|
||||
:disabled="crud.status.view > 0"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in this.storList"
|
||||
:key="item.stor_id"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单据状态" prop="status">
|
||||
<el-select
|
||||
v-model="form.status"
|
||||
:disabled="true"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="生成"
|
||||
class="filter-item"
|
||||
style="width: 210px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in this.statusList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="明细数" prop="dtl_num">
|
||||
<label slot="label">明 细 数:</label>
|
||||
<el-input v-model="form.dtl_num" :disabled="true" style="width: 210px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总重量" prop="total_qty">
|
||||
<label slot="label">总 重 量:</label>
|
||||
<el-input-number
|
||||
v-model="form.total_qty"
|
||||
size="mini"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
:min="0"
|
||||
disabled
|
||||
style="width: 210px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<div class="crud-opts2" style="margin-bottom: 5px;">
|
||||
<span class="role-span">通知单明细</span>
|
||||
<span v-if="crud.status.cu > 0" class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
:disabled="crud.status.view > 0"
|
||||
@click="insertEvent"
|
||||
>
|
||||
添加单据物料
|
||||
</el-button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="form.tableData"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column show-overflow-tooltip min-width="140" prop="supp_name" label="供应商" align="center" />
|
||||
<el-table-column prop="vbillcode" label="订单编号" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="material_code" label="物料编号" align="center" min-width="120" show-overflow-tooltip/>
|
||||
<el-table-column prop="material_name" label="物料名称" align="center" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="qty" label="采购重量" align="center" :formatter="crud.formatNum3" />
|
||||
<el-table-column prop="receive_qty" label="到货重量" align="center" :formatter="crud.formatNum3">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-model="scope.row.receive_qty"
|
||||
size="mini"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
:min="0"
|
||||
:disabled="scope.row.edit"
|
||||
/>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="pcsn" label="批次号" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="form.tableData[scope.$index].pcsn" size="mini" class="edit-input" :disabled="scope.row.edit" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="qty_unit_name" label="单位" align="center" />
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="160" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="delOne(scope.$index, form.tableData)" />
|
||||
<el-button v-show="!scope.row.edit" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
||||
<el-button v-show="scope.row.edit" type="success" class="filter-item" size="mini" icon="el-icon-check" @click="handleEdit(scope.$index, scope.row)">完成</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<DtlShowDialog :dialog-show.sync="dtlShowDialog" @tableChanged="tableChanged" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudReceivemst from '@/api/wms/pcs/receivemst'
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import DtlShowDialog from '@/views/wms/pcs/receivemst/DtlShowDialog'
|
||||
|
||||
const defaultForm = {
|
||||
receive_code: null,
|
||||
receive_date: new Date().format('yyyy-MM-dd'),
|
||||
receive_type: '81',
|
||||
stor_id: '1473161852946092032',
|
||||
remark: null,
|
||||
status: null,
|
||||
dtl_num: 0,
|
||||
total_qty: 0,
|
||||
print_qty: 1,
|
||||
tableData: []
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'AddShowDialog',
|
||||
components: { DtlShowDialog },
|
||||
mixins: [form(defaultForm), crud()],
|
||||
dicts: ['ST_INV_TYPE_RC'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
dtlShowDialog: false,
|
||||
statusList: [],
|
||||
storList: [],
|
||||
flagnow: false,
|
||||
rules: {
|
||||
receive_date: [
|
||||
{ required: true, message: '到货单日期不能为空', trigger: 'blur' }
|
||||
],
|
||||
receive_type: [
|
||||
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
stor_id: [
|
||||
{ required: true, message: '仓库不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
dtlShowDialog: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dtlShowDialog = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudReceivemst.getStorList().then(res => {
|
||||
this.storList = res
|
||||
})
|
||||
crudReceivemst.getStatus().then(res => {
|
||||
this.statusList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.afterToEdit]() {
|
||||
// 编辑之后获取明细
|
||||
crudReceivemst.getDtl({ 'receive_code': this.form.receive_code,'receive_id': this.form.receive_id }).then(res => {
|
||||
this.form.tableData = res
|
||||
// 将明细变成不可编辑
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
const row = this.form.tableData[i]
|
||||
row.edit = true
|
||||
this.form.tableData.splice(i, 1, row)
|
||||
}
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
// 数据校验
|
||||
if (this.form.tableData.length === 0) {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
},
|
||||
[CRUD.HOOK.afterToView]() {
|
||||
// 详情之后获取明细
|
||||
crudReceivemst.getDtl({ 'receive_code': this.form.receive_code,'receive_id': this.form.receive_id }).then(res => {
|
||||
this.form.tableData = res
|
||||
// 将明细变成不可编辑
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
const row = this.form.tableData[i]
|
||||
row.edit = true
|
||||
this.form.tableData.splice(i, 1, row)
|
||||
}
|
||||
})
|
||||
},
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
insertEvent() {
|
||||
this.dtlShowDialog = true
|
||||
},
|
||||
|
||||
handleEdit(index, row) {
|
||||
// 判断是否可以关闭编辑状态
|
||||
if (!row.edit) {
|
||||
if (parseFloat(row.receive_qty) <= 0) {
|
||||
this.crud.notify('到货数量不可为0!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!row.pcsn) {
|
||||
this.crud.notify('批次不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}
|
||||
row.edit = !row.edit
|
||||
this.form.tableData.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
|
||||
if (row.edit) {
|
||||
this.form.total_qty = 0
|
||||
this.form.tableData.forEach((item) => {
|
||||
this.form.total_qty = this.form.total_qty + item.receive_qty
|
||||
})
|
||||
}
|
||||
},
|
||||
tableChanged(rows) {
|
||||
const tablemap = new Map()
|
||||
rows.forEach((item) => {
|
||||
if (this.form.tableData.length !== 0) {
|
||||
this.flagnow = false
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
if (this.form.tableData[i].id === item.id || this.form.tableData[i].material_id === item.material_id) {
|
||||
this.flagnow = true
|
||||
}
|
||||
}
|
||||
if (!this.flagnow) {
|
||||
item.edit = false
|
||||
item.status = '10'
|
||||
item.pcsn = item.old_pcsn
|
||||
if (item.sum_qty === '') {
|
||||
item.receive_qty = parseFloat(item.qty)
|
||||
}else{
|
||||
item.receive_qty = parseFloat(item.qty) - parseFloat(item.sum_qty)
|
||||
}
|
||||
tablemap.set(item.id, item)
|
||||
}
|
||||
} else {
|
||||
item.edit = false
|
||||
item.status = '10'
|
||||
item.pcsn = item.old_pcsn
|
||||
if (item.sum_qty === '') {
|
||||
item.receive_qty = parseFloat(item.qty)
|
||||
}else{
|
||||
item.receive_qty = parseFloat(item.qty) - parseFloat(item.sum_qty)
|
||||
}
|
||||
tablemap.set(item.id, item)
|
||||
}
|
||||
})
|
||||
for (const value of tablemap.values()) {
|
||||
this.form.tableData.push(value)
|
||||
}
|
||||
this.form.dtl_num = this.form.tableData.length
|
||||
},
|
||||
delOne(index, rows) {
|
||||
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].receive_qty)
|
||||
rows.splice(index, 1)
|
||||
this.form.dtl_num = this.form.tableData.length
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 4px 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
164
mes/qd/src/views/wms/pcs/receivemst/DtlShowDialog.vue
Normal file
164
mes/qd/src/views/wms/pcs/receivemst/DtlShowDialog.vue
Normal file
@@ -0,0 +1,164 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="请选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
:show-close="false"
|
||||
width="70%"
|
||||
@close="close"
|
||||
>
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<date-range-picker v-model="query.createTime" class="date-item" value-format="yyyy-MM-dd" />
|
||||
<el-input
|
||||
v-model="query.receive_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入到货通知单号"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入物料名称或物料编码"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<rrOperation />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation />
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="supp_name" label="供应商" min-width="220" show-overflow-tooltip />
|
||||
<el-table-column show-overflow-tooltip prop="input_time" min-width="140px" label="订单日期" />
|
||||
<el-table-column show-overflow-tooltip prop="source_bill_code" label="单据编号" min-width="140" />
|
||||
<el-table-column show-overflow-tooltip prop="crowno" label="明细行号" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" min-width="130" label="物料编号" />
|
||||
<el-table-column show-overflow-tooltip min-width="130" prop="material_name" label="物料名称" />
|
||||
<el-table-column show-overflow-tooltip prop="qty" label="采购重量" :formatter="crud.formatNum3" />
|
||||
<el-table-column show-overflow-tooltip prop="sum_qty" label="已到货" :formatter="crud.formatNum3" />
|
||||
<el-table-column show-overflow-tooltip prop="instor_qty" label="已入库" :formatter="crud.formatNum3" />
|
||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" />
|
||||
<el-table-column show-overflow-tooltip prop="proc_status" label="状态" :formatter="formaStatusName" />
|
||||
<el-table-column show-overflow-tooltip prop="contract_no" label="合同编码" />
|
||||
<el-table-column show-overflow-tooltip prop="price" label="无税单价" :formatter="crud.formatNum3" />
|
||||
<el-table-column show-overflow-tooltip prop="price_tax" label="含税单价" :formatter="crud.formatNum3" />
|
||||
<el-table-column show-overflow-tooltip prop="input_optname" label="导入人" />
|
||||
<el-table-column show-overflow-tooltip prop="input_time" label="导入时间" min-width="140" />
|
||||
<el-table-column show-overflow-tooltip prop="update_optname" label="更新人" />
|
||||
<el-table-column show-overflow-tooltip prop="update_time" label="更新时间" min-width="140" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="sure">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
import crudReceivemst from '@/api/wms/pcs/receivemst'
|
||||
import crudOrderproc from '@/api/wms/pcs/orderproc'
|
||||
|
||||
export default {
|
||||
name: 'DtlShowDialog',
|
||||
components: { pagination, rrOperation, crudOperation, udOperation, DateRangePicker },
|
||||
mixins: [presenter(), header(), form(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
url: 'api/receivemst/queryOrder',
|
||||
idField: 'id',
|
||||
sort: 'id,desc',
|
||||
crudMethod: { ... crudReceivemst },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: false
|
||||
}
|
||||
})
|
||||
},
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
procStatusList: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudOrderproc.getProcStatus().then(res => {
|
||||
this.procStatusList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
formaStatusName(row, column) {
|
||||
for (const item of this.procStatusList) {
|
||||
if (item.code === row.proc_status) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
},
|
||||
sure() {
|
||||
const _selectData = this.$refs.multipleTable.selection
|
||||
if (_selectData.length <= 0) {
|
||||
return this.crud.notify('请先勾选记录!', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
}
|
||||
this.$emit('update:dialogShow', false)
|
||||
// 将当前表单中的数据传回父页面
|
||||
this.rows = this.$refs.multipleTable.selection
|
||||
this.$emit('tableChanged', this.rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
402
mes/qd/src/views/wms/pcs/receivemst/index.vue
Normal file
402
mes/qd/src/views/wms/pcs/receivemst/index.vue
Normal file
@@ -0,0 +1,402 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
size="mini"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="订单编号">
|
||||
<el-input
|
||||
v-model="query.vbillcode"
|
||||
size="mini"
|
||||
clearable
|
||||
style="width: 220px"
|
||||
placeholder="订单编号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="到货单号">
|
||||
<el-input
|
||||
v-model="query.receive_code"
|
||||
style="width: 220px"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="到货单号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="物料名称">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
size="mini"
|
||||
style="width: 220px"
|
||||
placeholder="物料名称、编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="供应商">
|
||||
<label slot="label">供 应 商:</label>
|
||||
<el-input
|
||||
v-model="query.supp_code"
|
||||
clearable
|
||||
style="width: 220px"
|
||||
size="mini"
|
||||
placeholder="供应商名称、编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态">
|
||||
<el-select
|
||||
v-model="query.status"
|
||||
multiple
|
||||
clearable
|
||||
style="width: 220px"
|
||||
size="mini"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
@change="handStatus"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in receiveStatusList"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料批次">
|
||||
<label slot="label">批 次:</label>
|
||||
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
size="mini"
|
||||
style="width: 220px"
|
||||
placeholder="批次"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建日期">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="crud.toQuery()"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-share"
|
||||
size="mini"
|
||||
@click="createQc"
|
||||
>
|
||||
生成质检单
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="confirm"
|
||||
>
|
||||
强制确认
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-printer"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="printButton"
|
||||
>
|
||||
打印
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
title="打印"
|
||||
:visible.sync="printDialog"
|
||||
width="30%"
|
||||
:before-close="handleClose"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="到货单号:" prop="receive_code">
|
||||
<el-input v-model="form.receive_code" :disabled="true" placeholder="系统生成" style="width: 280px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码:" prop="material_code">
|
||||
<el-input v-model="form.material_code" :disabled="true" style="width: 280px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称:" prop="material_name">
|
||||
<el-input v-model="form.material_name" :disabled="true" style="width: 280px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="批次:" prop="material_name">
|
||||
<el-input v-model="form.pcsn" style="width: 280px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="重量:" prop="receive_qty">
|
||||
<el-input-number v-model="form.receive_qty" :precision="3" :step="1" :disabled="true" :controls="false" placeholder="kg" style="width: 280px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标准桶重:" prop="standard_weight">
|
||||
<el-input-number
|
||||
v-model="form.standard_weight"
|
||||
:precision="3"
|
||||
:step="1"
|
||||
:controls="false"
|
||||
placeholder="kg"
|
||||
style="width: 280px;"
|
||||
@change="acuTotal"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="数量:" prop="print_qty">
|
||||
<el-input-number v-model="form.print_qty" :controls="false" :min="1" :max="99999" @change="acuTotal2"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="handleClose">取消</el-button>
|
||||
<el-button icon="el-icon-printer" type="primary" size="mini" @click="print">打印</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-permission="['admin','user:edit','user:del']" fixed="right" label="操作" width="120px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:disabled-edit="canUd(scope.row)"
|
||||
:disabled-dle="canUd(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="false" prop="receive_id" label="到货单标识" />
|
||||
<el-table-column prop="status" label="状态" :formatter="formatStatusName" />
|
||||
<el-table-column prop="vbillcode" label="订单编号" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column show-overflow-tooltip prop="receive_code" label="到货单号" width="160px">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.receive_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="supp_name" label="供应商" min-width="220" show-overflow-tooltip />
|
||||
<el-table-column prop="material_code" label="物料编码" width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="material_name" label="物料名称" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="pcsn" label="批次号" show-overflow-tooltip min-width="120" />
|
||||
<el-table-column prop="whether" label="质检单是否已生成" show-overflow-tooltip min-width="120" :formatter="formatWhether"/>
|
||||
<el-table-column prop="receive_qty" label="到货重量" width="120px" :formatter="crud.formatNum3" />
|
||||
<el-table-column prop="instor_qty" label="入库重量" width="120px" :formatter="crud.formatNum3" />
|
||||
<el-table-column prop="surplus_qty" label="剩余重量" width="120px" :formatter="crud.formatNum3" />
|
||||
<el-table-column prop="qty_unit_name" label="单位" />
|
||||
<el-table-column prop="input_optname" label="创建人" />
|
||||
<el-table-column prop="receive_date" label="到货日期" width="120px" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<AddShowDialog />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudReceivemst from '@/api/wms/pcs/receivemst'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
import AddShowDialog from '@/views/wms/pcs/receivemst/AddShowDialog'
|
||||
import { getLodop } from '@/assets/js/lodop/LodopFuncs'
|
||||
|
||||
export default {
|
||||
name: 'Receivemst',
|
||||
components: {pagination, crudOperation, rrOperation, udOperation, DateRangePicker, AddShowDialog},
|
||||
mixins: [presenter(), header(), crud(), form()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '到货通知单',
|
||||
url: 'api/receivemst',
|
||||
idField: 'receivedtl_id',
|
||||
sort: 'receivedtl_id,desc',
|
||||
crudMethod: {...crudReceivemst},
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
receiveStatusList: [],
|
||||
addShowDialog: false,
|
||||
printDialog: false,
|
||||
permission: {},
|
||||
flagnow: true,
|
||||
form: {},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
addShowDialog: {
|
||||
handler(newValue, oldValue) {
|
||||
this.addShowDialog = newValue
|
||||
if (!newValue) {
|
||||
this.crud.toQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudReceivemst.getStatus().then(res => {
|
||||
this.receiveStatusList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
formatStatusName(row, column) {
|
||||
for (const item of this.receiveStatusList) {
|
||||
if (item.code === row.status) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
},
|
||||
formatWhether(row, column) {
|
||||
if (row.is_no === '') {
|
||||
return '否'
|
||||
} else {
|
||||
return '是'
|
||||
}
|
||||
},
|
||||
canUd(row) {
|
||||
// 如果状态不是10 就不可以修改
|
||||
return row.status !== '10'
|
||||
},
|
||||
acuTotal() {
|
||||
this.flagnow = true
|
||||
if (this.form.standard_weight > 0) {
|
||||
this.form.print_qty = Math.floor(this.form.receive_qty / this.form.standard_weight)
|
||||
}
|
||||
},
|
||||
acuTotal2() {
|
||||
this.flagnow = false
|
||||
},
|
||||
confirm() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
if (_selectData.length === 0 || _selectData.length > 1) {
|
||||
this.crud.notify('请选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
crudReceivemst.confirm(_selectData[0]).then(res => {
|
||||
this.crud.notify('操作完成', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
printButton() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
if (_selectData.length === 0 || _selectData.length > 1) {
|
||||
this.crud.notify('请选择一条记录打印', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (_selectData[0].status === '99') {
|
||||
this.crud.notify('此单据不能打印', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
this.form = _selectData[0]
|
||||
this.printDialog = true
|
||||
this.acuTotal()
|
||||
},
|
||||
print() {
|
||||
if (this.form.print_qty <= 0) {
|
||||
this.crud.notify('数量不能为0!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (this.form.standard_weight <= 0) {
|
||||
this.crud.notify('标准桶重不能为0!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (this.flagnow) {
|
||||
this.acuTotal()
|
||||
}
|
||||
const data = this.form
|
||||
|
||||
crudReceivemst.print(data).then(res => {
|
||||
res.forEach((item) => {
|
||||
const time = item.create_time
|
||||
var num = Number.parseFloat(item.storage_qty)
|
||||
const strTime = time.slice(0, 10)
|
||||
const LODOP = getLodop()
|
||||
LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
|
||||
// 打印纸张大小设置https://www.it610.com/article/2094844.html
|
||||
let flag = LODOP.PRINT_INIT('')
|
||||
LODOP.SET_PRINT_PAGESIZE(1, '80mm', '60mm', '')
|
||||
LODOP.ADD_PRINT_RECT('1mm', '3mm', '74mm', '54mm', 0, 1)
|
||||
LODOP.SET_PRINT_STYLE('FontSize', 12)
|
||||
LODOP.SET_PRINT_STYLE('Bold', 1)
|
||||
LODOP.ADD_PRINT_BARCODE('2mm', '4mm', '33mm', '33mm', 'QRCode', item.bucketunique + '##' + item.material_id + '##' + item.pcsn + '##' + item.storage_qty + '##' + strTime)
|
||||
LODOP.ADD_PRINT_TEXT('5mm', '35mm', '50mm', '15mm', '日期:' + strTime)
|
||||
LODOP.ADD_PRINT_TEXT('15mm', '35mm', '50mm', '15mm', '批次:' + item.pcsn)
|
||||
LODOP.ADD_PRINT_TEXT('25mm', '35mm', '50mm', '15mm', '重量:' + num.toFixed(3) + 'kg')
|
||||
LODOP.ADD_PRINT_TEXT('34mm', '5mm', '80mm', '15mm', '桶号:' + item.bucketunique + '')
|
||||
LODOP.ADD_PRINT_TEXT('41mm', '5mm', '80mm', '15mm', '编码:' + item.material_code + '')
|
||||
LODOP.ADD_PRINT_TEXT('48mm', '5mm', '80mm', '15mm', '名称:' + item.material_name + '')
|
||||
// LODOP.PREVIEW()// 预览
|
||||
LODOP.PRINT()// 打印
|
||||
})
|
||||
this.crud.notify('打印成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.printDialog = false
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
handleClose() {
|
||||
this.printDialog = false
|
||||
},
|
||||
createQc() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
if (_selectData.length < 1) {
|
||||
this.crud.notify('请至少选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < _selectData.length; i++) {
|
||||
const data = _selectData[i]
|
||||
crudReceivemst.createQc(data).then(res => {
|
||||
this.crud.notify('生成成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}
|
||||
},
|
||||
handStatus(val) {
|
||||
this.query.status = val
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user