临时提交(报表,在做选择单价)
This commit is contained in:
parent
4ab4596fbc
commit
d1f542a841
|
@ -9,6 +9,20 @@ export function listPrice(query) {
|
|||
})
|
||||
}
|
||||
|
||||
// 查询单价列表ByIds
|
||||
export function listPriceByIds(priceIds) {
|
||||
return request({
|
||||
url: '/yh/price/listByIds',
|
||||
config: {
|
||||
headers: {
|
||||
repeatSubmit: false,
|
||||
}
|
||||
},
|
||||
method: 'post',
|
||||
data: priceIds
|
||||
})
|
||||
}
|
||||
|
||||
// 查询单价详细
|
||||
export function getPrice(priceId) {
|
||||
return request({
|
||||
|
@ -78,3 +92,11 @@ export function disablePrice(priceId) {
|
|||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
||||
// 单价启用
|
||||
export function enablePrice(priceId) {
|
||||
return request({
|
||||
url: `/yh/price/${priceId}/enable`,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
|
44
src/api/yh/report.js
Normal file
44
src/api/yh/report.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询报表列表
|
||||
export function listReport(query) {
|
||||
return request({
|
||||
url: '/yh/report/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询报表详细
|
||||
export function getReport(reportId) {
|
||||
return request({
|
||||
url: '/yh/report/' + reportId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增报表
|
||||
export function addReport(data) {
|
||||
return request({
|
||||
url: '/yh/report',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改报表
|
||||
export function updateReport(data) {
|
||||
return request({
|
||||
url: '/yh/report',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除报表
|
||||
export function delReport(reportId) {
|
||||
return request({
|
||||
url: '/yh/report/' + reportId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -6,6 +6,10 @@
|
|||
:placeholder="placeholder"
|
||||
:disabled="disabled"
|
||||
@select="onSelect"
|
||||
:style="{
|
||||
height: height,
|
||||
width: width
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
@ -30,6 +34,14 @@ export default {
|
|||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '32px'
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '100%'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -77,3 +89,9 @@ export default {
|
|||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.vue-treeselect__input-container {
|
||||
height: 34px !important;
|
||||
}
|
||||
</style>
|
||||
|
|
322
src/components/Business/Price/PriceDialog.vue
Normal file
322
src/components/Business/Price/PriceDialog.vue
Normal file
|
@ -0,0 +1,322 @@
|
|||
<!--version: 3, 选择弹窗-->
|
||||
<!--版本更新内容:添加prop属性,修复多选-->
|
||||
|
||||
<template>
|
||||
<el-dialog :title="title" :visible="show" width="80%" top="2vh" @open="open" @close="close"
|
||||
:append-to-body="true">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
|
||||
<el-form-item label="部门" prop="deptId">
|
||||
<dept-tree-select v-model="queryParams.deptId" width="215px" @change="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable @change="handleQuery">
|
||||
<el-option
|
||||
v-for="dict in dict.type.price_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="类别" prop="category">
|
||||
<el-input
|
||||
v-model="queryParams.category"
|
||||
placeholder="请输入类别"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="大小" prop="size">
|
||||
<el-input
|
||||
v-model="queryParams.size"
|
||||
placeholder="请输入大小"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工序" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入工序名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="子工序" prop="subName">
|
||||
<el-input
|
||||
v-model="queryParams.subName"
|
||||
placeholder="请输入子工序名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="图案" prop="pattern">
|
||||
<el-input
|
||||
v-model="queryParams.pattern"
|
||||
placeholder="请输入图案"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格" prop="spec">
|
||||
<el-input
|
||||
v-model="queryParams.spec"
|
||||
placeholder="请输入规格"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位" prop="unit">
|
||||
<el-input
|
||||
v-model="queryParams.unit"
|
||||
placeholder="请输入单位"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="queryParams.remark"
|
||||
placeholder="请输入备注"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="分类" prop="classify">
|
||||
<el-input
|
||||
v-model="queryParams.classify"
|
||||
placeholder="请输入分类"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="createBy">
|
||||
<el-input
|
||||
v-model="queryParams.createBy"
|
||||
placeholder="请输入创建人名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核人" prop="verifyBy">
|
||||
<el-input
|
||||
v-model="queryParams.verifyBy"
|
||||
placeholder="请输入审核人名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updateBy">
|
||||
<el-input
|
||||
v-model="queryParams.updateBy"
|
||||
placeholder="请输入更新人名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="禁用状态" prop="disabled">
|
||||
<el-radio-group v-model="queryParams.disabled" @change="handleQuery">
|
||||
<el-radio :label="null">全部</el-radio>
|
||||
<el-radio :label="false">启用</el-radio>
|
||||
<el-radio :label="true">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</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>
|
||||
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
v-loading="loadTable"
|
||||
@row-click="changeSelection"
|
||||
@row-dblclick="select"
|
||||
@select-all="selectionAll"
|
||||
@select="changeSelection"
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table-column align="center" type="selection" v-if="multiple"/>
|
||||
<el-table-column label="#" type="index" align="center"/>
|
||||
<el-table-column label="部门" prop="deptName"/>
|
||||
|
||||
</el-table>
|
||||
<pagination
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:total="total"
|
||||
@pagination="getList">
|
||||
</pagination>
|
||||
|
||||
<template #footer>
|
||||
<el-button type="primary" @click="submit()">确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {deepClone} from "@/utils";
|
||||
import { mapGetters } from 'vuex'
|
||||
import DeptTreeSelect from "@/components/Business/Dept/DeptTreeSelect.vue";
|
||||
import Price from "@/views/yh/price/index.vue";
|
||||
import {listPrice} from "@/api/yh/price";
|
||||
|
||||
export default {
|
||||
name: "PriceDialog",
|
||||
dicts: ['price_status'],
|
||||
components: {Price, DeptTreeSelect},
|
||||
props: {
|
||||
// 标题
|
||||
title: {
|
||||
type: String,
|
||||
default: `选择单价`
|
||||
},
|
||||
value: {
|
||||
type: [String, Number, Array],
|
||||
default: null,
|
||||
},
|
||||
multiple: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
query: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
initSelect: {
|
||||
type: Array,
|
||||
default: null,
|
||||
},
|
||||
prop: {
|
||||
type: String,
|
||||
default: 'priceId'
|
||||
},
|
||||
listApi: {
|
||||
type: Function,
|
||||
default: listPrice
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loadTable: false,
|
||||
tableData: [],
|
||||
queryParams: {},
|
||||
total: 0,
|
||||
row: null,
|
||||
selected: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
FieldName() {
|
||||
return FieldName
|
||||
},
|
||||
...mapGetters(['userType'])
|
||||
},
|
||||
methods: {
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 获取数据列表
|
||||
getList() {
|
||||
this.loadTable = true;
|
||||
this.listApi(this.queryParams).then(response => {
|
||||
this.tableData = response.rows;
|
||||
this.total = response.total;
|
||||
// 刷新表格状态
|
||||
this.$nextTick(()=>{
|
||||
this.refreshTableSelection();
|
||||
})
|
||||
}).finally(() =>{
|
||||
this.loadTable = false;
|
||||
})
|
||||
},
|
||||
// 打开时
|
||||
open() {
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
...this.query,
|
||||
}
|
||||
|
||||
if (this.initSelect) {
|
||||
this.selected = deepClone(this.initSelect);
|
||||
} else {
|
||||
this.selected = [];
|
||||
}
|
||||
|
||||
this.getList();
|
||||
},
|
||||
// 刷新表格的选中状态
|
||||
refreshTableSelection() {
|
||||
if(this.multiple){
|
||||
this.tableData.forEach(item => {
|
||||
if (this.selected.map(j => j[this.prop]).includes(item[this.prop])) {
|
||||
this.$refs.multipleTable.toggleRowSelection(item, true);
|
||||
} else {
|
||||
this.$refs.multipleTable.toggleRowSelection(item, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
// 全选
|
||||
selectionAll(val){
|
||||
let flag = val.length > 0;
|
||||
this.tableData.forEach(item => {
|
||||
if (flag && !this.selected.map(i => i[this.prop]).includes(item[this.prop])){
|
||||
this.selected.push(item);
|
||||
} else if (!flag && this.selected.map(i => i[this.prop]).includes(item[this.prop])){
|
||||
this.selected = this.selected.filter(i => i[this.prop] !== item[this.prop]);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 确认选中
|
||||
submit() {
|
||||
if (this.multiple) {
|
||||
this.$emit('select', this.selected);
|
||||
} else {
|
||||
this.select(this.row);
|
||||
}
|
||||
},
|
||||
// 更换某一行的选中状态
|
||||
changeSelection(row){
|
||||
if(this.multiple){
|
||||
if (this.selected.map(i => i[this.prop]).includes(row[this.prop])){
|
||||
this.$refs.multipleTable.toggleRowSelection(row, false);
|
||||
this.selected = this.selected.filter(i => i[this.prop] !== row[this.prop]);
|
||||
}else {
|
||||
this.$refs.multipleTable.toggleRowSelection(row, true);
|
||||
this.selected.push(row);
|
||||
}
|
||||
} else {
|
||||
this.row = row;
|
||||
}
|
||||
},
|
||||
// 点击搜索
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
// 关闭弹窗
|
||||
close() {
|
||||
this.$emit('update:show', false);
|
||||
this.queryParams.pageNum = 1;
|
||||
this.queryParams.pageSize = 10;
|
||||
},
|
||||
// 选中一行
|
||||
select(row) {
|
||||
if (!this.multiple) {
|
||||
if (!row) return this.$message.error('请选择一行');
|
||||
this.selected = [row];
|
||||
this.$emit('select', row);
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
204
src/components/Business/Price/PriceInput.vue
Normal file
204
src/components/Business/Price/PriceInput.vue
Normal file
|
@ -0,0 +1,204 @@
|
|||
<!--version: 4, 经营场所选择器-->
|
||||
<!--版本更新内容:添加prop属性,修复多选-->
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<template v-if="multiple">
|
||||
<el-tag
|
||||
v-for="(item,index) of selected"
|
||||
:key="item.storeId"
|
||||
size="small"
|
||||
style="margin-right: 4px"
|
||||
disable-transitions
|
||||
:closable="!disabled"
|
||||
@close="onCloseSelected(index)"
|
||||
>{{item.name}}</el-tag>
|
||||
<el-tag style="cursor: not-allowed" size="small" type="info" v-if="disabled">+</el-tag>
|
||||
<el-tag style="cursor: pointer" size="small" @click="openDialog" type="success" v-else>+</el-tag>
|
||||
</template>
|
||||
<el-input
|
||||
v-else
|
||||
:value="inputBindValue"
|
||||
@focus="openDialog"
|
||||
:size="size"
|
||||
:disabled="disabled"
|
||||
readonly
|
||||
:placeholder="placeholder">
|
||||
<template #suffix><i class="el-icon-arrow-right"/></template>
|
||||
</el-input>
|
||||
|
||||
<price-dialog
|
||||
:show.sync="dialogShow"
|
||||
:query="query"
|
||||
:multiple="multiple"
|
||||
:init-select="selected"
|
||||
@select="onSubmit"
|
||||
:prop="prop"
|
||||
:title="title"
|
||||
:list-api="listApi"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {isDeepEqual} from "@/utils";
|
||||
import { mapGetters } from 'vuex'
|
||||
import PriceDialog from "@/components/Business/Price/PriceDialog.vue";
|
||||
import {listPrice, listPriceByIds} from "@/api/yh/price";
|
||||
|
||||
export default {
|
||||
name: 'PriceInput',
|
||||
components: {PriceDialog},
|
||||
props:{
|
||||
// 标题
|
||||
title: {
|
||||
type: String,
|
||||
default: `选择单价`
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: `点击选择单价`,
|
||||
},
|
||||
// 展示值的属性
|
||||
showProp: {
|
||||
type: String,
|
||||
default: 'name'
|
||||
},
|
||||
// 选择的属性值
|
||||
prop: {
|
||||
type: String,
|
||||
default: 'priceId'
|
||||
},
|
||||
// 是否多选
|
||||
multiple: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 双向绑定的值(为id)
|
||||
value: {
|
||||
type: [Array, String, Number],
|
||||
default: null
|
||||
},
|
||||
// 查询条件
|
||||
query: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
// 打开弹窗前
|
||||
beforeOpen: {
|
||||
type: Function,
|
||||
default: () => {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
// 关闭弹窗前
|
||||
beforeClose: {
|
||||
type: Function,
|
||||
default: () => {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
// 大小
|
||||
size: {
|
||||
type: String,
|
||||
default: "medium"
|
||||
},
|
||||
// 是否禁用
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 对象处理器,参数类型:对象,返回值类型:字符串
|
||||
objectParser: {
|
||||
type: Function,
|
||||
default: (obj) => {
|
||||
return JSON.stringify(obj);
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selected: [], // 当前选中的值
|
||||
dialogShow: false, // 展示对话框
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userType', 'smUserType']),
|
||||
// 显示绑定的值
|
||||
inputBindValue() {
|
||||
if (this.selected == null || this.selected.length === 0) {
|
||||
return null;
|
||||
}
|
||||
return this.selected.map(item => item[this.showProp]).join(",");
|
||||
},
|
||||
listApi() {
|
||||
return listPrice;
|
||||
},
|
||||
loadApi() {
|
||||
return listPriceByIds;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value(nv, ov) {
|
||||
this.loadSelected(nv);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadSelected(this.value);
|
||||
},
|
||||
methods: {
|
||||
onCloseSelected(index) {
|
||||
this.selected.splice(index, 1);
|
||||
this.onSubmit(this.selected);
|
||||
},
|
||||
// 加载选中的值
|
||||
loadSelected(ids) {
|
||||
if (ids == null || ids.length === 0) {
|
||||
this.selected = [];
|
||||
return;
|
||||
}
|
||||
if (ids instanceof Array) {
|
||||
this.doLoad(ids);
|
||||
} else {
|
||||
this.doLoad([ids]);
|
||||
}
|
||||
},
|
||||
// 加载选中值
|
||||
doLoad(ids) {
|
||||
this.loadApi(ids).then(res => {
|
||||
this.selected = res.data;
|
||||
})
|
||||
},
|
||||
// 修改值
|
||||
inputValue(val){
|
||||
this.$emit('input', val);
|
||||
},
|
||||
// 确定
|
||||
onSubmit(selected){
|
||||
let value = null;
|
||||
if (this.multiple) {
|
||||
value = selected.map(item => item[this.prop]);
|
||||
} else {
|
||||
value = selected[this.prop];
|
||||
}
|
||||
this.$emit('submit', selected);
|
||||
if (!isDeepEqual(this.value, value)) {
|
||||
this.$emit('change', selected);
|
||||
}
|
||||
this.inputValue(value);
|
||||
this.closeDialog();
|
||||
},
|
||||
closeDialog() {
|
||||
if (this.beforeClose()) {
|
||||
this.dialogShow = false;
|
||||
}
|
||||
},
|
||||
// 打开对话框
|
||||
openDialog(){
|
||||
if (this.beforeOpen()) {
|
||||
this.dialogShow = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -10,7 +10,7 @@ export const PriceStatus = {
|
|||
REJECT: "4", // 未通过
|
||||
// 允许编辑
|
||||
canEdit(status) {
|
||||
return [this.WAIT_SUBMIT].includes(status);
|
||||
return [this.WAIT_SUBMIT, this.REJECT].includes(status);
|
||||
},
|
||||
// 允许提交
|
||||
canSubmit(status) {
|
||||
|
@ -27,5 +27,9 @@ export const PriceStatus = {
|
|||
// 允许禁用
|
||||
canDisable(status) {
|
||||
return [this.PASS].includes(status);
|
||||
},
|
||||
// 允许启用
|
||||
canEnable(status) {
|
||||
return [this.PASS].includes(status);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
// 视图
|
||||
import {views} from "@/utils/constants";
|
||||
|
||||
// 视图
|
||||
export const $view = {
|
||||
props: {
|
||||
view: {
|
||||
|
|
|
@ -1,22 +1,28 @@
|
|||
<template>
|
||||
<el-dialog :visible.sync="show" width="1000px" title="审核单价" center>
|
||||
<el-descriptions v-loading="loading">
|
||||
<el-descriptions-item label="部门">{{detail.deptName | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="类别">{{detail.category | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="大小">{{detail.size | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="工序">{{detail.name | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="子工序">{{detail.subName | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="图案">{{detail.pattern | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="规格">{{detail.pattern | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="单价">{{detail.price | dv}} 元</el-descriptions-item>
|
||||
<el-descriptions-item label="单位">{{detail.unit | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="分类">{{detail.classify | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="生产数量">{{detail.quantity | fix2 | dv}} 个</el-descriptions-item>
|
||||
<el-descriptions-item label="备注">{{detail.remark | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建人">{{detail.createBy | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">{{detail.createTime | dv}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-dialog :visible.sync="show" width="900px" title="审核单价" center>
|
||||
<div v-loading="loading">
|
||||
<el-descriptions border :column="4" style="margin-bottom: 1em">
|
||||
<el-descriptions-item label="创建人">{{detail.createBy | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">{{detail.createTime | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="更新人">{{detail.updateBy | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="更新时间">{{detail.updateTime | dv}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-descriptions border>
|
||||
<el-descriptions-item label="部门">{{detail.deptName | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="类别">{{detail.category | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="大小">{{detail.size | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="工序">{{detail.name | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="子工序">{{detail.subName | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="图案">{{detail.pattern | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="规格">{{detail.pattern | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="单价">{{detail.price | dv}} 元</el-descriptions-item>
|
||||
<el-descriptions-item label="单位">{{detail.unit | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="分类">{{detail.classify | dv}}</el-descriptions-item>
|
||||
<el-descriptions-item label="生产数量" span="2">{{detail.quantity | fix2 | dv}} 个</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" span="3">{{detail.remark | dv}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button type="success" plain icon="el-icon-check" @click="submitVerify(true)" :loading="submitLoading">通过</el-button>
|
||||
<el-button type="danger" plain icon="el-icon-close" @click="submitVerify(false)" :loading="submitLoading">驳回</el-button>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="部门" prop="deptId">
|
||||
<dept-tree-select v-model="queryParams.deptId" style="width: 15em" @change="handleQuery"/>
|
||||
<dept-tree-select v-model="queryParams.deptId" width="215px" @change="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable @change="handleQuery">
|
||||
|
@ -147,7 +147,13 @@
|
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="priceList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="onSortChange">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="priceList"
|
||||
@selection-change="handleSelectionChange"
|
||||
:default-sort="defaultSort"
|
||||
@sort-change="onSortChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<template v-for="column of showColumns">
|
||||
<el-table-column
|
||||
|
@ -169,7 +175,7 @@
|
|||
<dict-tag :options="dict.type.price_status" :value="d.row[column.key]"/>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'disabled'">
|
||||
<boolean-tag :value="d.row.disabled" true-text="禁用" true-type="danger" false-text="禁用" false-type="success" />
|
||||
<boolean-tag :value="d.row.disabled" true-text="禁用" true-type="danger" false-text="启用" false-type="success" />
|
||||
</template>
|
||||
<template v-else-if="column.key === 'quantity'">
|
||||
{{d.row.quantity | fix2 | dv}} 个
|
||||
|
@ -225,6 +231,14 @@
|
|||
v-has-permi="['yh:price:disable']"
|
||||
v-show="PriceStatus.canDisable(scope.row.status) && !scope.row.disabled"
|
||||
>禁用</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-circle-check"
|
||||
@click="handleEnable(scope.row)"
|
||||
v-has-permi="['yh:price:enable']"
|
||||
v-show="PriceStatus.canEnable(scope.row.status) && scope.row.disabled"
|
||||
>启用</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -238,7 +252,7 @@
|
|||
/>
|
||||
|
||||
<!-- 添加或修改单价对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false">
|
||||
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body :close-on-click-modal="false">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row :gutter="gutter">
|
||||
<form-col :span="span" label="部门" prop="deptId">
|
||||
|
@ -263,7 +277,9 @@
|
|||
<el-input v-model="form.spec" placeholder="请输入规格" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="单价" prop="price">
|
||||
<el-input v-model="form.price" placeholder="请输入单价" type="number" :min="0"/>
|
||||
<el-input v-model="form.price" placeholder="请输入单价" type="number" :min="0">
|
||||
<template #suffix>元</template>
|
||||
</el-input>
|
||||
</form-col>
|
||||
<form-col :span="span" label="单位" prop="unit">
|
||||
<el-input v-model="form.unit" placeholder="请输入单位" />
|
||||
|
@ -272,7 +288,7 @@
|
|||
<el-input v-model="form.classify" placeholder="请输入分类" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="生产数量" prop="quantity">
|
||||
<el-input v-model="form.quantity" placeholder="请输入生产数量(个)" >
|
||||
<el-input v-model="form.quantity" placeholder="请输入生产数量" type="number" :min="0">
|
||||
<template #suffix>个</template>
|
||||
</el-input>
|
||||
</form-col>
|
||||
|
@ -300,9 +316,9 @@ import {
|
|||
updatePrice,
|
||||
submitPrice,
|
||||
disablePrice,
|
||||
cancelPrice
|
||||
cancelPrice, enablePrice
|
||||
} from "@/api/yh/price";
|
||||
import { $showColumns } from '@/utils/mixins';
|
||||
import { $showColumns} from '@/utils/mixins';
|
||||
import DeptTreeSelect from "@/components/Business/Dept/DeptTreeSelect.vue";
|
||||
import BooleanTag from "@/components/BooleanTag/index.vue";
|
||||
import {PriceStatus} from "@/utils/constants";
|
||||
|
@ -317,16 +333,18 @@ const defaultSort = {
|
|||
|
||||
export default {
|
||||
name: "Price",
|
||||
mixins: [$showColumns],
|
||||
dicts: ['price_status'],
|
||||
components: {FormCol, VerifyPriceDialog, BooleanTag, DeptTreeSelect},
|
||||
computed: {
|
||||
PriceStatus() {
|
||||
return PriceStatus
|
||||
}
|
||||
},
|
||||
components: {FormCol, VerifyPriceDialog, BooleanTag, DeptTreeSelect},
|
||||
mixins: [$showColumns],
|
||||
dicts: ['price_status'],
|
||||
data() {
|
||||
return {
|
||||
gutter: 8,
|
||||
span: 8,
|
||||
// 审核弹窗
|
||||
showVerifyDialog: false,
|
||||
// 当前行
|
||||
|
@ -419,18 +437,9 @@ export default {
|
|||
unit: [
|
||||
{ required: true, message: "单位不能为空", trigger: "blur" }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
],
|
||||
createId: [
|
||||
{ required: true, message: "创建人ID不能为空", trigger: "blur" }
|
||||
],
|
||||
createBy: [
|
||||
{ required: true, message: "创建人名称不能为空", trigger: "blur" }
|
||||
],
|
||||
disabled: [
|
||||
{ required: true, message: "是否禁用不能为空", trigger: "blur" }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: "工序不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
|
@ -576,6 +585,21 @@ export default {
|
|||
})
|
||||
})
|
||||
},
|
||||
// 启用
|
||||
handleEnable(row) {
|
||||
this.$confirm('确定启用吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
enablePrice(row.priceId).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message.success("启用成功");
|
||||
this.getList();
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
|
|
509
src/views/yh/report/index.vue
Normal file
509
src/views/yh/report/index.vue
Normal file
|
@ -0,0 +1,509 @@
|
|||
<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="部门" prop="deptId">
|
||||
<dept-tree-select v-model="queryParams.deptId" width="215px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable @change="handleQuery">
|
||||
<el-option
|
||||
v-for="dict in dict.type.report_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="类别" prop="priceCategory">
|
||||
<el-input
|
||||
v-model="queryParams.priceCategory"
|
||||
placeholder="请输入单价类别"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="大小" prop="priceSize">
|
||||
<el-input
|
||||
v-model="queryParams.priceSize"
|
||||
placeholder="请输入单价大小"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工序" prop="priceName">
|
||||
<el-input
|
||||
v-model="queryParams.priceName"
|
||||
placeholder="请输入单价工序名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="子工序" prop="priceSubName">
|
||||
<el-input
|
||||
v-model="queryParams.priceSubName"
|
||||
placeholder="请输入单价子工序名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="图案" prop="pricePattern">
|
||||
<el-input
|
||||
v-model="queryParams.pricePattern"
|
||||
placeholder="请输入单价图案"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格" prop="priceSpec">
|
||||
<el-input
|
||||
v-model="queryParams.priceSpec"
|
||||
placeholder="请输入单价规格"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位" prop="priceUnit">
|
||||
<el-input
|
||||
v-model="queryParams.priceUnit"
|
||||
placeholder="请输入单价单位"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="分类" prop="priceClassify">
|
||||
<el-input
|
||||
v-model="queryParams.priceClassify"
|
||||
placeholder="请输入单价分类"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="createBy">
|
||||
<el-input
|
||||
v-model="queryParams.createBy"
|
||||
placeholder="请输入创建人名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核人" prop="verifyBy">
|
||||
<el-input
|
||||
v-model="queryParams.verifyBy"
|
||||
placeholder="请输入审核人名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updateBy">
|
||||
<el-input
|
||||
v-model="queryParams.updateBy"
|
||||
placeholder="请输入更新人名称"
|
||||
clearable
|
||||
@keyup.enter.native="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>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-has-permi="['yh:report:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-has-permi="['yh:report:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-has-permi="['yh:report:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="reportList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="onSortChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<template v-for="column of showColumns">
|
||||
<el-table-column
|
||||
:key="column.key"
|
||||
:label="column.label"
|
||||
:prop="column.key"
|
||||
:align="column.align"
|
||||
:min-width="column.minWidth"
|
||||
:sort-orders="orderSorts"
|
||||
:sortable="column.sortable"
|
||||
:show-overflow-tooltip="column.overflow"
|
||||
:width="column.width"
|
||||
>
|
||||
<template slot-scope="d">
|
||||
<template v-if="column.key === 'reportId'">
|
||||
{{d.row[column.key]}}
|
||||
</template>
|
||||
<template v-else-if="column.key === 'status'">
|
||||
<dict-tag :options="dict.type.report_status" :value="d.row[column.key]"/>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{d.row[column.key]}}
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-has-permi="['yh:report:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-has-permi="['yh:report:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改报表对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<form-col :span="span" label="部门" prop="deptId">
|
||||
<dept-tree-select v-model="form.deptId"/>
|
||||
</form-col>
|
||||
<form-col :span="span" label="完成数量" prop="num">
|
||||
<el-input v-model="form.num" placeholder="请输入工序完成数量" :min="1" type="number"/>
|
||||
</form-col>
|
||||
<form-col :span="span" label="选择单价" prop="priceId">
|
||||
<price-input v-model="form.priceId"/>
|
||||
</form-col>
|
||||
<form-col :span="span" label="单价ID" prop="priceId">
|
||||
<el-input v-model="form.priceId" placeholder="请输入单价ID" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="单价类别" prop="priceCategory">
|
||||
<el-input v-model="form.priceCategory" placeholder="请输入单价类别" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="单价大小" prop="priceSize">
|
||||
<el-input v-model="form.priceSize" placeholder="请输入单价大小" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="工序" prop="priceName">
|
||||
<el-input v-model="form.priceName" placeholder="请输入单价工序名称" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="子工序" prop="priceSubName">
|
||||
<el-input v-model="form.priceSubName" placeholder="请输入单价子工序名称" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="单价图案" prop="pricePattern">
|
||||
<el-input v-model="form.pricePattern" placeholder="请输入单价图案" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="单价规格" prop="priceSpec">
|
||||
<el-input v-model="form.priceSpec" placeholder="请输入单价规格" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="单价单价(元)" prop="pricePrice">
|
||||
<el-input v-model="form.pricePrice" placeholder="请输入单价单价(元)" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="单价单位" prop="priceUnit">
|
||||
<el-input v-model="form.priceUnit" placeholder="请输入单价单位" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="单价分类" prop="priceClassify">
|
||||
<el-input v-model="form.priceClassify" placeholder="请输入单价分类" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="生产数量倍数" prop="priceQuantity">
|
||||
<el-input v-model="form.priceQuantity" placeholder="请输入单价生产数量倍数" />
|
||||
</form-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listReport, getReport, delReport, addReport, updateReport } from "@/api/yh/report";
|
||||
import { $showColumns } from '@/utils/mixins';
|
||||
import FormCol from "@/components/FormCol/index.vue";
|
||||
import DeptTreeSelect from "@/components/Business/Dept/DeptTreeSelect.vue";
|
||||
import PriceInput from "@/components/Business/Price/PriceInput.vue";
|
||||
|
||||
// 默认排序字段
|
||||
const defaultSort = {
|
||||
prop: "createTime",
|
||||
order: "descending"
|
||||
}
|
||||
|
||||
export default {
|
||||
name: "Report",
|
||||
mixins: [$showColumns],
|
||||
dicts: ['report_status'],
|
||||
components: {PriceInput, DeptTreeSelect, FormCol},
|
||||
data() {
|
||||
return {
|
||||
gutter: 8,
|
||||
span: 24,
|
||||
// 字段列表
|
||||
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: 'num', visible: true, label: '完成数量', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'status', visible: true, label: '状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'priceId', visible: false, label: '单价ID', 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: '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: '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: '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: 'priceClassify', visible: true, 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},
|
||||
{key: 'createBy', visible: true, label: '创建人', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'createTime', visible: true, label: '创建时间', minWidth: null, sortable: false, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'verifyBy', visible: true, label: '审核人', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'verifyTime', visible: true, label: '审核时间', minWidth: null, sortable: false, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'updateBy', visible: true, label: '更新人', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'updateTime', visible: true, label: '更新时间', minWidth: null, sortable: false, overflow: false, align: 'center', width: "100"},
|
||||
],
|
||||
// 排序方式
|
||||
orderSorts: ['ascending', 'descending', null],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 报表表格数据
|
||||
reportList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
defaultSort,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
orderByColumn: defaultSort.prop,
|
||||
isAsc: defaultSort.order,
|
||||
reportId: null,
|
||||
deptId: null,
|
||||
status: null,
|
||||
priceId: null,
|
||||
priceCategory: null,
|
||||
priceSize: null,
|
||||
priceName: null,
|
||||
priceSubName: null,
|
||||
pricePattern: null,
|
||||
priceSpec: null,
|
||||
priceUnit: null,
|
||||
priceClassify: null,
|
||||
createId: null,
|
||||
createBy: null,
|
||||
verifyId: null,
|
||||
verifyBy: null,
|
||||
updateId: null,
|
||||
updateBy: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
deptId: [
|
||||
{ required: true, message: "部门ID不能为空", trigger: "blur" }
|
||||
],
|
||||
num: [
|
||||
{ required: true, message: "工序完成数量不能为空", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "状态不能为空", trigger: "change" }
|
||||
],
|
||||
priceId: [
|
||||
{ required: true, message: "单价ID不能为空", trigger: "blur" }
|
||||
],
|
||||
priceName: [
|
||||
{ required: true, message: "单价工序名称不能为空", trigger: "blur" }
|
||||
],
|
||||
pricePrice: [
|
||||
{ required: true, message: "单价单价(元)不能为空", trigger: "blur" }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
],
|
||||
createBy: [
|
||||
{ required: true, message: "创建人名称不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 当排序按钮被点击时触发 **/
|
||||
onSortChange(column) {
|
||||
if (column.order == null) {
|
||||
this.queryParams.orderByColumn = defaultSort.prop;
|
||||
this.queryParams.isAsc = defaultSort.order;
|
||||
} else {
|
||||
this.queryParams.orderByColumn = column.prop;
|
||||
this.queryParams.isAsc = column.order;
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
/** 查询报表列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listReport(this.queryParams).then(response => {
|
||||
this.reportList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
reportId: null,
|
||||
deptId: null,
|
||||
num: null,
|
||||
status: null,
|
||||
priceId: null,
|
||||
priceCategory: null,
|
||||
priceSize: null,
|
||||
priceName: null,
|
||||
priceSubName: null,
|
||||
pricePattern: null,
|
||||
priceSpec: null,
|
||||
pricePrice: null,
|
||||
priceUnit: null,
|
||||
priceClassify: null,
|
||||
priceQuantity: null,
|
||||
createTime: null,
|
||||
createId: null,
|
||||
createBy: null,
|
||||
verifyTime: null,
|
||||
verifyId: null,
|
||||
verifyBy: null,
|
||||
updateTime: null,
|
||||
updateId: null,
|
||||
updateBy: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.reportId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加报表";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const reportId = row.reportId || this.ids
|
||||
getReport(reportId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改报表";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.reportId != null) {
|
||||
updateReport(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addReport(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const reportIds = row.reportId || this.ids;
|
||||
this.$modal.confirm('是否确认删除报表编号为"' + reportIds + '"的数据项?').then(function() {
|
||||
return delReport(reportIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('yh/report/export', {
|
||||
...this.queryParams
|
||||
}, `report_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user