inspectionManagement.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  1. <!--质检管理-->
  2. <template>
  3. <div>
  4. <BaseHeaderLayout :leftSpan="16">
  5. <template slot="left">
  6. <ws-button type="primary" @click="inspectInfo(1)"
  7. v-hasPermission="`acquisitionManagement.acquisitionQuality.add`">添加</ws-button>
  8. </template>
  9. <template slot="right">
  10. <ws-select v-model="warehouseName" placeholder="" @change="warehouseNameChange" :value="searchType"
  11. style="margin: 0 10px">
  12. <ws-option v-for="item in warehouseList" :key="item.value" :label="item.value" :value="item.value"
  13. style="color: #8890b1" />
  14. </ws-select>
  15. <div></div>
  16. <ws-input v-model="searchKeyWord" placeholder="可按编号、客户名、车牌号查找" clearable maxlength="500" type="input">
  17. </ws-input>
  18. <ws-button class="find" type="primary" @click="find()"><img width="16" height="16" style="
  19. vertical-align: text-top;
  20. position: relative;
  21. top: 0px;
  22. " src="../../../public/img/sousuo.png" alt="" /></ws-button>
  23. </template>
  24. </BaseHeaderLayout>
  25. <!-- <div style="height:calc(100vh - 600px)"> -->
  26. <el-table :data="inspect" style="width: 100%; margin-top: 20px" ref="inspect" border height="600">
  27. <el-table-column type="index" label="序号" width="50">
  28. <template scope="scope">
  29. <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
  30. <span v-else>{{ scope.$index + 1 }}</span>
  31. </template>
  32. </el-table-column>
  33. <el-table-column prop="qualityNo" width="100" label="编号"></el-table-column>
  34. <el-table-column prop="customerName" label="客户"></el-table-column>
  35. <el-table-column prop="carNumber" label="车牌号"></el-table-column>
  36. <el-table-column prop="goodsName" label="货名"></el-table-column>
  37. <el-table-column prop="waterContent" label="水分(%)" width="120">
  38. <template scope="scope">
  39. <span class="water-left">{{scope.row.waterContent}}</span>
  40. <span class="water-line">|</span>
  41. <span class="water-right">{{scope.row.reWaterContent ? scope.row.reWaterContent : '未复检' }}</span>
  42. </template>
  43. </el-table-column>
  44. <el-table-column prop="buckleMiscellaneous" label="扣杂" width="120">
  45. <template scope="scope">
  46. <div v-if="scope.row.paramType == 1">
  47. <span class="water-left">{{scope.row.buckleMiscellaneous}} </span>
  48. <span class="water-line">|</span>
  49. <span
  50. class="water-right">{{scope.row.reBuckleMiscellaneous ? scope.row.reBuckleMiscellaneous : '未复检'}}</span>
  51. </div>
  52. </template>
  53. </el-table-column>
  54. <el-table-column prop="type" label="类型"></el-table-column>
  55. <el-table-column prop="tidalGrainPrice" label="单价(元/公斤)" width="120px">
  56. <template scope="scope">
  57. <span v-if="scope.row.type == '潮粮'">{{ scope.row.tidalGrainPrice }}</span>
  58. <span v-else>{{ scope.row.dryGrainPrice }}</span>
  59. </template>
  60. </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="质检员" width="120px">
  64. <template scope="scope">
  65. <span>{{scope.row.qualityInspector}}</span>
  66. <span
  67. v-if="scope.row.reInspector && scope.row.qualityInspector != scope.row.reInspector">,{{scope.row.reInspector}}</span>
  68. </template>
  69. </el-table-column>
  70. <el-table-column prop="updateDate" label="质检时间" width="90px"></el-table-column>
  71. <el-table-column prop="status" label="状态">
  72. <template slot-scope="scope">
  73. <span v-if='scope.row.confirm=="1"'>
  74. 已确认
  75. </span>
  76. <span v-else>
  77. {{scope.row.status}}
  78. </span>
  79. </template>
  80. </el-table-column>
  81. <el-table-column width="410" label="操作">
  82. <template slot-scope="scope">
  83. <el-button @click="inspectInfo(scope.row, 2)"
  84. v-hasPermission="`acquisitionManagement.acquisitionQuality.view`">查看</el-button>
  85. <el-button @click="inspectInfo(scope.row, 3)"
  86. v-if="scope.row.status=='已初检'&& scope.row.confirm!='1'"
  87. v-hasPermission="`acquisitionManagement.acquisitionQuality.initial`">初检</el-button>
  88. <div v-show="scope.row.confirm !='1' && scope.row.status == '已复检'" style="display: inline-block;">
  89. <el-button @click="inspectInfo(scope.row, 5)"
  90. v-hasPermission="`acquisitionManagement.acquisitionQuality.con`">确认</el-button>
  91. </div>
  92. <el-button @click="inspectInfo(scope.row, 4)" v-if="scope.row.confirm !='1'"
  93. v-hasPermission="`acquisitionManagement.acquisitionQuality.again`">复检</el-button>
  94. <div style="display: inline-block;"
  95. v-if="scope.row.weighingManagement&&scope.row.weighingManagement.status=='已质检'">
  96. <el-button @click="del(scope.row)" type="danger"
  97. v-hasPermission="`acquisitionManagement.acquisitionQuality.delete`">删除</el-button>
  98. </div>
  99. <el-button @click="print(scope.row)"
  100. v-hasPermission="`acquisitionManagement.acquisitionQuality.print`">打印</el-button>
  101. </template>
  102. </el-table-column>
  103. </el-table>
  104.  <el-dialog width="70%" class="table-content" center :visible.sync="isShowPrint" title="粮食质检单">
  105. <!-- <inspectInfoPrint :printData="printData"></inspectInfoPrint> -->
  106. <inspectInfoPrint :printData="printData" ref="saveImg"></inspectInfoPrint>
  107. <div style="text-align:center">
  108. <el-button type="primary" @click="closePrint">关闭</el-button>
  109. <el-button type="primary" @click="printSmall">打印小票</el-button>
  110. <el-button type="primary" @click="printBig">打印单据</el-button>
  111. </div>
  112. </el-dialog>
  113. <div style="text-align: center;margin-top:20px">
  114. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
  115. :current-page="currentPage" :page-size="deptCircularPage.pageSize"
  116. layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
  117. </el-pagination>
  118. </div>
  119. <!-- </div> -->
  120. </div>
  121. </template>
  122. <script>
  123. import {
  124. selectWarehouseSelf,
  125. getinspectList,
  126. getinspectDelete,
  127. getinspectLook,
  128. } from '@/model/houseSelfCollect/index'
  129. import inspectInfoPrint from './component/inspectInfoPrint.vue'
  130. export default {
  131. components: {
  132. inspectInfoPrint
  133. },
  134. watch: {},
  135. data() {
  136. return {
  137. //分页
  138. currentPage: 1,
  139. pageSize: 10,
  140. deptCircularPage: {},
  141. deptBudgetTotal: 0,
  142. searchKeyWord: '',
  143. taskTypeList: [],
  144. searchType: 0,
  145. warehouseName: '',
  146. inspect: [],
  147. warehouseList1: [],
  148. warehouseList: [],
  149. cangid: '', //仓库id
  150. warehouseCount: '',
  151. warehouseNo: '',
  152. isShowPrint: false,
  153. printData: {},
  154. deductWeight: '', //扣重比
  155. saleLimit: '',
  156. allowEdit:'0'
  157. }
  158. },
  159. activated() {
  160. this.selectWarehouse()
  161. },
  162. methods: {
  163. printSmall() {
  164. window.open('../../../static/inspection.html?type=1&dataList=' + JSON.stringify(this.printData))
  165. },
  166. printBig() {
  167. window.open('../../../static/inspection.html?type=2&dataList=' + JSON.stringify(this.printData))
  168. },
  169. closePrint() {
  170. this.isShowPrint = false
  171. this.$router.push({
  172. path: 'inspectionManagement'
  173. })
  174. },
  175. find() {
  176. this.getList()
  177. },
  178. inspectInfo(row, index) {
  179. for (let i = 0; i < this.warehouseList.length; i++) {
  180. if (this.warehouseName == this.warehouseList[i].value) {
  181. // console.log(this.warehouseList[i])
  182. this.cangid = this.warehouseList[i].id
  183. }
  184. }
  185. // console.log(this.cangid)
  186. //添加,编辑,查看
  187. this.$router.push({
  188. path: 'inspectInfo',
  189. query: {
  190. type: index,
  191. cangid: this.cangid,
  192. id: row.id,
  193. warehouseName: this.warehouseName,
  194. count: this.warehouseCount,
  195. warehouseNo: this.warehouseNo,
  196. allowEdit:this.allowEdit
  197. },
  198. })
  199. },
  200. warehouseNameChange(e) {
  201. // console.log(e)
  202. for (let i = 0; i < this.warehouseList.length; i++) {
  203. if (this.warehouseList[i].value == e) {
  204. this.warehouseName = this.warehouseList[i].value
  205. this.warehouseCount = this.warehouseList[i].count
  206. this.warehouseNo = this.warehouseList[i].No
  207. this.cangid = this.warehouseList[i].id
  208. this.allowEdit = this.warehouseList[i].allowEdit
  209. this.WAREHOUSE[1].payname = this.warehouseList[i].value
  210. localStorage.setItem('houseSelfCollect_house1', JSON.stringify(this.warehouseList[i]))
  211. }
  212. }
  213. this.getList()
  214. },
  215. del(row) {
  216. //删除
  217. this.$confirm('确定删除质检信息?', '提示', {
  218. confirmButtonText: '确定',
  219. cancelButtonText: '取消',
  220. type: 'warning',
  221. })
  222. .then(() => {
  223. getinspectDelete({
  224. id: row.id,
  225. })
  226. .toPromise()
  227. .then((response) => {
  228. this.$notify.success({
  229. title: '成功',
  230. message: '删除成功',
  231. })
  232. this.getList()
  233. })
  234. .catch((response) => {
  235. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  236. })
  237. })
  238. .catch(() => {
  239. return false
  240. })
  241. },
  242. handleSizeChange(val) {
  243. console.log(`每页 ${val} 条`)
  244. this.pageSize = val
  245. this.getList()
  246. },
  247. handleCurrentChange(val) {
  248. this.currentPage = val
  249. console.log(`当前页: ${val}`)
  250. this.getList()
  251. },
  252. selectWarehouse() {
  253. selectWarehouseSelf({
  254. compId: localStorage.getItem('ws-pf_compId'),
  255. })
  256. .toPromise()
  257. .then((response) => {
  258. this.warehouseList1 = response
  259. this.warehouseList = []
  260. let _wareHouse = localStorage.getItem('houseSelfCollect_house1')
  261. _wareHouse = JSON.parse(_wareHouse)
  262. if (_wareHouse) {
  263. this.cangid = _wareHouse.warehouseId
  264. this.warehouseName = _wareHouse.value
  265. this.warehouseNo = _wareHouse.No
  266. this.warehouseCount = _wareHouse.count
  267. this.allowEdit = _wareHouse.allowEdit
  268. }
  269. for (let i = 0; i < response.length; i++) {
  270. if(_wareHouse && response[i].warehouseName==_wareHouse.value){
  271. this.warehouseCount = response[i].count
  272. this.allowEdit = response[i].allowEdit
  273. }
  274. this.warehouseList.push({
  275. value: response[i].warehouseName,
  276. id: response[i].id,
  277. count: response[i].count,
  278. No: response[i].commonWarehouseNo,
  279. allowEdit:response[i].allowEdit
  280. })
  281. if (!_wareHouse) {
  282. if (this.cangid && this.cangid == response[i].id) {
  283. this.warehouseName = response[i].warehouseName
  284. this.warehouseCount = response[i].count
  285. this.warehouseNo = response[i].commonWarehouseNo
  286. this.allowEdit = response[i].allowEdit
  287. }
  288. if (this.warehouseList.length > 0 && !this.cangid) {
  289. this.warehouseName = this.warehouseList[0].value
  290. this.warehouseCount = this.warehouseList[0].count
  291. this.warehouseNo = this.warehouseList[0].No
  292. this.cangid = this.warehouseList[0].id
  293. this.allowEdit = this.warehouseList[0].allowEdit
  294. this.WAREHOUSE[1].payname = this.warehouseList[0].value
  295. }
  296. }
  297. }
  298. this.getList()
  299. })
  300. },
  301. getList() {
  302. getinspectList({
  303. compId: localStorage.getItem('ws-pf_compId'),
  304. currentPage: this.currentPage,
  305. pageSize: this.pageSize,
  306. searchKeyWord: (this.searchKeyWord).toUpperCase(),
  307. warehouseName: this.warehouseName,
  308. managementType: 1
  309. })
  310. .toPromise()
  311. .then((response) => {
  312. console.log(response)
  313. this.inspect = response.records
  314. this.deptBudgetTotal = response.total
  315. // this.$forceUpdate();
  316. })
  317. },
  318. print(row) {
  319. getinspectLook({
  320. id: row.id,
  321. })
  322. .toPromise()
  323. .then((response) => {
  324. this.isShowPrint = true
  325. this.printData = response
  326. // window.location.href="../../../static/inspection.html?dataList="+JSON.stringify(response)
  327. })
  328. },
  329. },
  330. }
  331. </script>
  332. <style lang="scss" scoped>
  333. /deep/.el-dialog__header {
  334. text-align: center !important;
  335. padding: 10px 0 !important;
  336. height: auto !important;
  337. }
  338. /deep/.el-dialog__title {
  339. font-size: 24px !important;
  340. }
  341. .title {
  342. font-size: 20px;
  343. font-weight: 600;
  344. margin: 20px 0 0 20px;
  345. }
  346. .tit {
  347. font-size: 16px;
  348. font-weight: 600;
  349. margin: 20px;
  350. }
  351. .ws-info-table {
  352. border: none;
  353. }
  354. .ws-info-table .el-form-item {
  355. width: 50%;
  356. border: none;
  357. }
  358. /deep/.ws-info-table .el-form-item .el-form-item__label {
  359. width: 30%;
  360. text-align: center;
  361. background: #ffffff;
  362. color: #8890b1;
  363. }
  364. /deep/.ws-info-table .el-form-item .el-form-item__content {
  365. border: none;
  366. }
  367. /deep/.el-table .el-table__header .cell,
  368. .el-table .el-table__body .cell {
  369. text-align: center;
  370. }
  371. /deep/.el-table--enable-row-transition .el-table__body td {
  372. text-align: center;
  373. }
  374. /deep/.el-dialog__body {
  375. padding: 20px !important;
  376. }
  377. .water-left,
  378. .water-right {
  379. width: 45%;
  380. display: inline-block;
  381. }
  382. // /deep/.el-table--border{
  383. // height: calc(100vh - 600px) !important;
  384. // }
  385. </style>