207 lines
		
	
	
		
			7.5 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
			
		
		
	
	
			207 lines
		
	
	
		
			7.5 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
| <template>
 | |
|   <div>
 | |
|     <!-- 搜索 -->
 | |
|     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
 | |
|       <el-form-item :label="soByType ? '采购时间' : '领料时间'" prop="searchTimeArray">
 | |
|         <el-date-picker
 | |
|           v-model="queryParams.searchTimeArray"
 | |
|           type="daterange"
 | |
|           range-separator="至"
 | |
|           start-placeholder="开始日期"
 | |
|           end-placeholder="结束日期">
 | |
|         </el-date-picker>
 | |
|       </el-form-item>
 | |
|       <el-form-item v-if="soByType && !goodsYes" label="供应商" prop="supplierId">
 | |
|         <SupplierChoose/>
 | |
|       </el-form-item>
 | |
|       <el-form-item v-if="goodsYes" label="关键字" prop="soNo">
 | |
|         <el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、商品名称或编码"/>
 | |
|       </el-form-item>
 | |
|       <el-form-item v-else label="单据号" prop="soNo">
 | |
|         <el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、备注"/>
 | |
|       </el-form-item>
 | |
|       <el-form-item v-if="soByType" label="状态" prop="soStatus">
 | |
|         <el-select v-model="queryParams.soStatus" clearable>
 | |
|           <el-option v-for="item in getStatus"
 | |
|                      :key="item.value"
 | |
|                      :label="item.label"
 | |
|                      :value="item.value"/>
 | |
|         </el-select>
 | |
|       </el-form-item>
 | |
|       <el-form-item v-if="!soByType" label="领料人" prop="userId">
 | |
|         <StaffChoose @selected="getStaff"/>
 | |
|       </el-form-item>
 | |
|       <el-form-item :label="soByType ? '采购门店' : '领料门店'" prop="corpId">
 | |
|         <CorpChoose @selected="getCompany"/>
 | |
|       </el-form-item>
 | |
|       <el-form-item>
 | |
|         <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
 | |
|         <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
 | |
|       </el-form-item>
 | |
|     </el-form>
 | |
|     <!-- 操作 -->
 | |
|     <el-row :gutter="10" class="mb8">
 | |
|       <el-col :span="1.5">
 | |
|         <el-button type="primary" plain icon="el-icon-download" size="mini"
 | |
|         >导出
 | |
|         </el-button>
 | |
|       </el-col>
 | |
|       <right-toolbar :showSearch.sync="showSearch"></right-toolbar>
 | |
|     </el-row>
 | |
|     <!-- 急件 -->
 | |
|     <el-table v-if="goodsYes" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
 | |
|       <el-table-column label="序号" align="center">
 | |
|         <template scope="scope">
 | |
|           <span>{{ scope.$index + 1 }}</span>
 | |
|         </template>
 | |
|       </el-table-column>
 | |
|       <el-table-column label="单号" align="center" prop="soNo" width="180"/>
 | |
|       <el-table-column label="商品名称" align="center" width="180" prop="name"/>
 | |
|       <el-table-column label="规格" align="center" width="180" prop="name"/>
 | |
|       <el-table-column label="商品编码" align="center" width="180" prop="name"/>
 | |
|       <el-table-column label="所属分类" align="center" width="150" prop="name"/>
 | |
|       <el-table-column label="数量" align="center" width="150" prop="name"/>
 | |
|       <el-table-column label="单位" align="center" width="150" prop="name"/>
 | |
|       <el-table-column label="成本" align="center" width="150" prop="name"/>
 | |
|       <el-table-column label="供应商" align="center" width="180" prop="name"/>
 | |
|       <el-table-column label="仓库" align="center" width="150" prop="name"/>
 | |
|       <el-table-column label="状态" align="center" width="150" prop="name"/>
 | |
|       <el-table-column label="时间" align="center" width="150" prop="name"/>
 | |
|       <el-table-column label="门店" align="center" width="180" prop="name"/>
 | |
|       <el-table-column label="操作" align="center" width="180" fixed="right">
 | |
|         <template v-slot="scope">
 | |
|           <el-button size="mini" type="text" icon="el-icon-edit"
 | |
|           >审核
 | |
|           </el-button>
 | |
|         </template>
 | |
|       </el-table-column>
 | |
|     </el-table>
 | |
| 
 | |
|     <!-- 采购/领料 -->
 | |
|     <el-table v-else v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
 | |
|       <el-table-column label="序号" align="center">
 | |
|         <template scope="scope">
 | |
|           <span>{{ scope.$index + 1 }}</span>
 | |
|         </template>
 | |
|       </el-table-column>
 | |
|       <el-table-column label="单号" align="center" prop="soNo" width="180"/>
 | |
