赫艾前端
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.

307 lines
8.3 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 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 :label="'工厂编码:'">
  5. <el-input v-model="searchData.site" style="width: 120px"></el-input>
  6. </el-form-item>
  7. <el-form-item :label="'入库日期:'">
  8. <el-date-picker
  9. style="width: 130px"
  10. v-model="searchData.startDate"
  11. value-format="yyyy-MM-dd"
  12. placeholder="选择日期">
  13. </el-date-picker>
  14. </el-form-item>
  15. <el-form-item :label="'至: '">
  16. <el-date-picker
  17. style="width: 130px"
  18. v-model="searchData.endDate"
  19. type="date"
  20. value-format="yyyy-MM-dd"
  21. placeholder="选择日期">
  22. </el-date-picker>
  23. </el-form-item>
  24. <el-form-item >
  25. <span slot="label" style="" @click="getBaseList(5)"><a herf="#">物料编码</a></span>
  26. <el-input v-model="searchData.partNo" style="width: 120px"></el-input>
  27. </el-form-item>
  28. <el-form-item :label="'生产订单号:'">
  29. <el-input v-model="searchData.orderNo" style="width: 120px"></el-input>
  30. </el-form-item>
  31. <el-form-item :label="'批次号:'">
  32. <el-input v-model="searchData.batchNo" style="width: 120px"></el-input>
  33. </el-form-item>
  34. <el-form-item :label="'是否打印:'">
  35. <el-select filterable v-model="searchData.printFlag" style="width: 120px">
  36. <el-option label="全部" value=""></el-option>
  37. <el-option label="是" value="Y"></el-option>
  38. <el-option label="否" value="N"></el-option>
  39. </el-select>
  40. </el-form-item>
  41. <el-form-item :label="' '">
  42. <el-button @click="search()" style="margin-left: 0px;margin-top:0px" type="primary">查询</el-button>
  43. </el-form-item>
  44. </el-form>
  45. <el-table
  46. :height="height"
  47. :data="tableData"
  48. border
  49. style="width: 100%">
  50. <el-table-column
  51. prop=""
  52. header-align="center"
  53. align="center"
  54. min-width="60"
  55. label="操作">
  56. <template slot-scope="scope" class="foo_container">
  57. <a type="text" size="small" @click="printStock(scope.row)">打印标签</a>
  58. </template>
  59. </el-table-column>
  60. <el-table-column
  61. prop="site"
  62. header-align="center"
  63. align="left"
  64. min-width="70"
  65. label="工厂编码">
  66. </el-table-column>
  67. <el-table-column
  68. prop="partNo"
  69. header-align="center"
  70. align="left"
  71. min-width="100"
  72. label="物料编码">
  73. </el-table-column>
  74. <el-table-column
  75. prop="partDesc"
  76. header-align="center"
  77. align="left"
  78. min-width="200"
  79. label="物料名称">
  80. </el-table-column>
  81. <el-table-column
  82. prop="qty"
  83. header-align="center"
  84. align="right"
  85. min-width="80"
  86. label="数量">
  87. </el-table-column>
  88. <el-table-column
  89. prop="orderNo"
  90. header-align="center"
  91. align="left"
  92. min-width="100"
  93. label="生产订单号">
  94. </el-table-column>
  95. <el-table-column
  96. prop="transDate"
  97. header-align="center"
  98. align="left"
  99. min-width="160"
  100. label="入库时间">
  101. </el-table-column>
  102. <el-table-column
  103. prop="transNo"
  104. header-align="center"
  105. align="left"
  106. min-width="120"
  107. label="入库单号">
  108. </el-table-column>
  109. <el-table-column
  110. prop="wareHouseId"
  111. header-align="center"
  112. align="left"
  113. min-width="80"
  114. label="仓库编码">
  115. </el-table-column>
  116. <el-table-column
  117. prop="locationId"
  118. header-align="center"
  119. align="left"
  120. min-width="80"
  121. label="库位Id">
  122. </el-table-column>
  123. <el-table-column
  124. prop="batchNo"
  125. header-align="center"
  126. align="left"
  127. min-width="110"
  128. label="批号">
  129. </el-table-column>
  130. <el-table-column
  131. prop="printFlag"
  132. header-align="center"
  133. align="left"
  134. min-width="80"
  135. label="是否打印">
  136. </el-table-column>
  137. </el-table>
  138. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  139. </div>
  140. </template>
  141. <script>
  142. import {
  143. getStockPrint
  144. , updatePrintStock
  145. } from '@/api/production/generateReport.js'
  146. import Chooselist from '@/views/modules/common/Chooselist'
  147. import {
  148. printMaterialLabelPreview,
  149. } from "@/views/modules/print/print_stock_label_preview.js"
  150. export default {
  151. name: 'soscheduleRouting',
  152. components: {
  153. Chooselist
  154. },
  155. data () {
  156. return {
  157. site: this.$store.state.user.site,
  158. operatorType: 0,
  159. height: 200,
  160. tableData: [],
  161. date1: '',
  162. searchData: {
  163. orderNo: '',
  164. partNo: '',
  165. site: '',
  166. startDate:new Date(),
  167. endDate:'',
  168. printFlag:'N',
  169. seqNo:'',
  170. batchNo:'',
  171. },
  172. photoUrl:'',
  173. sopData:{
  174. site:'',
  175. partNo:'',
  176. },
  177. partDescription:'',
  178. fileTitle:'',
  179. fileName:'',
  180. num:1,
  181. currentData:'',
  182. photoDatas:[],
  183. uploadImg:[],
  184. showviewer: false,
  185. url: '',
  186. height2:600,
  187. }
  188. },
  189. mounted () {
  190. this.$nextTick(() => {
  191. this.height = window.innerHeight - 210
  192. this.height2 = window.innerHeight -100
  193. })
  194. },
  195. methods: {
  196. // 获取基础数据列表S
  197. getBaseList (val,type) {
  198. this.tagNo = val
  199. this.$nextTick(() => {
  200. let strVal = ''
  201. if (val === 5) {
  202. strVal = this.searchData.partNo
  203. }
  204. this.$refs.baseList.init(val, strVal)
  205. })
  206. },
  207. /* 列表方法的回调 */
  208. getBaseData (val) {
  209. if (this.tagNo === 5) {
  210. this.searchData.partNo = val.PartNo
  211. }
  212. },
  213. search () {
  214. getStockPrint(this.searchData).then(({data}) => {
  215. this.tableData = data.rows
  216. })
  217. },
  218. createExportData () {
  219. return this.tableData
  220. },
  221. startDownload () {
  222. // this.exportData = this.dataList
  223. },
  224. finishDownload () {
  225. },
  226. getStrDate () {
  227. let dd = new Date()
  228. let Y = dd.getFullYear()
  229. let M = (dd.getMonth() + 1) < 10 ? '0' + (dd.getMonth() + 1) : (dd.getMonth() + 1)// 获取当前月份的日期,不足10补0
  230. let D = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()// 获取当前几号,不足10补0
  231. let H = dd.getHours() < 10 ? '0' + dd.getHours() : dd.getHours()
  232. let MM = dd.getMinutes() < 10 ? '0' + dd.getMinutes() : dd.getMinutes()
  233. let S = dd.getSeconds() < 10 ? '0' + dd.getSeconds() : dd.getSeconds()
  234. return Y + M + D + H + MM + S
  235. },
  236. printStock(row){
  237. let array=[];
  238. let data={
  239. seqNo:row.site+'|'+row.partNo+'|'+row.wareHouseId+'|'+row.batchNo+'|'+row.locationId,
  240. site:row.site,
  241. wareHouseId:row.wareHouseId,
  242. batchNo:row.batchNo,
  243. locationId:row.locationId,
  244. partNo:row.partNo,
  245. partDesc:row.partDesc,
  246. wareHouseDesc:row.wareHouseDesc,
  247. orderNo:row.orderNo,
  248. qty:row.qty,
  249. umid:row.umid,
  250. transDate:row.transDate,
  251. expiredDate:row.expiredDate,
  252. status:row.status,
  253. weight:row.weight
  254. }
  255. array.push(data)
  256. printMaterialLabelPreview(array);
  257. let inData={
  258. transNo:row.transNo,
  259. site:row.site
  260. }
  261. updatePrintStock(inData).then(({data}) => {
  262. if (data && data.code === 0) {
  263. this.search ();
  264. this.$message({
  265. message: '操作成功',
  266. type: 'success',
  267. duration: 1500,
  268. onClose: () => {
  269. }
  270. })
  271. }else {
  272. this.$alert(data.msg, '错误', {
  273. confirmButtonText: '确定'
  274. })
  275. }
  276. })
  277. },
  278. },
  279. created () {
  280. }
  281. }
  282. </script>
  283. <style scoped>
  284. .input_left{
  285. text-align: left;
  286. }
  287. .input_reight{
  288. text-align: right;
  289. }
  290. /deep/ input::-webkit-inner-spin-button {
  291. -webkit-appearance: none !important;
  292. }
  293. input[type='number'] {
  294. -moz-appearance: textfield !important;
  295. }
  296. </style>