productionIn.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <div class="app-container">
  3. <div class="title-container">
  4. <breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
  5. </div>
  6. <y-page-list-layout :page-list="pageData" :page-para="listQuery" :get-page-list="getList">
  7. <template slot="left">
  8. <el-switch v-model="warehouseDialog" style="margin-top: 5px;margin-left: 20px;" active-text="开启出入库" inactive-text="关闭出入库"></el-switch>
  9. <el-input v-model="listQuery.reportNo" placeholder="产品号" clearable
  10. style="margin-left: 20px;width: 300px;float: left;">
  11. </el-input>
  12. <el-select style="margin-left: 20px;width: 170px;float: left;" v-model="listQuery.production" clearable placeholder="产品类型">
  13. <el-option value="价值意见书" label="价值意见书">价值意见书</el-option>
  14. <el-option value="报告" label="报告">报告</el-option>
  15. <el-option value="复评函" label="复评函">复评函</el-option>
  16. <el-option value="技术报告" label="价值意见书">技术报告</el-option>
  17. <el-option value="结果报告" label="报告">结果报告</el-option>
  18. <el-option value="咨询报告" label="复评函">咨询报告</el-option>
  19. </el-select>
  20. <el-date-picker
  21. style="margin-left: 20px;float: left;"
  22. v-model="warehouseInDate"
  23. type="daterange"
  24. align="center"
  25. unlink-panels
  26. range-separator="至"
  27. start-placeholder="入库时间(开始)"
  28. end-placeholder="入库时间(结束)"
  29. :picker-options="pickerOptions" value-format="yyyy-MM-dd">
  30. </el-date-picker>
  31. <el-button class="filter-item" style="margin-left: 10px;float: left;" type="primary" @click="searchList" round>搜索
  32. </el-button>
  33. <el-button class="filter-item" style="float: left;" round type="success" @click="resetSearch()">重置
  34. </el-button>
  35. </template>
  36. <parentTable :data="pageData.records" slot="table" style="width: 100%;" :isBoard=600>
  37. <el-table-column label="业务类型" align="center" >
  38. <template slot-scope="{row}">
  39. <span>{{ row.businessType }}</span>
  40. </template>
  41. </el-table-column>
  42. <el-table-column label="产品号" align="center" >
  43. <template slot-scope="{row}">
  44. <span>{{ row.reportNo }}</span>
  45. </template>
  46. </el-table-column>
  47. <el-table-column label="产品类型" align="center" >
  48. <template slot-scope="{row}">
  49. <span>{{ row.production}}</span>
  50. </template>
  51. </el-table-column>
  52. <el-table-column label="客户经理" align="center" >
  53. <template slot-scope="{row}">
  54. <span>{{ row.clientManager}}</span>
  55. </template>
  56. </el-table-column>
  57. <el-table-column label="库存状态" align="center">
  58. <template slot-scope="{row}">
  59. <span>{{ row.repertoryState==null?'未入库':(row.repertoryState == false?'已入库':'已出库')}}</span>
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="入库时间" align="center">
  63. <template slot-scope="{row}">
  64. <span>{{ row.repertoryInTime}}</span>
  65. </template>
  66. </el-table-column>
  67. </parentTable>
  68. </y-page-list-layout>
  69. <el-dialog :visible.sync="warehouseDialog" width="25%" center top="35vh" custom-class="doWarehouseClass"
  70. @closed="cleanWareHouseProduction()">
  71. <ScanEntry ref="scanEntry" @scanEntryFun="handleScanEntry" label="请扫描二维码或输入产品号" :onFocus="warehouseDialog"/>
  72. <span slot="footer" class="dialog-footer">
  73. <el-button @click="warehouseDialog = false">取 消</el-button>
  74. <el-button type="primary" @click="doWareHouse()" :disabled="holdOn">确 定</el-button>
  75. </span>
  76. </el-dialog>
  77. </div>
  78. </template>
  79. <script>
  80. import YPageListLayout from '@/components/YPageListLayout'
  81. import Breadcrumb from '@/components/Breadcrumb'
  82. import ScanEntry from '@/components/ScanEntry'
  83. export default {
  84. name: 'productionIn',
  85. components: {
  86. Breadcrumb,
  87. YPageListLayout,
  88. ScanEntry
  89. },
  90. filters: {
  91. },
  92. data() {
  93. return {
  94. pageData: { records: [] },
  95. listQuery: {
  96. page: 1,
  97. size: 10,
  98. descs: 'id',
  99. },
  100. warehouseInDate:'',
  101. pickerOptions: {
  102. shortcuts: [{
  103. text: '最近一周',
  104. onClick(picker) {
  105. const end = new Date();
  106. const start = new Date();
  107. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  108. picker.$emit('pick', [start, end]);
  109. }
  110. }, {
  111. text: '最近一个月',
  112. onClick(picker) {
  113. const end = new Date();
  114. const start = new Date();
  115. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  116. picker.$emit('pick', [start, end]);
  117. }
  118. }, {
  119. text: '最近三个月',
  120. onClick(picker) {
  121. const end = new Date();
  122. const start = new Date();
  123. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  124. picker.$emit('pick', [start, end]);
  125. }
  126. }]
  127. },
  128. warehouseDialog:false,
  129. scanEntryData:null,
  130. holdOn:false
  131. }
  132. },
  133. created() {
  134. this.warehouseDialog = this.$route.query.openDialog === 'true';
  135. this.getList();
  136. },
  137. methods: {
  138. resetSearch() {
  139. this.$router.push({ query: {} });
  140. this.warehouseInDate = '';
  141. this.listQuery = {
  142. current: 1,
  143. size: 10,
  144. descs: 'id',
  145. }
  146. this.getList()
  147. },
  148. searchList() {
  149. // 重置分页
  150. this.listQuery.page = 1
  151. this.listQuery.size = 10
  152. if (this.warehouseInDate){
  153. this.listQuery.startDate = this.warehouseInDate[0]+' 00:00:00';
  154. this.listQuery.endDate = this.warehouseInDate[1]+ ' 23:59:59';
  155. }
  156. this.getList()
  157. },
  158. getList() {
  159. this.$api.majorProduction.house(Object.assign({}, this.listQuery)).then(res=>{
  160. if (res.code ===200){
  161. this.pageData = res.data;
  162. }
  163. })
  164. },
  165. aliasProductionType(code){
  166. if (code === 'STATEMENT'){
  167. return '价值意见书';
  168. }
  169. if (code === 'LETTER'){
  170. return '复评函';
  171. }
  172. return '报告';
  173. },
  174. cleanWareHouseProduction() {
  175. this.scanEntryData = null;
  176. this.$refs.scanEntry.clearData();
  177. },
  178. handleScanEntry(scanData) {
  179. this.scanEntryData = scanData;
  180. },
  181. doWareHouse(){
  182. this.holdOn = true;
  183. let productionNo = this.scanEntryData;
  184. if (!productionNo){
  185. productionNo = this.$refs.scanEntry.scanEntryData;
  186. }
  187. if (productionNo){
  188. this.$api.businessProduction.commonWareHouse(productionNo).then(res=>{
  189. if (res.code === 200 && res.data){
  190. this.$message({type:'success',message:"操作成功"});
  191. this.$refs.scanEntry.clearData();
  192. }
  193. })
  194. }else{
  195. this.$message({type:'error',message:"未获取到报告号"});
  196. }
  197. //解决在一秒内完成入库、出库的操作引起的bug
  198. setTimeout(()=>{
  199. this.holdOn = false;
  200. },1200)
  201. }
  202. },
  203. }
  204. </script>
  205. <style lang="scss" scoped>
  206. /deep/.doWarehouseClass {
  207. border-radius: 10px;
  208. }
  209. </style>