<template>
|
<div style="padding:12px">
|
<el-card>
|
<el-form :inline="true" :model="query" class="mb8" ref="queryForm">
|
<el-form-item label="日期间隔">
|
<el-select v-model="query.HInitTimeCycle" placeholder="请选择" style="width:160px" @change="onTimeCycleChange">
|
<el-option v-for="(t,i) in timeCycles" :key="i" :label="t.label" :value="t.value" />
|
</el-select>
|
</el-form-item>
|
<el-form-item label="开始日期">
|
<el-date-picker v-model="query.HBeginDate" type="date" placeholder="开始日期" style="width:160px" :disabled="timeCycleDisabled" value-formate="yyyy-MM-dd" format="yyyy-MM-dd"/>
|
</el-form-item>
|
<el-form-item label="结束日期">
|
<el-date-picker v-model="query.HEndDate" type="date" placeholder="结束日期" style="width:160px" :disabled="timeCycleDisabled" value-format="yyyy-MM-dd" format="yyyy-MM-dd"/>
|
</el-form-item>
|
<el-form-item label="单据号">
|
<el-input v-model="query.HBillNo" style="width:160px" />
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" icon="el-icon-search" @click="onSearch">查询</el-button>
|
<el-button @click="onReset">重置</el-button>
|
</el-form-item>
|
<el-form-item style="margin-left:12px">
|
<div v-if="currentFilterName" style="color:#fc9393;font-weight:600">当前过滤方案:{{ currentFilterName }}</div>
|
</el-form-item>
|
</el-form>
|
|
<el-form :model="query" ref="filterForm">
|
<el-collapse v-model="activeCollapse" class="filter-collapse">
|
<el-collapse-item title="更多" name="more">
|
<el-row :gutter="12">
|
<el-col :span="8">
|
<el-form-item label="部门">
|
<el-input v-model="query.HDeptID" style="width:190px" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="8">
|
<el-form-item label="物料代码">
|
<el-input v-model="query.MaterialCode" style="width:190px" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="8">
|
<el-form-item label="物料名称">
|
<el-input v-model="query.MaterialName" style="width:190px" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="8">
|
<el-form-item label="规格型号">
|
<el-input v-model="query.SpecificationModel" style="width:190px" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="8">
|
<el-form-item label="源单单号">
|
<el-input v-model="query.HSourceBillNo" style="width:190px" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="8">
|
<el-form-item label="仓库">
|
<el-input v-model="query.Warehouse" style="width:190px" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="8">
|
<el-form-item label="制单人">
|
<el-input v-model="query.Hmaker" style="width:190px" />
|
</el-form-item>
|
</el-col>
|
</el-row>
|
|
<el-row :gutter="12" style="margin-top: 12px;">
|
<el-col :span="24">
|
<el-row :gutter="12" style="margin-bottom: 10px;">
|
<el-col :span="6">
|
<el-form-item label="过滤">
|
<el-select v-model="query.ColName" style="width:190px">
|
<!-- <el-option value="0" label=""></el-option> -->
|
<el-option v-for="col in filterColumns" :key="col.field" :value="col.field" :label="col.title" />
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-select v-model="query.Comparator" style="width:190px">
|
<!-- <el-option value="0" label=""></el-option> -->
|
<el-option value="=" label="=" />
|
<el-option value=">=" label=">=" />
|
<el-option value=">" label=">" />
|
<el-option value="<=" label="<=" />
|
<el-option value="<" label="<" />
|
<el-option value="<>" label="<>" />
|
<el-option value="7" label="包含" />
|
<el-option value="8" label="左包含" />
|
<el-option value="9" label="右包含" />
|
<el-option value="10" label="不包含" />
|
</el-select>
|
</el-col>
|
<el-col :span="6">
|
<el-input v-model="query.ColContent" placeholder="过滤内容" />
|
</el-col>
|
</el-row>
|
|
<el-row :gutter="12" style="margin-bottom: 10px;">
|
<el-col :span="6">
|
<el-form-item label="过滤1">
|
<el-select v-model="query.ColName1" style="width:190px">
|
<el-option value="0" label=""></el-option>
|
<el-option v-for="col in filterColumns" :key="col.field" :value="col.field" :label="col.title" />
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-select v-model="query.Comparator1" style="width:190px">
|
<!-- <el-option value="0" label=""></el-option> -->
|
<el-option value="=" label="=" />
|
<el-option value=">=" label=">=" />
|
<el-option value=">" label=">" />
|
<el-option value="<=" label="<=" />
|
<el-option value="<" label="<" />
|
<el-option value="<>" label="<>" />
|
<el-option value="7" label="包含" />
|
<el-option value="8" label="左包含" />
|
<el-option value="9" label="右包含" />
|
<el-option value="10" label="不包含" />
|
</el-select>
|
</el-col>
|
<el-col :span="6">
|
<el-input v-model="query.ColContent1" placeholder="过滤内容" />
|
</el-col>
|
</el-row>
|
|
<el-row :gutter="12">
|
<el-col :span="6">
|
<el-form-item label="过滤2">
|
<el-select v-model="query.ColName2" style="width:190px">
|
<el-option value="0" label=""></el-option>
|
<el-option v-for="col in filterColumns" :key="col.field" :value="col.field" :label="col.title" />
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-select v-model="query.Comparator2" style="width:190px">
|
<!-- <el-option value="0" label=""></el-option> -->
|
<el-option value="=" label="=" />
|
<el-option value=">=" label=">=" />
|
<el-option value=">" label=">" />
|
<el-option value="<=" label="<=" />
|
<el-option value="<" label="<" />
|
<el-option value="<>" label="<>" />
|
<el-option value="7" label="包含" />
|
<el-option value="8" label="左包含" />
|
<el-option value="9" label="右包含" />
|
<el-option value="10" label="不包含" />
|
</el-select>
|
</el-col>
|
<el-col :span="6">
|
<el-input v-model="query.ColContent2" placeholder="过滤内容" />
|
</el-col>
|
</el-row>
|
</el-col>
|
</el-row>
|
</el-collapse-item>
|
</el-collapse>
|
</el-form>
|
|
<el-row style="margin-bottom:8px">
|
<el-col>
|
<el-button size="mini" type="primary" @click="handleAdd">新增</el-button>
|
<el-button size="mini" @click="handleEdit">编辑</el-button>
|
<el-button size="mini" type="danger" @click="set_DeleteBill">删除</el-button>
|
<el-button size="mini" @click="set_CheckBill(1)">审核</el-button>
|
<el-button size="mini" @click="set_CheckBill(2)">反审核</el-button>
|
<el-button size="mini" @click="set_CloseBill(1)">关闭</el-button>
|
<el-button size="mini" @click="set_CloseBill(2)">反关闭</el-button>
|
<el-button size="mini" @click="set_DropBill(1)">作废</el-button>
|
<el-button size="mini" @click="set_DropBill(2)">反作废</el-button>
|
<el-button size="mini" @click="get_ViewReport">预览</el-button>
|
<el-button size="mini" @click="get_PrintReport">打印</el-button>
|
<el-button size="mini" @click="get_Refresh">刷新</el-button>
|
<el-button size="mini" @click="get_BarCodeDetail">条码明细</el-button>
|
<el-button type="primary" icon="el-icon-printer" size="mini" :disabled="single" @click="get_PackStockDetail">包装容器出入库明细</el-button>
|
</el-col>
|
</el-row>
|
|
<el-table
|
:data="tableData"
|
stripe
|
border
|
style="width:100%"
|
@row-click="onRowClick"
|
@selection-change="onSelectionChange"
|
:loading="loading"
|
ref="mainTable"
|
>
|
<el-table-column type="selection" width="55" />
|
<el-table-column v-for="(col, idx) in tableColumns" :key="idx" :prop="col.field" :label="col.title" :width="col.width" :formatter="col.formatter">
|
<template v-if="col.field === '单据号'" #default="scope">
|
<span style="color: blue; cursor: pointer;" @click="onBillNoClick(scope.row)">{{ scope.row.单据号 }}</span>
|
</template>
|
</el-table-column>
|
</el-table>
|
|
<el-pagination style="margin-top:12px" background layout="total, sizes, prev, pager, next, jumper" :total="total" :page-size.sync="pageSize" :current-page.sync="page" @current-change="pageChange" @size-change="sizeChange" :page-sizes="[50,500,5000,20000]" />
|
</el-card>
|
|
<FbStepFoldinBillEdit
|
:visible.sync="editDialogVisible"
|
:operation-type="operationType"
|
:linterid="currentId"
|
@saved="handleSaved"
|
@closed="handleClosed"
|
/>
|
<BarCodeDetail
|
:visible.sync="barcodeDetailVisible"
|
ref="barcodeDetail"
|
/>
|
<PackStockDetail :visible.sync="packStockDetailShow" ref="packStockDetail"/>
|
|
</div>
|
</template>
|
|
<script>
|
import axios from 'axios';
|
//import FbStepFoldinBillEdit from './fbStepFoldinBillEdit'
|
import FbStepFoldinBillEdit from '@/views/FbStepFoldOutBillList/fbStepFoldOutBillListEdit'
|
import BarCodeDetail from '@/views/component/BarCodeDetail'
|
import dayjs from 'dayjs';
|
import PackStockDetail from '@/views/component/PackStockDetail'
|
|
export default {
|
name: 'FbStepFoldinBillList',
|
components: {
|
FbStepFoldinBillEdit,
|
BarCodeDetail,PackStockDetail
|
|
},
|
data() {
|
return {
|
rowForm: {},
|
editDialogVisible:false,
|
operationType:'1',
|
currentId : '',
|
barcodeDetailVisible: false,// 条码明细弹窗显示控制
|
packStockDetailShow:false,
|
query: {
|
HInitTimeCycle: 29,
|
HBeginDate: '',
|
HEndDate: '',
|
HBillNo: '',
|
HDeptID: '',
|
MaterialCode: '',
|
MaterialName: '',
|
SpecificationModel: '',
|
HSourceBillNo: '',
|
Warehouse: '',
|
Hmaker: '',
|
ColName: '',
|
Comparator: '',
|
ColContent: '',
|
ColName1: '',
|
Comparator1: '',
|
ColContent1: '',
|
ColName2: '',
|
Comparator2: '',
|
ColContent2: ''
|
},
|
timeCycles: [
|
{ value: -1, label: '任意间隔' },
|
{ value: 0, label: '今天' },
|
{ value: 1, label: '近两天' },
|
{ value: 2, label: '近三天' },
|
{ value: 3, label: '近四天' },
|
{ value: 4, label: '近五天' },
|
{ value: 5, label: '近六天' },
|
{ value: 6, label: '近七天' },
|
{ value: 29, label: '近30天' },
|
{ value: 180, label: '近半年' },
|
{ value: 365, label: '近一年' }
|
],
|
timeCycleDisabled: false,
|
tableColumns: [],
|
filterColumns: [],
|
tableData: [],
|
loading: false,
|
page: 1,
|
pageSize: 50,
|
total: 0,
|
selectedRows: [],
|
currentFilterName: '',
|
activeCollapse: [],
|
baseURL: process.env.VUE_APP_BASE_API,
|
};
|
},
|
created() {
|
this.set_ClearBill();
|
},
|
methods: {
|
// 初始化
|
set_ClearBill() {
|
this.setSelect_HInitTimeCycle();
|
this.setDatesByCycle();
|
this.set_InitGrid();
|
this.ColFilter();
|
this.get_DefaultModule();
|
},
|
setSelect_HInitTimeCycle() {
|
this.query.HInitTimeCycle = 29;
|
},
|
setDatesByCycle() {
|
const end = new Date();
|
const start = new Date();
|
const cycle = this.query.HInitTimeCycle;
|
|
if (cycle === -1) {
|
// 任意间隔,不清空日期
|
this.timeCycleDisabled = false;
|
return;
|
}
|
|
start.setDate(start.getDate() - (cycle >= 0 ? cycle : 0));
|
this.query.HBeginDate = this.formatDate(start);
|
this.query.HEndDate = this.formatDate(end);
|
this.timeCycleDisabled = this.query.HInitTimeCycle !== -1;
|
},
|
formatDate(d) {
|
if (!d) return '';
|
const yyyy = d.getFullYear();
|
const mm = String(d.getMonth() + 1).padStart(2, '0');
|
const dd = String(d.getDate()).padStart(2, '0');
|
|
return `${yyyy}-${mm}-${dd}`;
|
},
|
onTimeCycleChange() {
|
this.setDatesByCycle();
|
if (this.query.HInitTimeCycle !== -1) {
|
this.onSearch();
|
}
|
},
|
set_InitGrid() {
|
this.tableColumns = [];
|
this.tableData = [];
|
},
|
// 新增
|
handleAdd() {
|
this.operationType = '1'
|
this.currentId = ''
|
this.editDialogVisible = true
|
},
|
// 编辑
|
handleEdit(row) {
|
let target = row;
|
console.log('传入的行对象:', target);
|
// 如果没有传入行对象,则使用当前选中的第一行
|
if (!target) {
|
if (this.selectedRows.length !== 1) {
|
this.$message.warning('请选择一行数据!');
|
return;
|
}
|
|
}
|
target = this.selectedRows[0];
|
this.operationType = '3';
|
this.currentId = this.selectedRows[0].hmainid || target.HInterID || target.HItemID || '';
|
console.log('传入的主id:', this.currentId);
|
this.editDialogVisible = true;
|
},
|
|
// 保存成功回调
|
handleSaved() {
|
this.get_Display('');
|
this.$message.success('操作成功')
|
},
|
handleClosed() {
|
this.editDialogVisible = false,
|
this.currentId = ''
|
},
|
onSearch() {
|
const sWhereParts = [];
|
const q = this.query;
|
|
const buildComparator = (col, cmp, content) => {
|
if (!col || !cmp || cmp === '0' || !content) return '';
|
let com = '';
|
switch (cmp) {
|
case '7': com = `like '%${content}%'`; break;
|
case '8': com = `like '%${content}'`; break;
|
case '9': com = `like '${content}%'`; break;
|
case '10': com = `not like '%${content}%'`; break;
|
default: com = `${cmp} '${content}'`; break;
|
}
|
return ` and ${col} ${com}`;
|
};
|
|
if (q.ColName && q.Comparator && q.Comparator !== '0' && q.ColContent)
|
sWhereParts.push(buildComparator(q.ColName, q.Comparator, q.ColContent));
|
if (q.ColName1 && q.Comparator1 && q.Comparator1 !== '0' && q.ColContent1)
|
sWhereParts.push(buildComparator(q.ColName1, q.Comparator1, q.ColContent1));
|
if (q.ColName2 && q.Comparator2 && q.Comparator2 !== '0' && q.ColContent2)
|
sWhereParts.push(buildComparator(q.ColName2, q.Comparator2, q.ColContent2));
|
|
if (q.HBeginDate) sWhereParts.push(` and CONVERT(varchar(100),日期, 23) >= '${dayjs(q.HBeginDate).format("YYYY-MM-DD")}'`);
|
if (q.HEndDate) sWhereParts.push(` and CONVERT(varchar(100),日期, 23) <= '${dayjs(q.HEndDate).format("YYYY-MM-DD")}'`);
|
if (q.HBillNo) sWhereParts.push(` and 单据号 like '%${q.HBillNo}%'`);
|
if (q.HDeptID) sWhereParts.push(` and 部门 like '%${q.HDeptID}%'`);
|
if (q.MaterialCode) sWhereParts.push(` and 物料代码 like '%${q.MaterialCode}%'`);
|
if (q.MaterialName) sWhereParts.push(` and 物料名称 like '%${q.MaterialName}%'`);
|
if (q.SpecificationModel) sWhereParts.push(` and 规格型号 like '%${q.SpecificationModel}%'`);
|
if (q.HSourceBillNo) sWhereParts.push(` and 源单单号 like '%${q.HSourceBillNo}%'`);
|
if (q.Warehouse) sWhereParts.push(` and 仓库名称 like '%${q.Warehouse}%'`);
|
if (q.Hmaker) sWhereParts.push(` and 制单人 like '%${q.Hmaker}%'`);
|
|
const sWhere = sWhereParts.join('');
|
this.get_Display(sWhere);
|
},
|
onReset() {
|
this.query = {
|
HInitTimeCycle: 29,
|
HBeginDate: '',
|
HEndDate: '',
|
HBillNo: '',
|
HDeptID: '',
|
MaterialCode: '',
|
MaterialName: '',
|
SpecificationModel: '',
|
HSourceBillNo: '',
|
Warehouse: '',
|
Hmaker: '',
|
ColName: '0', Comparator: '0', ColContent: '',
|
ColName1: '0', Comparator1: '0', ColContent1: '',
|
ColName2: '0', Comparator2: '0', ColContent2: ''
|
};
|
this.setDatesByCycle();
|
this.get_Display('');
|
},
|
async get_Display(sWhere) {
|
this.loading = true;
|
try {
|
const userName = sessionStorage['HUserName'] || sessionStorage['Czybm'] || 'admin';
|
const orgName = sessionStorage['OrganizationName'] || sessionStorage['Organization'] || '浙江智云迈思';
|
|
const url = `${this.baseURL}/Kf_StepFoldOutBill/GetStepFoldOutBillList`;
|
const params = {
|
sWhere: sWhere || '',
|
user: userName,
|
//Organization: orgName
|
};
|
|
const resp = await axios.get(url, { params });
|
const data1 = resp.data;
|
|
if (data1.count === 1) {
|
const colDefs = [];
|
const filterCols = [];
|
|
for (let i = 0; i < data1.list.length; i++) {
|
const item = data1.list[i];
|
const name = item.ColmCols;
|
const type = item.ColmType;
|
|
const colDef = {
|
field: name,
|
title: name,
|
width: 200
|
};
|
|
if (type === 'DateTime') {
|
colDef.formatter = (row, col, cellValue) => this.formatDateTime(cellValue);
|
}
|
|
colDefs.push(colDef);
|
|
// 为过滤条件准备列选项(排除隐藏字段)
|
const hideFields = ['hmainid', 'HMaterID', 'HUnitID', 'HICMOEmpID', 'HWHID', '单据ID', '单据类型', 'HDeptID', '部门代码', 'Hunitid',
|
'计量单位代码', '调入仓库代码', 'HSPID', '调入仓位代码', 'HSCWHID', '调出仓位代码', '调出仓库代码', 'HSCSPID', 'HSecManagerID', 'HKeeperID'];
|
|
if (!hideFields.includes(name)) {
|
filterCols.push(colDef);
|
}
|
}
|
|
this.tableColumns = colDefs;
|
this.filterColumns = filterCols;
|
this.tableData = data1.data || [];
|
this.total = data1.count || this.tableData.length;
|
} else {
|
this.$alert((data1.Message || '获取数据异常'), '错误');
|
}
|
} catch (err) {
|
console.error('请求失败:', err);
|
this.$message.error(`接口请求失败: ${err.message}`);
|
} finally {
|
this.loading = false;
|
}
|
},
|
formatDateTime(value) {
|
if (!value) return '';
|
try {
|
const d = new Date(value);
|
return d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0') + ' ' + String(d.getHours()).padStart(2, '0') + ':' + String(d.getMinutes()).padStart(2, '0') + ':' + String(d.getSeconds()).padStart(2, '0');
|
} catch (e) {
|
return value;
|
}
|
},
|
ColFilter() {
|
},
|
async get_DefaultModule() {
|
try {
|
const url = `${this.baseURL}/Xt_FastICScheme/Chooselist`;
|
const params = {
|
user: sessionStorage['Czybm'] || sessionStorage['HUserName'] || '',
|
HModuleName: '分步式调出单维护',
|
HInterID: 0,
|
Type: 'Default'
|
};
|
const resp = await axios.get(url, { params });
|
if (resp.data.count == 1) {
|
const data = resp.data.data;
|
this.currentFilterName = data[0].方案名称 || '';
|
this.onSearch();
|
} else {
|
this.currentFilterName = '';
|
this.onSearch();
|
}
|
} catch (err) {
|
console.warn('获取默认过滤方案失败', err);
|
this.onSearch();
|
}
|
},
|
set_AddNew() {
|
window.open('./Fb_StepFoldinBillEdit.html?OperationType=1&linterid=&HSouceBillType=0&closeType=1', '_blank');
|
},
|
set_ShowBill() {
|
if (this.selectedRows.length !== 1) {
|
this.$message.warning('请选择一行数据编辑!');
|
return;
|
}
|
const id = this.selectedRows[0].hmainid || this.selectedRows[0].HItemID;
|
window.open('./Fb_StepFoldinBillEdit.html?OperationType=3&linterid=' + id, '_blank');
|
},
|
async set_DeleteBill() {
|
if (this.selectedRows.length !== 1) {
|
this.$message.warning('请选择一行数据删除!');
|
return;
|
}
|
const row = this.selectedRows[0];
|
if (row.状态 && row.状态 !== '创建') {
|
this.$message.warning('此数据不是创建状态,无法删除!');
|
return;
|
}
|
|
try {
|
await this.$confirm('确认要删除吗,删除后不能恢复', '删除确认');
|
const url = `${this.baseURL}/Fb_StepFoldInBill/DeltetFb_StepFoldInBill`;
|
const params = { HInterID: (row.hmainid || row.HInterID) };
|
const resp = await axios.get(url, { params });
|
|
if (resp.data.count == 1) {
|
this.$message.success(resp.data.Message || '删除成功');
|
this.onSearch();
|
} else {
|
this.$alert((resp.data.Message || '删除失败'), '错误');
|
}
|
} catch (err) {
|
if (err !== 'cancel') {
|
this.$message.error('接口请求失败');
|
}
|
}
|
},
|
// 审核/反审核功能
|
async set_CheckBill(type) {
|
if (this.selectedRows.length !== 1) {
|
this.$message.warning('请选择一行数据操作!');
|
return;
|
}
|
|
const row = this.selectedRows[0];
|
const actionName = type === 1 ? '审核' : '反审核';
|
|
try {
|
await this.$confirm(`确认要${actionName}此单据吗?`, `${actionName}确认`);
|
|
const url = `${this.baseURL}/Kf_StepFoldOutBill/AuditKf_StepFoldOutBill`;
|
const params = {
|
HInterID: (row.hmainid || row.HInterID),
|
Type: type,
|
user: sessionStorage['HUserName'] || ''
|
};
|
|
const resp = await axios.get(url, { params });
|
if (resp.data.count == 1) {
|
this.$message.success(resp.data.Message || `${actionName}成功`);
|
this.onSearch();
|
} else {
|
this.$alert((resp.data.Message || `${actionName}失败`), '错误');
|
}
|
} catch (err) {
|
if (err !== 'cancel') {
|
this.$message.error('接口请求失败');
|
}
|
}
|
},
|
// 关闭/反关闭功能
|
async set_CloseBill(type) {
|
if (this.selectedRows.length !== 1) {
|
this.$message.warning('请选择一行数据操作!');
|
return;
|
}
|
|
const row = this.selectedRows[0];
|
const actionName = type === 1 ? '关闭' : '反关闭';
|
|
try {
|
await this.$confirm(`确认要${actionName}此单据吗?`, `${actionName}确认`);
|
|
const url = `${this.baseURL}/Kf_StepFoldOutBill/CloseKf_StepFoldOutBill`;
|
const params = {
|
HInterID: (row.hmainid || row.HInterID),
|
Type: type,
|
user: sessionStorage['HUserName'] || ''
|
};
|
|
const resp = await axios.get(url, { params });
|
if (resp.data.count == 1) {
|
this.$message.success(resp.data.Message || `${actionName}成功`);
|
this.onSearch();
|
} else {
|
this.$alert((resp.data.Message || `${actionName}失败`), '错误');
|
}
|
} catch (err) {
|
if (err !== 'cancel') {
|
this.$message.error('接口请求失败');
|
}
|
}
|
},
|
// 作废/反作废功能
|
async set_DropBill(type) {
|
if (this.selectedRows.length !== 1) {
|
this.$message.warning('请选择一行数据操作!');
|
return;
|
}
|
|
const row = this.selectedRows[0];
|
const actionName = type === 1 ? '作废' : '反作废';
|
|
try {
|
await this.$confirm(`确认要${actionName}此单据吗?`, `${actionName}确认`);
|
|
const url = `${this.baseURL}/Kf_StepFoldOutBill/CancellKf_StepFoldOutBill`;
|
const params = {
|
HInterID: (row.hmainid || row.HInterID),
|
Type: type,
|
user: sessionStorage['HUserName'] || ''
|
};
|
|
const resp = await axios.get(url, { params });
|
if (resp.data.count == 1) {
|
this.$message.success(resp.data.Message || `${actionName}成功`);
|
this.onSearch();
|
} else {
|
this.$alert((resp.data.Message || `${actionName}失败`), '错误');
|
}
|
} catch (err) {
|
if (err !== 'cancel') {
|
this.$message.error('接口请求失败');
|
}
|
}
|
},
|
onRowClick(row) {
|
this.$nextTick(() => {
|
const table = this.$refs.mainTable;
|
if (!table) return;
|
table.toggleRowSelection(row);
|
});
|
},
|
onSelectionChange(selection) {
|
this.selectedRows = selection;
|
this.ids = selection.map(item => item.hmainid)
|
console.log('选择的行:', selection,"选择的ids:",this.ids);
|
if (selection.length > 0)
|
this.rowForm = selection[0]
|
},
|
onBillNoClick(row) {
|
const table = this.$refs.mainTable;
|
if (table) {
|
try {
|
table.clearSelection();
|
table.toggleRowSelection(row, true);
|
} catch (e) {
|
if (table.setCurrentRow) table.setCurrentRow(row);
|
}
|
}
|
this.selectedRows = [row];
|
this.operationType = '3';
|
this.currentId = row.hmainid || row.HInterID || row.HItemID || '';
|
this.editDialogVisible = true;
|
},
|
get_BarCodeDetail() {
|
if (this.selectedRows.length !== 1) {
|
this.$message.warning('请选择一行数据查看条码明细!')
|
return
|
}
|
|
this.barcodeDetailVisible = true
|
this.$nextTick(() => {
|
this.$refs.barcodeDetail.open(this.selectedRows[0])
|
})
|
},
|
//#region 包装容器出入库明细
|
get_PackStockDetail() {
|
// if (this.selectedRow.length !== 1) {
|
// this.$message.warning('请选择一行数据查看条码明细!')
|
// return
|
// }
|
this.packStockDetailShow = true
|
this.$nextTick(() => {
|
this.$refs.packStockDetail.open(this.rowForm)
|
})
|
},
|
//#endregion
|
get_ViewReport() {
|
if (this.selectedRows.length !== 1) {
|
this.$message.warning('请选择一行数据打印!');
|
return;
|
}
|
const id = this.selectedRows[0].hmainid;
|
window.open('../../BaseSet/SRM_OpenTmpList.html?linterid=' + id + '&MyMsg=' + id + '&Type=HMouldProdOutBill', '_blank');
|
},
|
get_PrintReport() {
|
if (this.selectedRows.length === 0) {
|
this.$message.warning('请选择数据打印!');
|
return;
|
}
|
const hmainid = this.selectedRows.map(r => (r.hmainid * (10 ** 8)) + (r.hsubid || 0)).toString();
|
window.open('../../BaseSet/SRM_OpenTmpList.html?linterid=' + hmainid + '&MyMsg=' + hmainid + '&Type=HSeOutStockBillList', '_blank');
|
},
|
get_Refresh() {
|
this.onReset();
|
},
|
pageChange(val) {
|
this.page = val;
|
this.onSearch();
|
},
|
sizeChange(val) {
|
this.pageSize = val;
|
this.onSearch();
|
}
|
}
|
};
|
</script>
|
|
<style scoped>
|
.mb8 { margin-bottom: 8px }
|
.filter-collapse {
|
margin-bottom: 12px;
|
}
|
:deep(.el-collapse-item__header) {
|
font-weight: bold;
|
background-color: #f5f7fa;
|
padding: 0 12px;
|
}
|
</style>
|