|
@@ -81,6 +81,7 @@
|
|
|
<ws-button v-if='list.length>0' @click="handlTask()">任务</ws-button>
|
|
|
<ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.add`" @click="outData(1)">导出</ws-button>
|
|
|
<ws-button @click="outData(2)">打印</ws-button>
|
|
|
+ <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.kan`" @click="exportHistoricalData()">导出历史库存记录</ws-button>
|
|
|
<ws-button @click="transformation()" v-hasPermission=" `warehouseManagement.warehouse.warehouseInfo.view`">折转</ws-button>
|
|
|
<ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.kan`" @click="handleall()">全部仓库</ws-button>
|
|
|
<ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.kan`" @click="handleMintor()">查看监控</ws-button>
|
|
@@ -251,6 +252,35 @@
|
|
|
<el-button @click="removePrint">取消</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="mask" v-show="isShowPrintType1"></div>
|
|
|
+ <div class="print-type" v-show="isShowPrintType1">
|
|
|
+ <div class="print-type-content">
|
|
|
+ <div class="print-type-title">{{headerText1}}</div>
|
|
|
+ <div class="print-type-checkbox">
|
|
|
+ <el-form ref="form" label-width="110px">
|
|
|
+ <el-form-item label="起始日期">
|
|
|
+ <el-date-picker value-format="yyyy-MM-dd" type="date" placeholder="请选择起始日期" v-model="parameter.startDate">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="截止日期">
|
|
|
+ <el-date-picker value-format="yyyy-MM-dd" type="date" placeholder="请选择截止日期" v-model="parameter.endDate">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <!--仓库名称-->
|
|
|
+ <el-form-item label="仓库名称" span="1" prop="warehouseName">
|
|
|
+ <el-select v-model="parameter.warehouseName" placeholder="请选择仓库名称" filterable clearable>
|
|
|
+ <el-option key="" label="全部仓库" value="全部仓库" />
|
|
|
+ <el-option v-for="item in warehouseAllXiaLa" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="bottom-btn">
|
|
|
+ <el-button @click="submitClick1()">确定</el-button>
|
|
|
+ <el-button @click="removePrint1">取消</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -259,6 +289,7 @@
|
|
|
getsponsible,
|
|
|
clearancee,
|
|
|
xiala,
|
|
|
+ exportHistoricalInventory,
|
|
|
postExport,
|
|
|
addselectinfoList,
|
|
|
printAdd,
|
|
@@ -332,6 +363,8 @@
|
|
|
},
|
|
|
isShowPrintType: false, //打印
|
|
|
headerText: '',
|
|
|
+ isShowPrintType1: false,
|
|
|
+ headerText1: '导出历史库存记录',
|
|
|
date: {
|
|
|
year: dayjs().format('YYYY'),
|
|
|
month: dayjs().format('MM'),
|
|
@@ -512,6 +545,67 @@
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ },
|
|
|
+ //导出历史库存记录
|
|
|
+ exportHistoricalData() {
|
|
|
+ // 获取仓库
|
|
|
+ xiala({
|
|
|
+ compId: localStorage.getItem('ws-pf_compId'),
|
|
|
+ warehouseType: this.warehouseType,
|
|
|
+ })
|
|
|
+ .toPromise()
|
|
|
+ .then((response) => {
|
|
|
+ this.packtypeList = response
|
|
|
+ })
|
|
|
+ let date = new Date()
|
|
|
+ var year = date.getFullYear();
|
|
|
+ var month = date.getMonth() + 1;
|
|
|
+ var strDate = date.getDate()
|
|
|
+ var pastdate = new Date(date.getTime() - 24 * 60 * 60 * 1000)
|
|
|
+ this.parameter.startDate = pastdate.getFullYear() + '-' + (pastdate.getMonth() + 1) + '-' + pastdate.getDate()
|
|
|
+ this.parameter.endDate = '' + year + '-' + month + '-' + strDate
|
|
|
+ this.$forceUpdate();
|
|
|
+ this.isShowPrintType1 = true
|
|
|
+ },
|
|
|
+ removePrint1() {
|
|
|
+ this.parameter.warehouseName = ''
|
|
|
+ this.parameter.proportion = ''
|
|
|
+ this.isShowPrintType1 = false
|
|
|
+
|
|
|
+ },
|
|
|
+ async submitClick1() {
|
|
|
+
|
|
|
+ if (!this.parameter.startDate) {
|
|
|
+ this.$message.error('请选择打印的起始日期')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.parameter.endDate) {
|
|
|
+ this.$message.error('请选择打印的截止日期')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (new Date(this.parameter.endDate).getTime() < new Date(this.parameter.startDate).getTime()) {
|
|
|
+ this.$message.error('截止日期输入错误')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(this.parameter.warehouseName == '全部仓库'){
|
|
|
+ this.parameter.warehouseName = ''
|
|
|
+ }
|
|
|
+ const {
|
|
|
+ data
|
|
|
+ } = await exportHistoricalInventory({
|
|
|
+ startDate: this.parameter.startDate,
|
|
|
+ endDate: this.parameter.endDate,
|
|
|
+ warehouseName: this.parameter.warehouseName
|
|
|
+ }, {}, {
|
|
|
+ responseType: 'blob'
|
|
|
+ }).toPromise()
|
|
|
+ downloadFile({
|
|
|
+ res: data,
|
|
|
+ fileName: `${
|
|
|
+ this.date.year + (this.date.month ? `-${this.date.month}` : '')
|
|
|
+ }导出历史库存记录`,
|
|
|
+ type: 'xls',
|
|
|
+ })
|
|
|
},
|
|
|
handleClose(){
|
|
|
this.indialog = false
|