260 lines
		
	
	
		
			8.1 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
		
		
			
		
	
	
			260 lines
		
	
	
		
			8.1 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
|  | <template> | ||
|  |   <div class="app-container"> | ||
|  |     <div class="card-change"> | ||
|  |       <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> | ||
|  |         <el-form-item label="" prop="orderNumber"> | ||
|  |           <el-input v-model="queryParams.orderNumber" placeholder="请输入进货单号"/> | ||
|  |         </el-form-item> | ||
|  |         <el-form-item label="" v-model="queryParams.supplierId" prop="status"> | ||
|  |           <el-select | ||
|  |             v-model="queryParams.supplierId" | ||
|  |             placeholder="请选择供应商" | ||
|  |             clearable | ||
|  |             style="width: 230px" | ||
|  |           > | ||
|  |             <el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id"/> | ||
|  |           </el-select> | ||
|  |         </el-form-item> | ||
|  |         <el-form-item label="" v-model="queryParams.approvalStatus" prop="status"> | ||
|  |           <el-select v-model="queryParams.approvalStatus" placeholder="请选择状态" clearable> | ||
|  |             <el-option | ||
|  |               v-for="dict in dict.type.oilPurchasedStatus" | ||
|  |               :key="dict.value" | ||
|  |               :label="dict.label" | ||
|  |               :value="dict.value" | ||
|  |             ></el-option> | ||
|  |           </el-select> | ||
|  |         </el-form-item> | ||
|  |         <el-form-item label=""> | ||
|  |           <el-date-picker | ||
|  |             v-model="beginTime" | ||
|  |             style="width: 160px" | ||
|  |             type="date" | ||
|  |             placeholder="开始日期"> | ||
|  |           </el-date-picker> | ||
|  |           至 | ||
|  |           <el-date-picker | ||
|  |             v-model="endTime" | ||
|  |             style="width: 160px" | ||
|  |             type="date" | ||
|  |             placeholder="结束日期"> | ||
|  |           </el-date-picker> | ||
|  |         </el-form-item> | ||
|  |         <el-form-item style="float: right"> | ||
|  |           <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> | ||
|  |           <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> | ||
|  |           <el-button | ||
|  |             type="primary" | ||
|  |             @click="detailsAdd" | ||
|  |             v-hasPermi="['convenienceStore:purchase:index:add']" | ||
|  |           >新增进货订单 | ||
|  |           </el-button> | ||
|  |         </el-form-item> | ||
|  |       </el-form> | ||
|  | 
 | ||
|  |       <div style="height: 71vh;overflow: auto"> | ||
|  |         <el-table ref="tables" border | ||
|  |                   v-loading="loading" | ||
|  |                   :data="purchaseList" | ||
|  |                   :default-sort="defaultSort"> | ||
|  |           <el-table-column label="序号" align="center" type="index" width="60"/> | ||
|  |           <el-table-column label="进货单号" align="center" prop="orderNumber"/> | ||
|  |           <el-table-column label="供应商" align="center" prop="supplierName"/> | ||
|  |           <el-table-column label="商品数量" align="center" prop="productQuantity"/> | ||
|  |           <el-table-column label="单据金额" align="center" prop="totalAmount"/> | ||
|  | 
 | ||