|       <el-table-column label="数量" align="center" prop="itemCount" width="150"/>
 | |
|       <el-table-column label="金额" align="center" prop="totalPrice" width="150"/>
 | |
|       <el-table-column :label="soByType ? '采购员' : '领料人'" align="center" prop="userName" width="150"/>
 | |
|       <el-table-column v-if="soByType" label="供应商" align="center" prop="supplierName" width="150"/>
 | |
|       <el-table-column :label="soByType ? '入库时间' : '领料时间'" align="center" prop="soTime" width="150"/>
 | |
|       <el-table-column label="登记时间" align="center" prop="createTime" width="150"/>
 | |
|       <el-table-column label="门店" align="center" prop="corpName" width="180"/>
 | |
|       <el-table-column v-if="soByType" label="状态" align="center" prop="soStatus" width="150"/>
 | |
|       <el-table-column label="备注" align="center" prop="remark" width="180"/>
 | |
|       <el-table-column label="操作" fixed="right" width="180" align="center">
 | |
|         <template v-slot="scope">
 | |
|           <el-button size="mini" type="text" icon="el-icon-edit"
 | |
|           >修改
 | |
|           </el-button>
 | |
|           <el-button size="mini" type="text" icon="el-icon-close"
 | |
|           >作废
 | |
|           </el-button>
 | |
|         </template>
 | |
|       </el-table-column>
 | |
|     </el-table>
 | |
|     <!-- 分页 -->
 | |
|     <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
 | |
|     />
 | |
|   </div>
 | |
| </template>
 | |
| 
 | |
| <script>
 | |
| 
 | |
| import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue";
 | |
| import CorpChoose from "@/views/repair/Components/CorpChoose.vue";
 | |
| import StaffChoose from "@/views/repair/Components/StaffChoose.vue";
 | |
| import {DICT_TYPE} from "@/utils/dict";
 | |
| import {getRepairSoPage} from "@/api/repair/stockOperate/stockOperate";
 | |
| 
 | |
| export default {
 | |
|   name: "SoIndex",
 | |
|   computed: {
 | |
|     getStatus() {
 | |
|       const data = this.getDictDatas(DICT_TYPE.REPAIR_SO_STATUS)
 | |
|       return data.filter(item => item.label.toString().indexOf("领料") === -1)
 | |
|     }
 | |
|   },
 | |
|   components: {
 | |
|     StaffChoose,
 | |
|     SupplierChoose,
 | |
|     CorpChoose
 | |
|   },
 | |
|   props: {
 | |
|     soByType: {
 | |
|       type: Boolean,
 | |
|       defaultValue: true,
 | |
|       required: true
 | |
|     },
 | |
|     goodsYes: {
 | |
|       type: Boolean,
 | |
|       defaultValue: false,
 | |
|       required: false
 | |
|     }
 | |
|   },
 | |
|   data() {
 | |
|     return {
 | |
|       queryParams: {
 | |
|         pageNo: 1,
 | |
|         pageSize: 10,
 | |
|         searchTimeArray: [],
 | |
|         soNo: null,
 | |
|         supplierId: null,
 | |
|         supplierName: null,
 | |
|         soStatus: null,
 | |
|         corpId: null,
 | |
|         userId: null,
 | |
|         userName: null,
 | |
|         soType: this.soByType ? "01" : "02"
 | |
|       },
 | |
|       showSearch: true,
 | |
|       list: [],
 | |
|       loading: false,
 | |
|       total: 0
 | |
|     }
 | |
|   },
 | |
|   mounted() {
 | |
|     this.pageSo();
 | |
|   },
 | |
|   methods: {
 | |
|     // 分页
 | |
|     async pageSo() {
 | |
|       try {
 | |
|         this.loading = true
 | |
|         const res = await getRepairSoPage(this.queryParams)
 | |
|         this.list = res.data.records
 | |
|         this.total = res.data.total
 | |
|       }finally {
 | |
|         this.loading = false
 | |
|       }
 | |
|     },
 | |
|     // 搜索按钮
 | |
|     handleQuery() {
 | |
|     },
 | |
|     // 搜索重置
 | |
|     resetQuery() {
 | |
|       this.resetForm('queryForm')
 | |
|       this.handleQuery()
 | |
|     },
 | |
|     // 员工选择组件的回调
 | |
|     getStaff(data) {
 | |
|       this.queryParams.userId = data.id
 | |
|       this.queryParams.userName = data.name
 | |
|     },
 | |
|     // 门店选择
 | |
|     getCompany(data) {
 | |
|       console.log(data)
 | |
|     }
 | |
|   }
 | |
| }
 | |
| </script>
 | |
| 
 | |
| <style scoped lang="scss">
 | |
| 
 | |
| </style>
 | 
