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

453 lines
14 KiB

5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
4 years ago
5 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
4 years ago
5 years ago
4 years ago
4 years ago
5 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
4 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 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.taskNo" style="width: 120px"></el-input>
  6. </el-form-item >
  7. <el-form-item >
  8. <span slot="label" style="" @click="getBaseList(5)"><a herf="#">物料编码</a></span>
  9. <el-input v-model="searchData.partNo" style="width: 120px"></el-input>
  10. </el-form-item>
  11. <el-form-item :label="'合并日期:'">
  12. <el-date-picker
  13. style="width: 130px"
  14. v-model="searchData.startDate"
  15. type="date"
  16. value-format="yyyy-MM-dd"
  17. placeholder="选择日期">
  18. </el-date-picker>
  19. </el-form-item>
  20. <el-form-item style="margin-top: 23px;">
  21. <laber style="margin-left: -9px;font-size: 19px">&#10142</laber>
  22. </el-form-item>
  23. <el-form-item :label="' '">
  24. <el-date-picker
  25. style="width: 130px"
  26. v-model="searchData.endDate"
  27. type="date"
  28. value-format="yyyy-MM-dd"
  29. placeholder="选择日期">
  30. </el-date-picker>
  31. </el-form-item>
  32. <el-form-item :label="'是否报工:'">
  33. <el-select filterable v-model="searchData.reportFlag" style="width: 120px">
  34. <el-option label="全部" value=""></el-option>
  35. <el-option label="否" value="N"></el-option>
  36. <el-option label="是" value="Y"></el-option>
  37. </el-select>
  38. </el-form-item>
  39. <el-form-item :label="' '">
  40. <el-button @click="search()" style="margin-left: 0px;margin-top: 0px" type="primary">查询</el-button>
  41. </el-form-item>
  42. </el-form>
  43. <el-table
  44. :height="height"
  45. :data="tableData"
  46. border
  47. style="width: 100%">
  48. <el-table-column
  49. prop=""
  50. header-align="center"
  51. align="center"
  52. min-width="160"
  53. label="操作">
  54. <template slot-scope="scope" class="foo_container">
  55. <a type="text" size="small" @click="printHunlianCard(scope.row)">混炼任务单</a>
  56. <a type="text" v-if="scope.row.reportFlag=='N'" size="small" @click="reportTaskModal(scope.row)">报工</a>
  57. <a type="text" v-if="scope.row.reportFlag=='Y'&&scope.row.wareHouseFlag=='N'" size="small" @click="cancelReportTask(scope.row)">取消报工</a>
  58. <a type="text" size="small" @click="printPartCard(scope.row)">物料标识卡</a>
  59. <a type="text" size="small" @click="detailModal(scope.row)">查看周计划明细</a>
  60. <a type="text" v-if="scope.row.reportFlag=='N'" size="small" @click="cancelTask(scope.row)">取消任务</a>
  61. </template>
  62. </el-table-column>
  63. <el-table-column
  64. prop="taskNo"
  65. header-align="center"
  66. align="left"
  67. min-width="80"
  68. label="混炼任务单号">
  69. </el-table-column>
  70. <el-table-column
  71. prop="partNo"
  72. header-align="center"
  73. align="left"
  74. min-width="70"
  75. label="混炼物料编码">
  76. </el-table-column>
  77. <el-table-column
  78. prop="partDesc"
  79. header-align="center"
  80. align="left"
  81. min-width="100"
  82. label="混炼胶名称">
  83. </el-table-column>
  84. <el-table-column
  85. prop="taskQty"
  86. header-align="center"
  87. align="right"
  88. min-width="100"
  89. label="混炼胶数量">
  90. </el-table-column>
  91. <el-table-column
  92. prop="createDate"
  93. header-align="center"
  94. align="left"
  95. min-width="70"
  96. label="合并日期">
  97. </el-table-column>
  98. <el-table-column
  99. prop="createBy"
  100. header-align="center"
  101. align="left"
  102. min-width="70"
  103. label="创建人">
  104. </el-table-column>
  105. <el-table-column
  106. prop="reportFlag"
  107. header-align="center"
  108. align="left"
  109. min-width="70"
  110. label="是否报工">
  111. </el-table-column>
  112. <el-table-column
  113. prop="reportQty"
  114. header-align="center"
  115. align="right"
  116. min-width="70"
  117. label="报工数量">
  118. </el-table-column>
  119. <el-table-column
  120. prop="wareHouseFlag"
  121. header-align="center"
  122. align="left"
  123. min-width="70"
  124. label="是否入库">
  125. </el-table-column>
  126. </el-table>
  127. <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-drag title="周计划清单" :visible.sync="detailFlag" width="600px">
  128. <el-table
  129. height="300"
  130. :data="detailList"
  131. border
  132. style="width: 100%">
  133. <el-table-column
  134. prop="taskNo"
  135. header-align="center"
  136. align="left"
  137. min-width="80"
  138. label="混炼任务单号">
  139. </el-table-column>
  140. <el-table-column
  141. prop="orderNo"
  142. header-align="center"
  143. align="left"
  144. min-width="70"
  145. label="周计划号">
  146. </el-table-column>
  147. <el-table-column
  148. prop="partDesc"
  149. header-align="center"
  150. align="left"
  151. min-width="100"
  152. label="混炼胶名称">
  153. </el-table-column>
  154. <el-table-column
  155. prop="orderQty"
  156. header-align="center"
  157. align="right"
  158. min-width="70"
  159. label="周计划数量">
  160. </el-table-column>
  161. <el-table-column
  162. prop="hunlianQty"
  163. header-align="center"
  164. align="right"
  165. min-width="70"
  166. label="混炼胶数量">
  167. </el-table-column>
  168. <el-table-column
  169. prop="orderDate"
  170. header-align="center"
  171. align="left"
  172. min-width="100"
  173. label="周计划日期">
  174. </el-table-column>
  175. </el-table>
  176. <span slot="footer" class="dialog-footer">
  177. <el-button @click="detailFlag = false" type="primary">关闭</el-button>
  178. </span>
  179. </el-dialog>
  180. <el-dialog title="保存报工" :close-on-click-modal="false" v-drag :visible.sync="reportModalFlag" width="470px">
  181. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  182. <el-form-item :label="'任务单号:'">
  183. <el-input v-model="reportData.taskNo" disabled style="width: 130px"></el-input>
  184. </el-form-item>
  185. <el-form-item :label="'所需数量:'">
  186. <el-input v-model="reportData.qtyRequired" disabled style="width: 130px"></el-input>
  187. </el-form-item>
  188. <el-form-item :label="'库存数量:'">
  189. <el-input v-model="reportData.qtyOnHand" disabled style="width: 130px"></el-input>
  190. </el-form-item>
  191. </el-form>
  192. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: 0px;">
  193. <el-form-item :label="'混炼胶报工重量:'">
  194. <el-input v-model="reportData.qtyReal" type="number" style="width: 130px"></el-input>
  195. </el-form-item>
  196. <el-form-item :label="'库存抵扣数量:'">
  197. <el-input v-model="reportData.qtyRef" type="number" style="width: 130px"></el-input>
  198. </el-form-item>
  199. </el-form>
  200. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  201. <el-button type="primary" @click="reportSave()">保存</el-button>
  202. <el-button type="primary" @click="reportModalFlag = false">关闭</el-button>
  203. </el-footer>
  204. </el-dialog>
  205. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  206. </div>
  207. </template>
  208. <script>
  209. import {
  210. getHunlianTaskData,getHunlianTaskDetailData
  211. ,cancelTask,reportTask,cancelReportTask,getPartNoOnHand,getHunLianPrintData
  212. } from "@/api/production.js"
  213. import {
  214. printTransNoLabel,
  215. } from "@/views/modules/print/print_transNo_label.js"
  216. import {
  217. printHunlianLabel,
  218. } from "@/views/modules/print/print_hunlian_card.js"
  219. import {
  220. printPartLabel,
  221. } from "@/views/modules/print/print_part_label.js"
  222. import decimalUtil from '../../../utils/decimalUtil'
  223. import Chooselist from '@/views/modules/common/Chooselist'
  224. export default {
  225. components: {
  226. Chooselist
  227. },
  228. data () {
  229. return {
  230. searchData:{
  231. taskNo:'',
  232. partNo:'',
  233. startDate:'',
  234. endDate:'',
  235. reportFlag:'N',
  236. },
  237. height:200,
  238. tagNo:'',
  239. tableData:[],
  240. detailList:[],
  241. detailFlag:false,
  242. reportModalFlag:false,
  243. reportData:{
  244. site:'',
  245. taskNo:'',
  246. qtyRequired: '',
  247. reportQty:'',
  248. qtyOnHand:'',
  249. qtyReal:'',
  250. qtyRef:'',
  251. }
  252. }
  253. },
  254. mounted() {
  255. this.$nextTick(()=>{
  256. this.height = window.innerHeight - 180;
  257. })
  258. },
  259. methods: {
  260. getBaseList (val,type) {
  261. this.tagNo = val
  262. this.$nextTick(() => {
  263. let strVal = ''
  264. if (val === 5) {
  265. strVal = this.searchData.partNo
  266. }
  267. this.$refs.baseList.init(val, strVal)
  268. })
  269. },
  270. /* 列表方法的回调 */
  271. getBaseData (val) {
  272. if (this.tagNo === 5) {
  273. this.searchData.partNo = val.PartNo
  274. }
  275. },
  276. search(){
  277. getHunlianTaskData(this.searchData).then(({data}) => {
  278. this.tableData = data.rows;
  279. })
  280. },
  281. detailModal(row){
  282. let inData={
  283. site:row.site,
  284. taskNo:row.taskNo,
  285. }
  286. getHunlianTaskDetailData(inData).then(({data}) => {
  287. this.detailList = data.rows;
  288. })
  289. this.detailFlag=true;
  290. },
  291. getPartNoOnHand(site,partNo){
  292. let inData={
  293. site:site,
  294. partNo:partNo,
  295. }
  296. getPartNoOnHand(inData).then(({data}) => {
  297. if (data && data.code === 0) {
  298. if(data.row!=null){
  299. this.reportData.qtyOnHand=data.row.qtyOnHand;
  300. }else {
  301. this.reportData.qtyOnHand=0;
  302. }
  303. } else {
  304. this.$alert(data.msg, '错误', {
  305. confirmButtonText: '确定'
  306. })
  307. }
  308. })
  309. },
  310. printHunlianCard(row){
  311. getHunLianPrintData(row).then(({data}) => {
  312. if (data && data.code === 0) {
  313. if(data.rows.length>0){
  314. let array=[];
  315. array.push(data.rows[0])
  316. printHunlianLabel(array)
  317. }
  318. }
  319. })
  320. },
  321. printPartCard(row){
  322. let array=[];
  323. let data={
  324. // printerName:'大标签打印机',
  325. orderNo:'*',
  326. userId:this.$store.state.user.name,
  327. partNo:row.partNo,
  328. sScheduledDate:row.createDate,
  329. operatorName:this.$store.state.user.name,
  330. partDesc:row.partDesc,
  331. qtyRequired:row.taskQty,
  332. toExpireDays:row.toExpireDays,
  333. remark:row.remark,
  334. }
  335. array.push(data)
  336. printPartLabel(array)
  337. },
  338. cancelTask(row){
  339. this.$confirm(`是否删除混炼任务单?`, '提示', {
  340. confirmButtonText: '确定',
  341. cancelButtonText: '取消',
  342. type: 'warning'
  343. }).then(() => {
  344. cancelTask(row).then(({data}) => {
  345. if (data && data.code === 0) {
  346. this.search ();
  347. this.$message({
  348. message: '操作成功',
  349. type: 'success',
  350. duration: 1500,
  351. onClose: () => {
  352. }
  353. })
  354. } else {
  355. this.$alert(data.msg, '错误', {
  356. confirmButtonText: '确定'
  357. })
  358. }
  359. })
  360. }).catch(() => {
  361. })
  362. },
  363. reportTaskModal(row){
  364. this.reportData.site=row.site;
  365. this.reportData.taskNo=row.taskNo;
  366. this.reportData.qtyRequired=row.taskQty;
  367. this.reportData.reportQty='';
  368. this.reportData.partNo=row.partNo;
  369. this.reportData.userId=row.userId;
  370. this.reportData.qtyReal=0;
  371. this.reportData.qtyRef=0;
  372. this.getPartNoOnHand(row.site,row.partNo);
  373. this.reportModalFlag=true;
  374. },
  375. cancelReportTask(row){
  376. this.$confirm(`是否取消报工?`, '提示', {
  377. confirmButtonText: '确定',
  378. cancelButtonText: '取消',
  379. type: 'warning'
  380. }).then(() => {
  381. cancelReportTask(row).then(({data}) => {
  382. if (data && data.code === 0) {
  383. this.search ();
  384. } else {
  385. this.$alert(data.msg, '错误', {
  386. confirmButtonText: '确定'
  387. })
  388. }
  389. })
  390. }).catch(() => {
  391. })
  392. },
  393. reportSave(){
  394. this.reportData.reportQty=Number(Number(this.reportData.qtyReal)+Number(this.reportData.qtyRef)).toFixed(2);
  395. if(this.reportData.reportQty<this.reportData.qtyRequired){
  396. this.$alert('报工数量不足,无法报工!', '错误', {
  397. confirmButtonText: '确定'
  398. })
  399. return false
  400. }
  401. this.$confirm(`确认是否报工?`, '提示', {
  402. confirmButtonText: '确定',
  403. cancelButtonText: '取消',
  404. type: 'warning'
  405. }).then(() => {
  406. reportTask(this.reportData).then(({data}) => {
  407. if (data && data.code === 0) {
  408. this.search ();
  409. this.reportModalFlag=false;
  410. data.printData.seqNo='*'
  411. let inList=[];
  412. inList.push(data.printData)
  413. printTransNoLabel(inList)
  414. this.$message({
  415. message: '操作成功',
  416. type: 'success',
  417. duration: 1500,
  418. onClose: () => {
  419. }
  420. })
  421. } else {
  422. this.$alert(data.msg, '错误', {
  423. confirmButtonText: '确定'
  424. })
  425. }
  426. })
  427. }).catch(() => {
  428. })
  429. }
  430. },
  431. created() {
  432. }
  433. }
  434. </script>
  435. <style >
  436. .el-table .cell {
  437. padding: 0px;
  438. }
  439. </style>