|  |           <el-table-column label="状态" align="center" prop="status"> | ||
|  |             <template slot-scope="scope"> | ||
|  |               <div slot="reference" class="name-wrapper"> | ||
|  |                 <div style="color: #FF9655" v-if="scope.row.approvalStatus == 'await'">待审核</div> | ||
|  |                 <div style="color: #0DC291" v-if="scope.row.approvalStatus == 'qrts'" >已审核入库</div> | ||
|  |                 <div style="color: #F44522" v-if="scope.row.approvalStatus == 'yzf'"  >已作废</div> | ||
|  |                 <div style="color: #409EFF" v-if="scope.row.approvalStatus == 'ysh'"  >已审核</div> | ||
|  |               </div> | ||
|  |             </template> | ||
|  |           </el-table-column> | ||
|  |           <el-table-column label="制单人" align="center" prop="createByName"/> | ||
|  |           <el-table-column label="审核人" align="center" prop="approverName"/> | ||
|  |           <el-table-column label="入库人" align="center" prop="storageName"/> | ||
|  |           <el-table-column label="制单日期" align="center" prop="orderDate" width="200"> | ||
|  |             <template slot-scope="scope"> | ||
|  |               <span>{{ parseTime(scope.row.orderDate) }}</span> | ||
|  |             </template> | ||
|  |           </el-table-column> | ||
|  |           <el-table-column label="审核日期" align="center" prop="examineTime" width="200"> | ||
|  |             <template slot-scope="scope"> | ||
|  |               <span>{{ parseTime(scope.row.examineTime) }}</span> | ||
|  |             </template> | ||
|  |           </el-table-column> | ||
|  |           <el-table-column label="入库时间" align="center" prop="storageTime" width="200"> | ||
|  |             <template slot-scope="scope"> | ||
|  |               <span>{{ parseTime(scope.row.storageTime) }}</span> | ||
|  |             </template> | ||
|  |           </el-table-column> | ||
|  | 
 | ||
|  |           <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | ||
|  |             <template slot-scope="scope"> | ||
|  |               <el-button | ||
|  |                 size="mini" | ||
|  |                 type="text" | ||
|  |                 v-if="scope.row.approvalStatus == 'ysh'" | ||
|  |                 @click="dispose(scope.row)"> | ||
|  |                 商品入库 | ||
|  |               </el-button> | ||
|  |               <el-button | ||
|  |                 size="mini" | ||
|  |                 type="text" | ||
|  |                 v-else-if="scope.row.approvalStatus == 'await'" | ||
|  |                 @click="dispose(scope.row)"> | ||
|  |                 采购审核 | ||
|  |               </el-button> | ||
|  |               <el-button | ||
|  |                 size="mini" | ||
|  |                 type="text" | ||
|  |                 v-else | ||
|  |                 @click="dispose(scope.row)"> | ||
|  |                 查看详情 | ||
|  |               </el-button> | ||
|  |             </template> | ||
|  | 
 | ||
|  |           </el-table-column> | ||
|  |         </el-table> | ||
|  |       </div> | ||
|  |       <pagination | ||
|  |         v-show="total>0" | ||
|  |         :total="total" | ||
|  |         :page.sync="queryParams.page" | ||
|  |         :limit.sync="queryParams.pageSize" | ||
|  |         @pagination="getList" | ||
|  |       /> | ||
|  |     </div> | ||
|  | 
 | ||
|  |   </div> | ||
|  | </template> | ||
|  | 
 | ||
|  | <script> | ||
|  | import {delInventoryApi, getInventoryApi} from "@/api/oilConfig/oilInventory"; | ||
|  | import {getPurchasePageApi} from "@/api/convenienceStore/purchase"; | ||
|  | import {listSupplier} from "@/api/convenienceStore/supplier"; | ||
|  | 
 | ||
