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

302 lines
8.2 KiB

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