qualityInspectionManagement.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <!--质检管理-->
  2. <template>
  3. <div>
  4. <BaseHeaderLayout :leftSpan="12">
  5. <template slot="right">
  6. <ws-select
  7. v-model="warehouseName"
  8. placeholder=""
  9. @change="selecttaskType"
  10. :value="searchType"
  11. >
  12. <ws-option
  13. v-for="item in warehouseList"
  14. :key="item.value"
  15. :label="item.value"
  16. :value="item.value"
  17. style="color: #8890b1"
  18. />
  19. </ws-select>
  20. <div></div>
  21. <ws-input
  22. v-model="searchKeyWord"
  23. placeholder="可按合同编号、车牌号查找"
  24. clearable
  25. maxlength="500"
  26. type="input"
  27. ></ws-input>
  28. <ws-button class="find" type="primary" @click="find()"
  29. ><img
  30. width="16"
  31. height="16"
  32. style="
  33. vertical-align: text-top;
  34. position: relative;
  35. top: 0px;
  36. left: -8px;
  37. "
  38. src="../../../public/img/sousuo.png"
  39. alt=""
  40. /></ws-button>
  41. </template>
  42. </BaseHeaderLayout>
  43. <el-table
  44. :data="inspect"
  45. style="width: 100%; margin-top: 20px"
  46. ref="inspect"
  47. border
  48. height="780"
  49. >
  50. <el-table-column type="index" label="序号" width="50">
  51. <template scope="scope">
  52. <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
  53. <span v-else>{{ scope.$index + 1 }}</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column prop="contractNo" label="合同编号"></el-table-column>
  57. <el-table-column prop="carNumber" label="车牌号"></el-table-column>
  58. <el-table-column prop="goodsName" label="货名"></el-table-column>
  59. <el-table-column prop="bulkDensity" label="容重(克/升)"></el-table-column>
  60. <el-table-column prop="waterContent" label="水分(%)"></el-table-column>
  61. <el-table-column prop="binNumber" label="仓位号"></el-table-column>
  62. <el-table-column prop="storageTagNo" label="囤位号"></el-table-column>
  63. <el-table-column prop="qualityInspector" label="质检员"></el-table-column>
  64. <el-table-column prop="updateDate" label="质检时间"></el-table-column>
  65. <el-table-column prop="status" label="状态"></el-table-column>
  66. <el-table-column width="300" label="操作">
  67. <template slot-scope="scope">
  68. <span v-if="scope.row.status == '已质检'"><el-button @click="qualityInspection(scope.row, 2)">查看</el-button></span>
  69. <span v-if="scope.row.status == '已称皮重' || scope.row.status == '' || scope.row.status == null"><el-button @click="qualityInspection(scope.row, 1)">质检</el-button></span>
  70. </template>
  71. </el-table-column>
  72. </el-table>
  73. <div style="text-align: center">
  74. <el-pagination
  75. @size-change="handleSizeChange"
  76. @current-change="handleCurrentChange"
  77. :current-page="currentPage"
  78. :page-size="deptCircularPage.pageSize"
  79. layout="total, sizes, prev, pager, next, jumper"
  80. :total="deptBudgetTotal"
  81. >
  82. </el-pagination>
  83. </div>
  84. </div>
  85. </template>
  86. <script>
  87. import {
  88. selectWarehouseSelf,
  89. getinspectList,
  90. } from '@/model/outboundManagement/index'
  91. export default {
  92. components: {},
  93. watch: {},
  94. data() {
  95. return {
  96. //分页
  97. currentPage: 1,
  98. pageSize: 10,
  99. deptCircularPage: {},
  100. deptBudgetTotal: 0,
  101. searchKeyWord: '',
  102. taskTypeList: [],
  103. searchType: 0,
  104. warehouseName: '',
  105. inspect: [],
  106. warehouseList: [],
  107. cangid: '', //仓库id
  108. }
  109. },
  110. activated() {
  111. this.getList()
  112. },
  113. methods: {
  114. find(){
  115. this.getList()
  116. },
  117. qualityInspection(row, index) {
  118. //添加/查看
  119. console.log(row.id, 'id值')
  120. this.$router.push({
  121. path: 'qualityInspection',
  122. query: { type: index, cangid: this.cangid, id: row.id ,warehouseName:this.warehouseName,count:this.warehouseCount,
  123. warehouseNo:this.warehouseNo,contractNo:row.contractNo,binNumber:row.binNumber,carNumber:row.carNumber,
  124. storageTagNo:row.storageTagNo,goodsName:row.goodsName},
  125. })
  126. },
  127. selecttaskType(e) {
  128. console.log(e)
  129. },
  130. handleSizeChange(val) {
  131. console.log(`每页 ${val} 条`)
  132. this.pageSize = val
  133. this.getList()
  134. },
  135. handleCurrentChange(val) {
  136. this.currentPage = val
  137. console.log(`当前页: ${val}`)
  138. this.getList()
  139. },
  140. getList() {
  141. selectWarehouseSelf({
  142. compId: sessionStorage.getItem('ws-pf_compId'),
  143. })
  144. .toPromise()
  145. .then((response) => {
  146. this.warehouseList = []
  147. for (let i = 0; i < response.length; i++) {
  148. this.warehouseList.push({
  149. // valueKey: i,
  150. value: response[i].warehouseName,
  151. id: response[i].id,
  152. })
  153. }
  154. this.warehouseName = response[0].warehouseName
  155. this.cangid = response[0].id
  156. })
  157. getinspectList({
  158. compId: sessionStorage.getItem('ws-pf_compId'),
  159. currentPage: this.currentPage,
  160. pageSize: this.pageSize,
  161. searchKeyWord: this.searchKeyWord,
  162. warehouseName: this.warehouseName,
  163. })
  164. .toPromise()
  165. .then((response) => {
  166. // for (let i = 0; i < response.length; i++) {
  167. // this.warehouseList.push({
  168. // valueKey: i,
  169. // value: response[i].warehouseName,
  170. // id:response[i].id
  171. // })
  172. // }
  173. // this.searchTypeText = response[0].warehouseName
  174. // this.id = response[0].id
  175. // console.log(response)
  176. this.inspect = response.records
  177. console.log(this.inspect,'容重')
  178. this.deptBudgetTotal = response.total
  179. })
  180. },
  181. },
  182. }
  183. </script>
  184. <style lang="scss" scoped>
  185. .title {
  186. font-size: 20px;
  187. font-weight: 600;
  188. margin: 20px 0 0 20px;
  189. }
  190. .tit {
  191. font-size: 16px;
  192. font-weight: 600;
  193. margin: 20px;
  194. }
  195. .ws-info-table {
  196. border: none;
  197. }
  198. .ws-info-table .el-form-item {
  199. width: 50%;
  200. border: none;
  201. }
  202. /deep/.ws-info-table .el-form-item .el-form-item__label {
  203. width: 30%;
  204. text-align: center;
  205. background: #ffffff;
  206. color: #8890b1;
  207. }
  208. /deep/.ws-info-table .el-form-item .el-form-item__content {
  209. border: none;
  210. }
  211. /deep/.el-table .el-table__header .cell,
  212. .el-table .el-table__body .cell {
  213. text-align: center;
  214. }
  215. /deep/.el-table--enable-row-transition .el-table__body td {
  216. text-align: center;
  217. }
  218. </style>