123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337 |
- <template>
- <div class="app-container">
- <el-form
- :model="query"
- ref="queryForm"
- v-show="showSearch"
- :inline="true"
- >
- <el-row>
- <el-form-item label="提单号" prop="fMblno">
- <el-input
- v-model="query.fMblno"
- placeholder="请输入提单号"
- clearable
- size="small"
- @change="fMblnoChange"
- />
- </el-form-item>
- <el-form-item label="货主" prop="fCorpid">
- <el-select
- v-model="query.fCorpid"
- filterable
- clearable
- remote
- style="width: 80%"
- :remote-method="corpsRemoteMethod"
- placeholder="请输入模糊查找"
- >
- <el-option
- v-for="(dict, index) in fMblnoOptions"
- :key="index.fId"
- :label="dict.fName"
- :value="dict.fId"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="日期" prop="bsdateList">
- <el-date-picker
- v-model="query.bsdateList"
- type="daterange"
- range-separator="至"
- start-placeholder="开始日期"
- value-format="yyyy-MM-dd HH:mm:ss"
- :default-time="['00:00:00', '23:59:59']"
- end-placeholder="结束日期"
- :picker-options="pickerOptions"
- unlink-panels>
- </el-date-picker>
- </el-form-item>
- </el-row>
- </el-form>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="primary"
- icon="el-icon-plus"
- size="mini"
- @click="getList"
- v-hasPermi="['warehouseBusiness:containerPort:add']"
- >查询
- </el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="warning"
- icon="el-icon-download"
- size="mini"
- @click="exportOne"
- >导出
- </el-button>
- </el-col>
- <!-- <el-col :span="1.5">-->
- <!-- <el-button-->
- <!-- type="danger"-->
- <!-- icon="el-icon-delete"-->
- <!-- size="mini"-->
- <!-- :disabled="multiple"-->
- <!-- @click="handleDelete"-->
- <!-- v-hasPermi="['agreement:agreementTask:remove']"-->
- <!-- >删除-->
- <!-- </el-button>-->
- <!-- </el-col>-->
- <!-- <el-col :span="1.5">-->
- <!-- <el-button-->
- <!-- type="info"-->
- <!-- icon="el-icon-download"-->
- <!-- size="mini"-->
- <!-- :disabled="single"-->
- <!-- @click="handleUpdate(null, 2)"-->
- <!-- v-hasPermi="['agreement:agreementStorage:export']"-->
- <!-- >复制新增-->
- <!-- </el-button>-->
- <!-- </el-col>-->
- <right-toolbar
- :showSearch.sync="showSearch"
- @queryTable="getList"
- ></right-toolbar>
- </el-row>
- <el-form :inline="true" :model="formInline" class="demo-form-inline">
- <el-form-item label="提单号">
- <el-input v-model="query.fMblno" placeholder="提单号" disabled></el-input>
- </el-form-item>
- <el-form-item label="货主">
- <el-select
- v-model="query.fCorpid"
- filterable
- remote
- style="width: 80%"
- :remote-method="corpsRemoteMethod"
- placeholder="请输入模糊查找"
- disabled
- >
- <el-option
- v-for="(dict, index) in fMblnoOptions"
- :key="index.fId"
- :label="dict.fName"
- :value="dict.fId"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="品名">
- <el-input v-model="formInline.goodsName" placeholder="请输入品名" disabled></el-input>
- </el-form-item>
- </el-form>
- <el-table
- :data="tableData"
- style="width: 100%"
- ref="table1"
- :height="tableHeight1"
- >
- <el-table-column type="selection" width="60" align="center" />
- <el-table-column type="index" label="行号" align="center"/>
- <el-table-column prop="fBusinessType" label="作业类型" width="180" align="center"/>
- <el-table-column prop="fCntval" label="箱型箱量" width="180" align="center"/>
- <el-table-column prop="inBsdate" label="入库日期" width="180" align="center"/>
- <el-table-column prop="inQty" label="入库件数" width="180" align="center"/>
- <el-table-column prop="inGrossweight" label="入库毛重" width="180" align="center"/>
- <el-table-column prop="outBsdate" label="出库日期" width="180" align="center"/>
- <el-table-column prop="outQty" label="出库件数" width="180" align="center"/>
- <el-table-column prop="outGrossweight" label="出库毛重" width="180" align="center"/>
- <el-table-column prop="fQtyblc" label="结余件数" width="180" align="center"/>
- <el-table-column prop="fGrossweightblc" label="结余毛重" width="180" align="center"/>
- <el-table-column prop="fBilltype" label="业务类型" width="180" align="center"/>
- <el-table-column prop="remark" label="备注" width="180" align="center"/>
- </el-table>
- <h3>
- <i class="el-icon-coin"></i>费用明细
- <el-button
- type="warning"
- icon="el-icon-download"
- size="mini"
- @click="exportTwo"
- >导出
- </el-button>
- </h3>
- <el-table
- :data="costData"
- style="width: 100%"
- ref="table2"
- :height="tableHeight2"
- >
- <el-table-column type="selection" width="60" align="center" />
- <el-table-column type="index" label="行号" align="center"/>
- <el-table-column prop="createTime" label="日期" width="180" align="center"/>
- <el-table-column prop="fBusinessType" label="作业类型" width="180" align="center"/>
- <el-table-column prop="fFeeid" label="费用" width="180" align="center"/>
- <el-table-column prop="fQty" label="数量" align="center"/>
- <el-table-column prop="fUnitprice" label="单价" align="center"/>
- <el-table-column prop="fAmount" label="金额" align="center"/>
- <el-table-column prop="remark" label="备注" align="center"/>
- </el-table>
- </div>
- </template>
- <script>
- import { listpayable , exportOne , exportTwo, getCorps} from '@/api/singleTicket'
- import {listCorps} from "@/api/basicdata/corps";
- export default {
- name: "index",
- data(){
- return{
- pickerOptions: {
- shortcuts: [{
- text: '最近一周',
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: '最近一个月',
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: '最近三个月',
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
- picker.$emit('pick', [start, end]);
- }
- }]
- },
- tableHeight1: '0',
- tableHeight2: '0',
- query:{},
- costData:[],
- formInline:{},
- tableData:[],
- showSearch: true,
- fMblnoOptions:[]
- }
- },
- created() {
- // let date = new Date();
- // let year = parseInt(date.getFullYear())
- // let month = parseInt(date.getMonth() + 1)
- // let currentMonth = date.getMonth()
- // let nextMonth = ++currentMonth
- // let nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1) // 下个月的第一天
- // let oneDay = 1000*60*60*24
- // let lastTime = new Date(nextMonthFirstDay - oneDay) // 下个月的第一天减去一天,就是上个月的最后一天
- // let day = lastTime.getDate()
- // if (day < 10) {
- // day = '0' + day
- // }
- // this.$set(this.query,'bsdateList', [year + '-' + month + '-' + '01 00:00:00', year + '-' + month + '-' + day + ' 23:59:59'])
- },
- mounted() {
- this.$nextTick(() => {
- // 根据浏览器高度设置初始高度
- this.tableHeight1 = (window.innerHeight - this.$refs.table1.$el.offsetTop - 160) / 2
- // 监听浏览器高度变化,改变表格高度
- window.onresize = () => {
- this.tableHeight1 = (window.innerHeight - this.$refs.table1.$el.offsetTop - 70) /2
- }
- });
- this.$nextTick(() => {
- // 根据浏览器高度设置初始高度
- this.tableHeight2 = (window.innerHeight - this.$refs.table1.$el.offsetTop - 160) / 2
- // 监听浏览器高度变化,改变表格高度
- window.onresize = () => {
- this.tableHeight2 = (window.innerHeight - this.$refs.table1.$el.offsetTop - 70) /2
- }
- })
- },
- methods:{
- getList(){
- listpayable(this.query).then(res=>{
- this.costData = res.data.feeList
- this.tableData = res.data.singleAnalysis
- for (let item in this.tableData){
- if (this.tableData[item].inQty == 0){
- this.tableData[item].inQty = ''
- }
- if (this.tableData[item].inGrossweight == 0){
- this.tableData[item].inGrossweight = ''
- }
- if (this.tableData[item].outGrossweight == 0){
- this.tableData[item].outGrossweight = ''
- }
- if (this.tableData[item].fQtyblc == 0){
- this.tableData[item].fQtyblc = ''
- }
- if (this.tableData[item].fGrossweightblc == 0){
- this.tableData[item].fGrossweightblc = ''
- }
- if (this.tableData[item].outQty == 0){
- this.tableData[item].outQty = ''
- }
- }
- this.formInline.goodsName = res.data.goodsName
- })
- },
- exportOne(){
- let query = this.query
- this.$confirm("是否确认导出", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(function () {
- return exportOne(query);
- }).then((response) => {
- this.download(response.msg);
- });
- },
- exportTwo(){
- let query = this.query
- this.$confirm("是否确认导出", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(function () {
- return exportTwo(query);
- }).then((response) => {
- this.download(response.msg);
- });
- },
- corpsRemoteMethod(name) {
- if (this.query.fMblno) return
- if (name == null || name === "") {
- return false;
- }
- let queryParams = { pageNum: 1, fName: name, type: 1 };
- listCorps(queryParams).then((response) => {
- this.fMblnoOptions = response.rows;
- });
- },
- resetQuery(){},
- // 提单号变化触发
- fMblnoChange() {
- this.$set(this.query, 'fCorpid', '')
- if (this.query.fMblno) {
- getCorps({fMblno: this.query.fMblno}).then(res => {
- this.fMblnoOptions = res.data;
- if (this.fMblnoOptions.length > 0) this.query.fCorpid = this.fMblnoOptions[0].fId
- })
- } else {
- listCorps({type: 1}).then((response) => {
- this.fMblnoOptions = response.rows;
- });
- }
- },
- }
- }
- </script>
- <style scoped>
- </style>
|