emis-frontend/src/views/emis/emisWaybillDeclareGoods/index.vue

368 lines
13 KiB
Vue
Raw Normal View History

2025-01-02 13:15:45 +00:00
<template>
2025-01-03 02:01:33 +00:00
<XdPageContainer class="app-container">
<SearchForm slot="pageHeader" :model="queryParams" ref="queryForm" size="mini" :maxShow="9" label-width="80px" v-show="showSearch" @search="handleQuery" @reset="resetQuery">
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
<el-col :span="9">
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
<el-col :span="24">
<el-form-item label="" prop="billCode">
<div slot="label">
<el-radio-group class="query-label" v-model="queryOrderType">
<el-radio :key="1" label="1">运单号</el-radio>
<!-- <el-radio :key="0" label="0">订单号</el-radio> -->
</el-radio-group>
</div>
<XdTextareaInput
v-model="queryParams.billCode"
:placeholder="$t('多个流水号逗号或换行隔开')"
clearable
:rows="2"
/>
<!-- -->
</el-form-item>
</el-col>
<!-- <el-col :span="24">
<el-form-item label="查询时间范围" prop="">
<div slot="label">
<el-radio-group class="query-label" v-model="queryOrderDateType">
<el-radio :key="1" label="1">发货时间</el-radio>
</el-radio-group>
</div>
<elDateAdvPicker v-model="dateRange" ></elDateAdvPicker>
</el-form-item>
</el-col> -->
</el-row>
</el-col>
</el-row>
2025-01-02 13:15:45 +00:00
</SearchForm>
2025-01-03 02:01:33 +00:00
<XdTable
slot="pageContent"
slot-scope="slotProps"
:height="(slotProps.contentHeight)+'px'"
ref="refTable"
v-loading="loading"
2025-01-02 13:15:45 +00:00
border stripe
size="small"
:data="emisWaybillDeclareGoodsList"
:showSearch.sync="showSearch"
:queryParams="queryParams"
:total="total"
@queryTable="getList"
@selection-change="handleSelectionChange"
@sort-change="handleSortChange"
>
2025-01-03 02:01:33 +00:00
2025-01-02 13:15:45 +00:00
<div slot="toolbar">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
2025-01-03 02:01:33 +00:00
v-hasPermi="['emis:emisWaybillCargo:add']"
>新增资料</el-button>
2025-01-02 13:15:45 +00:00
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
2025-01-03 02:01:33 +00:00
>修改资料</el-button>
</el-col>
2025-01-02 13:15:45 +00:00
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
2025-01-03 02:01:33 +00:00
<el-col :span="1.5">
2025-01-02 13:15:45 +00:00
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
2025-01-03 02:01:33 +00:00
</el-col>
2025-01-02 13:15:45 +00:00
</el-row>
</div>
2025-01-03 02:01:33 +00:00
<el-table-column type="selection" width="55" align="center" />
<el-table-column :label="$t('运单号')" align="center" prop="billCode" min-width="150" />
<!-- <el-table-column :label="$t('货物编码')" align="center" prop="goodsCode" min-width="100" /> -->
2025-01-02 13:15:45 +00:00
<el-table-column :label="$t('货物名称')" align="center" prop="goodsName" min-width="100" />
2025-01-03 02:01:33 +00:00
<el-table-column :label="$t('数量')" align="center" prop="cargoQty" min-width="100" />
<!-- <el-table-column :label="$t('异常数量')" align="center" prop="abnormalQty" min-width="100" /> -->
<!-- <el-table-column :label="$t('单位')" align="center" prop="unit" min-width="100" /> -->
<!-- <el-table-column :label="$t('重量')" align="center" prop="weight" min-width="100" /> -->
<el-table-column :label="$t('单价')" align="center" prop="price" min-width="100" />
<!-- <el-table-column :label="$t('货物币种')" align="center" prop="currency" min-width="100" /> -->
2025-01-02 13:15:45 +00:00
<el-table-column :label="$t('原产国')" align="center" prop="nationArea" min-width="100" />
2025-01-03 02:01:33 +00:00
<!-- <el-table-column :label="$t('海关编码')" align="center" prop="hscode" min-width="100" /> -->
2025-01-02 13:15:45 +00:00
<el-table-column :label="$t('品牌')" align="center" prop="brand" min-width="100" />
<el-table-column :label="$t('材质')" align="center" prop="material" min-width="100" />
<el-table-column :label="$t('用途')" align="center" prop="purpose" min-width="100" />
<el-table-column :label="$t('成分')" align="center" prop="ingredients" min-width="100" />
<el-table-column :label="$t('供应商')" align="center" prop="supplier" min-width="100" />
<el-table-column :label="$t('功能')" align="center" prop="function" min-width="100" />
2025-01-03 02:01:33 +00:00
<el-table-column :label="$t('规格')" align="center" prop="goodsModel" min-width="100" />
<el-table-column :label="$t('尺寸')" align="center" prop="length" min-width="170" :show-overflow-tooltip="true">
<template slot-scope="scope">
<div >{{scope.row.length}}cm*{{scope.row.width}}cm*{{scope.row.height}}cm</div>
</template>
2025-01-02 13:15:45 +00:00
</el-table-column>
2025-01-03 02:01:33 +00:00
<el-table-column :label="$t('创建时间')" align="center" prop="createTime" width="170" :show-overflow-tooltip="true"/>
2025-01-02 13:15:45 +00:00
</XdTable>
<el-dialog :title="titleForm" :visible.sync="openForm" width="50%" :destroy-on-close="true" v-dialogDrag append-to-body>
<emisWaybillDeclareGoodsForm :id="currentId" @on-changed="handleFormChanged" @on-cancel="cancelForm"></EmisWaybillDeclareGoodsForm>
</el-dialog>
2025-01-03 02:01:33 +00:00
2025-01-02 13:15:45 +00:00
<!--
<el-dialog :title="titleView" :visible.sync="openView" width="60%" :close-on-click-modal="false" v-dialogDrag append-to-body>
<emisWaybillDeclareGoodsView :id="id" ></EmisWaybillDeclareGoodsView>
</el-dialog>
-->
2025-01-03 02:01:33 +00:00
</XdPageContainer>
2025-01-02 13:15:45 +00:00
</template>
<script>
import { listEmisWaybillDeclareGoods, getEmisWaybillDeclareGoods, delEmisWaybillDeclareGoods, addEmisWaybillDeclareGoods, updateEmisWaybillDeclareGoods } from "@/api/emis/emisWaybillDeclareGoods";
import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
// import emisWaybillDeclareGoodsView from '@/views/emis/emisWaybillDeclareGoods/emisWaybillDeclareGoodsView';
import emisWaybillDeclareGoodsForm from '@/views/emis/emisWaybillDeclareGoods/emisWaybillDeclareGoodsForm';
export default {
2025-01-03 02:01:33 +00:00
name: "EmisWaybillDeclareGoods",
2025-01-02 13:15:45 +00:00
components: { elDateSimplePicker,emisWaybillDeclareGoodsForm },
dicts: [
],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 创建时间搜索
dateTimeRange:[],
// 总条数
total: 0,
// 申报物品表格数据
emisWaybillDeclareGoodsList: [],
2025-01-03 02:01:33 +00:00
2025-01-02 13:15:45 +00:00
currentId:null,
openForm: false,
titleForm: "",
// 弹出展示层
id:null,
titleView:"",
openView: false,
// 备注时间范围
daterangeCreateTime: [],
// 备注时间范围
daterangeUpdateTime: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
billCode: null,
goodsCode: null,
goodsName: null,
goodsModel: null,
grossWeight: null,
netWeight: null,
cargoQty: null,
abnormalQty: null,
unit: null,
weight: null,
price: null,
currency: null,
nationArea: null,
taxNo: null,
hscode: null,
brand: null,
material: null,
purpose: null,
ingredients: null,
manufacturer: null,
supplier: null,
function: null,
length: null,
height: null,
volume: null,
barcode: null,
orderNum: null,
delFlag: null,
remark: null
},
};
},
created() {
this.getList();
},
methods: {
/** 查询申报物品列表 */
getList() {
this.loading = true;
listEmisWaybillDeclareGoods(this.addDateRange(this.queryParams, this.dateTimeRange)).then(response => {
this.emisWaybillDeclareGoodsList = response.rows;
this.total = response.total;
this.loading = false;
});
},
2025-01-03 02:01:33 +00:00
2025-01-02 13:15:45 +00:00
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
// 排序 查询字段是表格中字段名字 动态取值排序顺序
handleSortChange(column) {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order;
this.getList();
},
/** 新增按钮操作 */
handleAdd(row) {
this.currentId=null;
this.openForm= true;
this.titleForm = "新增";
},
handleShowMoreInput(){
this.moreInputVisible = !this.moreInputVisible;
},
/** 修改按钮操作 */
handleUpdate(row) {
2025-01-03 02:01:33 +00:00
this.currentId= row.id|ids;
2025-01-02 13:15:45 +00:00
this.openForm = true;
this.titleForm = "修改";
},
handleView(row) {
this.id=row.id;
this.titleView="查看";
this.openView=true;
// this.router.push({ path: '/emis/emisWaybillDeclareGoods/viewDetail', query: { id: row.id }})
},
handleFormChanged(){
this.openForm = false;
this.getList();
},
cancelForm(){
this.openForm = false;
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除').then(function() {
return delEmisWaybillDeclareGoods(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
// this.download('emis/emisWaybillDeclareGoods/export', {
// ...this.queryParams
// }, `emisWaybillDeclareGoods_${new Date().getTime()}.xlsx`)
const loadingInstance = this.$loading({
text: '正在导出...'
})
var qParam = {...this.queryParams};
qParam.pageNum=1;
qParam.pageSize=5000;
listEmisWaybillDeclareGoods(this.addDateRange(qParam, this.dateTimeRange)).then(response => {
this.downloadLoading = false
if (response.code === 200) {
const curList = response.rows
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['id','运单id','运单编号','货物编码','货物名称','规格型号','毛重','净重','实际数量','异常数量','单位','重量','申报单价','申报币种','原产国','行邮税号','海关编码','品牌','材质','用途','成分','厂家','供应商','功能','长','宽','高','体积','条码','附加信息','排序','删除标志(0代表存在','创建者','创建时间','更新者','更新时间','备注',];
const filterVal = ['id','waybillId','billCode','goodsCode','goodsName','goodsModel','grossWeight','netWeight','cargoQty','abnormalQty','unit','weight','price','currency','nationArea','taxNo','hscode','brand','material','purpose','ingredients','manufacturer','supplier','function','length','width','height','volume','barcode','extraData','orderNum','delFlag','createBy','createTime','updateBy','updateTime','remark',];
const data = this.formatJson(filterVal, curList, response.rows)
excel.export_json_to_excel({
header: tHeader,
data,
filename: '申报物品',
autoWidth: true
})
loadingInstance.close()
})
}
});
},
formatJson(filterVal, jsonData, resData) {
let index = 0
return jsonData.map(v => filterVal.map(j => {
if (j === 'index') {
return ++index
}
if (j === 'status') {
var statusStr='xxx'
if(v[j] == 10){
statusStr='xxx'
}
return statusStr;
}
return v[j]
}))
},
/** 列索引函数 */
getIndex($index) {
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
},
/** 时间搜索响应函数 */
dateTimeChange(value){
this.dateTimeRange=value;
},
}
};
</script>
<style scoped>
.el-divider{
margin-top: 0px;
background: 0 0;
border-top: 1px solid #E6EBF5;
}
.el-divider__text {
color: #0955ee;
cursor: pointer;
}
</style>