|  | export default { | ||
|  |   name: "index", | ||
|  |   dicts: ['oilPurchasedStatus'], | ||
|  | 
 | ||
|  |   data() { | ||
|  |     return { | ||
|  |       purchaseList: [], | ||
|  |       // 供应商列表
 | ||
|  |       supplierList: [], | ||
|  |       // 弹出框标题
 | ||
|  |       title: '', | ||
|  |       // 显示搜索条件
 | ||
|  |       showSearch: true, | ||
|  |       disableInput: false, // 默认不禁用
 | ||
|  |       // 是否显示弹出层
 | ||
|  |       open: false, | ||
|  |       // 总条数
 | ||
|  |       total: 0, | ||
|  | 
 | ||
|  |       // 查询参数
 | ||
|  |       queryParams: { | ||
|  |         orderNumber: "", | ||
|  |         approvalStatus: "", | ||
|  |         status: '', | ||
|  |         supplierId: '', | ||
|  |         dateRange: '', | ||
|  |         page: null, | ||
|  |         pageSize: null, | ||
|  |       }, | ||
|  |       beginTime: "", | ||
|  |       endTime: "", | ||
|  |       // 遮罩层
 | ||
|  |       loading: false, | ||
|  |       // 默认排序
 | ||
|  |       defaultSort: {prop: 'createTime', order: 'descending'}, | ||
|  |     } | ||
|  | 
 | ||
|  |   }, | ||
|  |   async created() { | ||
|  |     await this.getList(); | ||
|  |     this.getQueryList(); | ||
|  | 
 | ||
|  |   }, | ||
|  |   methods: { | ||
|  | 
 | ||
|  |     // 获取列表
 | ||
|  |     getList() { | ||
|  |       this.loading = true; | ||
|  |       let dateRange = [] | ||
|  |       if (this.beginTime && this.endTime) { | ||
|  |         dateRange.push(this.beginTime.toLocaleDateString()) | ||
|  |         dateRange.push(this.endTime.toLocaleDateString()) | ||
|  |       } | ||
|  |       getPurchasePageApi(this.addDateRange(this.queryParams, dateRange)).then(response => { | ||
|  |         this.purchaseList = response.data.records; | ||
|  |         this.total = response.data.total; | ||
|  |       }) | ||
|  |       this.loading = false; | ||
|  |     }, | ||
|  |     // 查询搜索列表信息
 | ||
|  |     getQueryList() { | ||
|  |       // selectTree().then(response => {
 | ||
|  |       //   this.cvsGoodList = response.data.records
 | ||
|  |       // });
 | ||
|  |       listSupplier().then(response => { | ||
|  |         this.supplierList = response.data.records | ||
|  |       }) | ||
|  |     }, | ||
|  |     detailsAdd() { | ||
|  |       this.$router.push({ | ||
|  |         name: 'purchase-details', | ||
|  |       }); | ||
|  |     }, | ||
|  |     // 处理单据
 | ||
|  |     dispose(data) { | ||
|  |       this.$router.push({ | ||
|  |         name: 'purchase-details', | ||
|  |         params: { | ||
|  |           PpurchaseId: data.id, | ||
|  |           PorderNumber: data.orderNumber, | ||
|  |           PorderDate: data.orderDate, | ||
|  |           PapprovalStatus: data.approvalStatus | ||
|  |         }, | ||
|  | 
 | ||
|  |       }); | ||
|  |     }, | ||
|  | 
 | ||
|  |     // 重置
 | ||
|  |     resetQuery() { | ||
|  |       this.queryParams = {} | ||
|  |       this.beginTime = '' | ||
|  |       this.endTime = '' | ||
|  |       this.getList() | ||
|  |     }, | ||
|  |     // 删除
 | ||
|  |     handleDel(data) { | ||
|  |       delInventoryApi(data).then(response => { | ||
|  |         this.$modal.msgSuccess("删除成功"); | ||
|  |         this.getList(); | ||
|  |       }) | ||
|  |     }, | ||
|  |     // 搜索按钮操作
 | ||
|  |     handleQuery() { | ||
|  |       this.queryParams.page = 1; | ||
|  |       this.getList(); | ||
|  |     }, | ||
|  |   } | ||
|  | 
 | ||
|  | 
 | ||
|  | } | ||
|  | </script> | ||
|  | 
 | ||
|  | <style scoped lang="scss"> | ||
|  | .app-container { | ||
|  |   width: 100%; | ||
|  |   height: 100%; | ||
|  |   background: #f6f8f9; | ||
|  | } | ||
|  | 
 | ||
|  | </style> |