| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <template>
- <div>
- <avue-crud :option="option"
- :table-loading="loading"
- :data="data"
- ref="crud"
- @refresh-change="refreshChange"
- @selection-change="selectionChange"
- @search-change="searchChange"
- :page.sync="page"
- @on-load="onLoad">
- </avue-crud>
- <div style="margin-left: 90%">
- <span slot="footer" class="dialog-footer" >
- <el-button @click="closeFun()">取 消</el-button>
- <el-button type="primary" @click="importProMent" :disabled="selectPromentList.length == 0">导入</el-button>
- </span>
- </div>
- </div>
- </template>
- <script>
- import option from './config/purchase.json'
- import {getItemListByConditions} from "@/api/importTrade/purchase";
- export default {
- name: "index",
- props: {
- itemId: {
- type: String
- },
- closeFun: {
- type: Function
- }
- },
- data(){
- return {
- option:option,
- loading:false,
- data:[],
- selectPromentList:[],
- page: {
- pageSize: 10,
- pagerCount: 5,
- total: 0,
- },
- }
- },
- created() {
- },
- methods:{
- refreshChange(){
- this.onLoad(this.page);
- },
- searchChange(params,done){
- this.onLoad(this.page, params);
- done()
- },
- selectionChange(row){
- this.selectPromentList = row
- },
- onLoad(page, params = {}){
- this.loading = true;
- if (params.promentDate != undefined) {
- params.startDate = params.promentDate[0]+ " " + "00:00:00";
- params.endDate = params.promentDate[1] + " " + "23:59:59";
- this.$delete(params,'promentDate')
- }
- params.tradeType = "JK"
- getItemListByConditions(page.currentPage, page.pageSize,params).then(res=>{
- this.data = res.data.data.records
- this.page.total = res.data.data.total
- }).finally(()=>{
- this.loading = false;
- })
- },
- importProMent(){
- this.$emit('importProMent',this.selectPromentList);
- }
- }
- }
- </script>
- <style scoped>
- </style>
|