You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

248 lines
6.7 KiB

3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" label-width="100px" >
  4. <el-form-item >
  5. <span slot="label" style="" @click="getBaseList(5)"><a herf="#">物料编码</a></span>
  6. <el-input v-model="searchData.partNo" style="width: 120px"></el-input>
  7. </el-form-item>
  8. <el-form-item :label="'批次号:'">
  9. <el-input v-model="searchData.batchNo" style="width: 120px"></el-input>
  10. </el-form-item>
  11. <el-form-item :label="'是否显示库存为0的批次:'">
  12. <el-select v-model="searchData.zeroSql" style="width: 120px">
  13. <el-option label="是" value=" "></el-option>
  14. <el-option label="否" value=" AND QtyOnHand >0.0001"></el-option>
  15. </el-select>
  16. </el-form-item>
  17. <el-form-item :label="' '">
  18. <el-button @click="search()" style="margin-left: 0px;margin-top:0px" type="primary">查询</el-button>
  19. </el-form-item>
  20. </el-form>
  21. <el-table
  22. :height="height"
  23. :data="tableData"
  24. border
  25. style="width: 100%">
  26. <el-table-column
  27. prop=""
  28. header-align="center"
  29. align="center"
  30. min-width="60"
  31. label="操作">
  32. <template slot-scope="scope" class="foo_container">
  33. <a type="text" size="small" @click="printStock(scope.row)">打印标签</a>
  34. </template>
  35. </el-table-column>
  36. <el-table-column
  37. prop="site"
  38. header-align="center"
  39. align="left"
  40. min-width="70"
  41. label="工厂编码">
  42. </el-table-column>
  43. <el-table-column
  44. prop="partNo"
  45. header-align="center"
  46. align="left"
  47. min-width="100"
  48. label="物料编码">
  49. </el-table-column>
  50. <el-table-column
  51. prop="partDesc"
  52. header-align="center"
  53. align="left"
  54. min-width="200"
  55. label="物料名称">
  56. </el-table-column>
  57. <el-table-column
  58. prop="qtyOnHand"
  59. header-align="center"
  60. align="right"
  61. min-width="80"
  62. label="当前库存">
  63. </el-table-column>
  64. <el-table-column
  65. prop="warehouseID"
  66. header-align="center"
  67. align="left"
  68. min-width="80"
  69. label="仓库编码">
  70. </el-table-column>
  71. <el-table-column
  72. prop="locationID"
  73. header-align="center"
  74. align="left"
  75. min-width="80"
  76. label="库位Id">
  77. </el-table-column>
  78. <el-table-column
  79. prop="batchNo"
  80. header-align="center"
  81. align="left"
  82. min-width="110"
  83. label="批号">
  84. </el-table-column>
  85. <el-table-column
  86. prop="manufactureDate"
  87. header-align="center"
  88. align="left"
  89. min-width="130"
  90. label="生产日期">
  91. </el-table-column>
  92. <el-table-column
  93. prop="expiredDate"
  94. header-align="center"
  95. align="left"
  96. min-width="130"
  97. label="失效日期">
  98. </el-table-column>
  99. </el-table>
  100. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  101. </div>
  102. </template>
  103. <script>
  104. import {
  105. getStockPrint
  106. } from "@/api/production/schedule.js"
  107. import Chooselist from '@/views/modules/common/Chooselist'
  108. import {
  109. printMaterialLabelPreview,
  110. } from "@/views/modules/print/label/print_stock_label_preview.js"
  111. export default {
  112. name: 'soscheduleRouting',
  113. components: {
  114. Chooselist
  115. },
  116. data () {
  117. return {
  118. site: this.$store.state.user.site,
  119. operatorType: 0,
  120. height: 200,
  121. tableData: [],
  122. date1: '',
  123. searchData: {
  124. partNo: '',
  125. zeroSql:' AND QtyOnHand >0.0001',
  126. batchNo:'',
  127. },
  128. photoUrl:'',
  129. sopData:{
  130. site:'',
  131. partNo:'',
  132. },
  133. partDescription:'',
  134. fileTitle:'',
  135. fileName:'',
  136. num:1,
  137. currentData:'',
  138. photoDatas:[],
  139. uploadImg:[],
  140. showviewer: false,
  141. url: '',
  142. height2:600,
  143. }
  144. },
  145. mounted () {
  146. this.$nextTick(() => {
  147. this.height = window.innerHeight - 210
  148. this.height2 = window.innerHeight -100
  149. })
  150. },
  151. methods: {
  152. // 获取基础数据列表S
  153. getBaseList (val,type) {
  154. this.tagNo = val
  155. this.$nextTick(() => {
  156. let strVal = ''
  157. if (val === 5) {
  158. strVal = this.searchData.partNo
  159. }
  160. this.$refs.baseList.init(val, strVal)
  161. })
  162. },
  163. /* 列表方法的回调 */
  164. getBaseData (val) {
  165. if (this.tagNo === 5) {
  166. this.searchData.partNo = val.PartNo
  167. }
  168. },
  169. search () {
  170. if(this.searchData.partNo==''&&this.searchData.batchNo==''){
  171. this.$alert('料号和批次,请至少输入一个条件!', '错误', {
  172. confirmButtonText: '确定'
  173. })
  174. return false;
  175. }
  176. getStockPrint(this.searchData).then(({data}) => {
  177. this.tableData = data.rows
  178. })
  179. },
  180. createExportData () {
  181. return this.tableData
  182. },
  183. startDownload () {
  184. // this.exportData = this.dataList
  185. },
  186. finishDownload () {
  187. },
  188. getStrDate () {
  189. let dd = new Date()
  190. let Y = dd.getFullYear()
  191. let M = (dd.getMonth() + 1) < 10 ? '0' + (dd.getMonth() + 1) : (dd.getMonth() + 1)// 获取当前月份的日期,不足10补0
  192. let D = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()// 获取当前几号,不足10补0
  193. let H = dd.getHours() < 10 ? '0' + dd.getHours() : dd.getHours()
  194. let MM = dd.getMinutes() < 10 ? '0' + dd.getMinutes() : dd.getMinutes()
  195. let S = dd.getSeconds() < 10 ? '0' + dd.getSeconds() : dd.getSeconds()
  196. return Y + M + D + H + MM + S
  197. },
  198. printStock(row){
  199. let array=[];
  200. let data={
  201. seqNo:row.site+'|'+row.partNo+'|'+row.warehouseID+'|'+row.batchNo+'|'+row.locationID,
  202. site:row.site,
  203. wareHouseId:row.warehouseID,
  204. batchNo:row.batchNo,
  205. locationId:row.locationID,
  206. partNo:row.partNo,
  207. partDesc:row.partDesc,
  208. partSpec:row.partSpec,
  209. wareHouseDesc:row.wareHouseDesc,
  210. orderNo:row.orderNo,
  211. transDate:row.transDate,
  212. manufactureDate:row.manufactureDate,
  213. qty:row.qtyOnHand,
  214. umid:row.umid
  215. }
  216. array.push(data)
  217. printMaterialLabelPreview(array);
  218. },
  219. },
  220. created () {
  221. }
  222. }
  223. </script>
  224. <style scoped>
  225. .input_left{
  226. text-align: left;
  227. }
  228. .input_reight{
  229. text-align: right;
  230. }
  231. /deep/ input::-webkit-inner-spin-button {
  232. -webkit-appearance: none !important;
  233. }
  234. input[type='number'] {
  235. -moz-appearance: textfield !important;
  236. }
  237. </style>