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.

909 lines
34 KiB

  1. <template>
  2. <div class="mod-config">
  3. <el-form
  4. :inline="true"
  5. label-position="top"
  6. style="margin-top: 20px; position: fixed; top: 55px;left: 227px; z-index: 1000; background-color: white; padding: 10px; width: 100%;min-width: 1028px;max-width: 1292px;border: 3px solid #17B3A3;">
  7. <el-form-item label="生产订单号(不支持模糊查询)">
  8. <el-input v-model="searchData.orderNo" style="width: 130px"></el-input>
  9. <el-checkbox
  10. v-model="searchData.status"
  11. label="status"
  12. style="margin-left: 10px"
  13. true-label="有效"
  14. false-label="无效"
  15. >
  16. 仅查询有效的SOP
  17. </el-checkbox>
  18. <el-button @click="getDataList()" type="primary" style="margin-left: 2px;margin-top: 0px">查询</el-button>
  19. </el-form-item>
  20. </el-form>
  21. <br></br>
  22. <br></br>
  23. <fieldset style="margin-top: 5px; width: 100%;min-width: 1020px">
  24. <legend>产品SOP信息</legend>
  25. <el-form :inline="true" :model="modelData" label-position="top" label-width="100px" style="margin-top: 0px;">
  26. <el-form-item label="客户" prop="uCustomer">
  27. <el-input v-model="modelData.uCustomer" readonly style="width: 310px"></el-input>
  28. </el-form-item>
  29. <el-form-item label="机种" prop="uModel" style="margin-left: 15px">
  30. <el-input v-model="modelData.uModel" readonly style="width: 141px"></el-input>
  31. </el-form-item>
  32. <el-form-item label="颜色标识" prop="uColorID" style="margin-left: 15px">
  33. <el-input v-model="modelData.uColorID" readonly style="width: 141px"></el-input>
  34. </el-form-item>
  35. <el-form-item label="生产通知单" prop="docEntry" style="margin-left: 15px">
  36. <el-input v-model="modelData.docEntry" readonly style="width: 141px"></el-input>
  37. </el-form-item>
  38. <el-form-item label="日期" prop="postDate" style="margin-left: 15px">
  39. <el-input v-model="modelData.postDate" readonly style="width: 141px"></el-input>
  40. </el-form-item>
  41. </el-form>
  42. <el-form :inline="true" :model="modelData" label-position="top" label-width="100px" style="margin-top: 0px;">
  43. <el-form-item label="客户料号" prop="uPn">
  44. <el-input v-model="modelData.uPn" readonly style="width: 310px"></el-input>
  45. </el-form-item>
  46. <el-form-item label="二阶料号" prop="uPn2" style="margin-left: 15px">
  47. <el-input v-model="modelData.uPn2" readonly style="width: 141px"></el-input>
  48. </el-form-item>
  49. <el-form-item label="样品卡号" prop="uSmplCard" style="margin-left: 15px">
  50. <el-input v-model="modelData.uSmplCard" readonly style="width: 141px"></el-input>
  51. </el-form-item>
  52. <el-form-item label="交期" prop="dueDate" style="margin-left: 15px">
  53. <el-input v-model="modelData.dueDate" readonly style="width: 141px"></el-input>
  54. </el-form-item>
  55. <el-form-item label="库存数量" prop="onHand" style="margin-left: 15px">
  56. <el-input v-model="modelData.onHand" readonly style="width: 141px"></el-input>
  57. </el-form-item>
  58. </el-form>
  59. <el-form :inline="true" :model="modelData" label-position="top" label-width="100px" style="margin-top: 0px;">
  60. <el-form-item label="料号" prop="itemCode">
  61. <el-input v-model="modelData.itemCode" readonly style="width: 310px"></el-input>
  62. </el-form-item>
  63. <el-form-item label="计划数量" prop="plannedQty" style="margin-left: 15px">
  64. <el-input v-model="modelData.plannedQty + modelData.comments + modelData.uPackunit" readonly style="width: 310px"></el-input>
  65. </el-form-item>
  66. <el-form-item label="制程" prop="uProcess" style="margin-left: 15px">
  67. <el-input v-model="modelData.uProcess" readonly style="width: 310px"></el-input>
  68. </el-form-item>
  69. </el-form>
  70. <el-form :inline="true" :model="modelData" label-position="top" label-width="100px" style="margin-top: 0px;">
  71. <el-form-item label="打样原因" prop="uStatus">
  72. <el-input v-model="modelData.uStatus" readonly style="width: 310px"></el-input>
  73. </el-form-item>
  74. <el-form-item label="送样数量" prop="uBhbum" style="margin-left: 15px">
  75. <el-input v-model="modelData.uBhbum" readonly style="width: 141px"></el-input>
  76. </el-form-item>
  77. <el-form-item label="尺寸" prop="uDimen" style="margin-left: 15px">
  78. <el-input v-model="modelData.uDimen" readonly style="width: 141px"></el-input>
  79. </el-form-item>
  80. <el-form-item label="跳距" prop="docEntry" style="margin-left: 15px">
  81. <el-input v-model="modelData.docEntry" readonly style="width: 141px"></el-input>
  82. </el-form-item>
  83. <el-form-item label="包装方式" prop="uPackage" style="margin-left: 15px">
  84. <el-input v-model="modelData.uPackage" readonly style="width: 141px"></el-input>
  85. </el-form-item>
  86. </el-form>
  87. <el-form :inline="true" :model="modelData" label-position="top" label-width="100px" style="margin-top: 0px;">
  88. <el-form-item label="物料描述" prop="itemName">
  89. <el-input v-model="modelData.itemName" readonly style="width: 480px"></el-input>
  90. </el-form-item>
  91. <el-form-item label="R角" prop="uRangle" style="margin-left: 15px">
  92. <el-input v-model="modelData.uRangle" readonly style="width: 141px"></el-input>
  93. </el-form-item>
  94. <el-form-item label="C角" prop="uCangle" style="margin-left: 15px">
  95. <el-input v-model="modelData.uCangle" readonly style="width: 141px"></el-input>
  96. </el-form-item>
  97. </el-form>
  98. <el-form :inline="true" :model="modelData" label-position="top" label-width="100px" style="margin-top: 0px;">
  99. <el-form-item label="注意事项" prop="uAttn">
  100. <el-input
  101. readonly
  102. type="textarea"
  103. v-model="modelData.uAttn"
  104. style="width: 480px"
  105. :rows="3">
  106. </el-input>
  107. </el-form-item>
  108. <el-form-item label="上下间距" prop="uUddist" style="margin-left: 15px">
  109. <el-input v-model="modelData.uUddist" readonly style="width: 141px"></el-input>
  110. </el-form-item>
  111. <el-form-item label="左右间距" prop="uLrdist" style="margin-left: 15px">
  112. <el-input v-model="modelData.uLrdist" readonly style="width: 141px"></el-input>
  113. </el-form-item>
  114. <el-form-item label="其他保证标识要求" prop="uPackDesp" style="margin-left: 15px">
  115. <el-input
  116. readonly
  117. type="textarea"
  118. v-model="modelData.uPackDesp"
  119. style="width: 140px"
  120. :rows="7">
  121. </el-input>
  122. </el-form-item>
  123. </el-form>
  124. <el-form :inline="true" :model="modelData" label-position="top" label-width="100px" style="margin-top: 0px;margin-left: 509px">
  125. <el-form-item label="边距" prop="uEdge">
  126. <el-input v-model="modelData.uEdge" readonly style="width: 141px;"></el-input>
  127. </el-form-item>
  128. <el-form-item label="虚线" prop="uDotline" style="margin-left: 15px">
  129. <el-input v-model="modelData.uDotline" readonly style="width: 141px"></el-input>
  130. </el-form-item>
  131. </el-form>
  132. <el-form :inline="true" :model="modelData" label-position="top" label-width="100px" style="margin-top: 0px;">
  133. <el-form-item label="SIP" prop="uSip">
  134. <el-input v-model="modelData.uSip" readonly style="width: 310px"></el-input>
  135. </el-form-item>
  136. <el-form-item label="样品卡" prop="uYangpinno" style="margin-left: 186px">
  137. <el-input v-model="modelData.uYangpinno" readonly style="width: 310px"></el-input>
  138. </el-form-item>
  139. </el-form>
  140. <el-form :inline="true" :model="modelData" label-position="top" label-width="100px" style="margin-top: 0px;">
  141. <el-form-item label="检查记录表" prop="uChSheet">
  142. <el-input v-model="modelData.uChSheet" readonly style="width: 310px"></el-input>
  143. </el-form-item>
  144. </el-form>
  145. <el-form :inline="true" :model="modelData" label-position="top" label-width="100px" style="margin-top: 0px;">
  146. <el-form-item label="刀模编号" prop="uMold">
  147. <el-input v-model="modelData.uMold" readonly style="width: 310px"></el-input>
  148. </el-form-item>
  149. <el-form-item label="刀模仓位" prop="uMoldNo" style="margin-left: 15px">
  150. <el-input v-model="modelData.uMoldNo" readonly style="width: 141px"></el-input>
  151. </el-form-item>
  152. <el-form-item label="刀模编号2" prop="uMold2" style="margin-left: 15px">
  153. <el-input v-model="modelData.uMold2" readonly style="width: 310px"></el-input>
  154. </el-form-item>
  155. <el-form-item label="刀模2仓位" prop="uMoldNo2" style="margin-left: 15px">
  156. <el-input v-model="modelData.uMoldNo2" readonly style="width: 141px"></el-input>
  157. </el-form-item>
  158. </el-form>
  159. <el-form :inline="true" :model="modelData" label-position="top" label-width="100px" style="margin-top: 0px;">
  160. <el-form-item label="菲林编号" prop="uFilm">
  161. <el-input v-model="modelData.uFilm" readonly style="width: 310px"></el-input>
  162. </el-form-item>
  163. <el-form-item label="网版编号" prop="uPlatenum" style="margin-left: 15px">
  164. <el-input v-model="modelData.uPlatenum" readonly style="width: 141px"></el-input>
  165. </el-form-item>
  166. <el-form-item label="网版目数" prop="uPlate" style="margin-left: 15px">
  167. <el-input v-model="modelData.uPlate" readonly style="width: 141px"></el-input>
  168. </el-form-item>
  169. <el-form-item label="模数" prop="uMoldQty" style="margin-left: 184px">
  170. <el-input v-model="modelData.uMoldQty" readonly style="width: 141px"></el-input>
  171. </el-form-item>
  172. </el-form>
  173. <el-form :inline="true" :model="modelData" label-position="top" label-width="100px" style="margin-top: 0px;">
  174. <el-form-item label="油墨型号" prop="uColor">
  175. <el-input v-model="modelData.uColor" readonly style="width: 310px"></el-input>
  176. </el-form-item>
  177. <el-form-item label="UL型号" prop="uUl" style="margin-left: 15px">
  178. <el-input v-model="modelData.uUl" readonly style="width: 310px"></el-input>
  179. </el-form-item>
  180. </el-form>
  181. </fieldset>
  182. <p>BOM物料清单</p>
  183. <el-table
  184. :data="dataList"
  185. :height="height - 230"
  186. border
  187. style="width: 100%;margin-top: -10px">
  188. <el-table-column prop="itemNo" label="序号" headerAlign="center" align="center" width="50px"></el-table-column>
  189. <el-table-column prop="componentPartNo" label="物料号" headerAlign="center" width="170px" align="left"></el-table-column>
  190. <el-table-column prop="partDesc" label="描述" headerAlign="center" align="left"></el-table-column>
  191. <el-table-column prop="qtyRequired" label="计划数量" headerAlign="center" width="100px" align="right"></el-table-column>
  192. <el-table-column prop="qtyOnHand" label="库存" headerAlign="center" width="100px" align="right"></el-table-column>
  193. </el-table>
  194. <el-form :inline="true" :model="modelData" label-position="top" label-width="100px" style="margin-top: 0px;width: 100%;min-width: 1020px">
  195. <el-form-item label="ECN#" prop="uEcn">
  196. <el-input
  197. readonly
  198. type="textarea"
  199. v-model="modelData.uEcn"
  200. style="width: 310px"
  201. :rows="3">
  202. </el-input>
  203. </el-form-item>
  204. <el-form-item label="客诉履历" prop="uAttn2">
  205. <el-input
  206. readonly
  207. type="textarea"
  208. v-model="modelData.uAttn2"
  209. style="width: 310px"
  210. :rows="3">
  211. </el-input>
  212. </el-form-item>
  213. <el-form-item label="检查难度" prop="uCheck">
  214. <el-input v-model="modelData.uCheck" readonly style="width: 141px"></el-input>
  215. </el-form-item>
  216. <el-form-item label="检查时间" prop="uCheckt">
  217. <el-input v-model="modelData.uCheckt" readonly style="width: 141px"></el-input>
  218. </el-form-item>
  219. <el-checkbox
  220. disabled
  221. v-model="modelData.uAttach1"
  222. style="margin-left: 10px;margin-top: 5px"
  223. >附件</el-checkbox>
  224. </el-form>
  225. <el-form :inline="true" :model="modelData" label-position="top" label-width="100px" style="margin-top: -7px;margin-left: 955px">
  226. <el-checkbox
  227. disabled
  228. v-model="modelData.uAttach2"
  229. style="margin-left: 10px"
  230. >图纸</el-checkbox>
  231. </el-form>
  232. <el-form :inline="true" :model="modelData" label-position="top" label-width="100px" style="margin-top: 10px;margin-left: 955px">
  233. <el-checkbox
  234. disabled
  235. v-model="modelData.uAttach3"
  236. style="margin-left: 10px"
  237. >刀线</el-checkbox>
  238. </el-form>
  239. <p>SOP清单</p>
  240. <el-table
  241. :height="height - 170"
  242. :data="sopFileList"
  243. border
  244. highlight-current-row
  245. style="width: 100%;margin-top: -10px">
  246. <el-table-column
  247. v-for="(item,index) in columnSopFileList" :key="index"
  248. :sortable="item.columnSortable"
  249. :prop="item.columnProp"
  250. :header-align="item.headerAlign"
  251. :show-overflow-tooltip="item.showOverflowTooltip"
  252. :align="item.align"
  253. :fixed="item.fixed==''?false:item.fixed"
  254. :min-width="item.columnWidth"
  255. :label="item.columnLabel">
  256. <template slot-scope="scope">
  257. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  258. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  259. style="width: 100px; height: 80px"/></span>
  260. </template>
  261. </el-table-column>
  262. <el-table-column
  263. label="操作"
  264. align="center"
  265. width="100">
  266. <template slot-scope="scope">
  267. <!-- <a type="primary" @click="openDialog(scope.row)">查看</a>-->
  268. <a
  269. type="text" size="small"
  270. @click="viewSopFile(scope.row)"
  271. >查看附件</a>
  272. <a type="text" size="small" @click="downloadFile(scope.row)">下载</a>
  273. </template>
  274. </el-table-column>
  275. </el-table>
  276. <!-- 弹窗 -->
  277. <el-dialog title="附件内容"
  278. :modal="false"
  279. v-dialogDrag
  280. :close-on-click-modal="false"
  281. :visible.sync="dialogVisible" width="427px"
  282. style="margin-top: -91px;">
  283. <!-- 弹窗内容可以根据需求放置附件内容 -->
  284. <div>
  285. <!-- 示例显示 PDF 文件 -->
  286. <!-- <embed :src="this.pdfUrl" type="application/pdf" width="100%" height="490px">-->
  287. <iframe :src="this.pdfUrl" frameborder="0" width="100%" :height="height"></iframe>
  288. </div>
  289. <!-- 弹窗的底部操作 -->
  290. <span slot="footer" class="dialog-footer">
  291. <el-button @click="dialogVisible = false">关闭</el-button>
  292. </span>
  293. </el-dialog>
  294. </div>
  295. </template>
  296. <script>
  297. import {downLoadObjectFile, shopNoticeSearch} from "../../../../api/shopOrder/shopOrder";
  298. import Vue from 'vue'
  299. Vue.directive('dialogDrag', {
  300. bind(el, binding, vnode, oldVnode) {
  301. //弹框可拉伸最小宽高
  302. let minWidth = 400;
  303. let minHeight = 300;
  304. //初始非全屏
  305. let isFullScreen = false;
  306. //当前宽高
  307. let nowWidth = 0;
  308. let nowHight = 0;
  309. //当前顶部高度
  310. let nowMarginTop = 0;
  311. //获取弹框头部(这部分可双击全屏)
  312. const dialogHeaderEl = el.querySelector('.el-dialog__header');
  313. //弹窗
  314. const dragDom = el.querySelector('.el-dialog');
  315. //给弹窗加上overflow auto;不然缩小时框内的标签可能超出dialog;
  316. dragDom.style.overflow = "auto";
  317. //清除选择头部文字效果
  318. dialogHeaderEl.onselectstart = new Function("return false");
  319. //头部加上可拖动cursor
  320. dialogHeaderEl.style.cursor = 'move';
  321. // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
  322. const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
  323. let moveDown = (e) => {
  324. // 鼠标按下,计算当前元素距离可视区的距离
  325. const disX = e.clientX - dialogHeaderEl.offsetLeft;
  326. const disY = e.clientY - dialogHeaderEl.offsetTop;
  327. // 获取到的值带px 正则匹配替换
  328. let styL, styT;
  329. // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
  330. if (sty.left.includes('%')) {
  331. styL = +document.body.clientWidth * (+sty.left.replace(/%/g, '') / 100);
  332. styT = +document.body.clientHeight * (+sty.top.replace(/%/g, '') / 100);
  333. } else {
  334. styL = +sty.left.replace(/px/g, '');
  335. styT = +sty.top.replace(/px/g, '');
  336. };
  337. document.onmousemove = function (e) {
  338. // 通过事件委托,计算移动的距离
  339. const l = e.clientX - disX;
  340. const t = e.clientY - disY;
  341. // 移动当前元素
  342. dragDom.style.left = `${l + styL}px`;
  343. dragDom.style.top = `${t + styT}px`;
  344. //将此时的位置传出去
  345. //binding.value({x:e.pageX,y:e.pageY})
  346. };
  347. document.onmouseup = function (e) {
  348. document.onmousemove = null;
  349. document.onmouseup = null;
  350. };
  351. }
  352. dialogHeaderEl.onmousedown = moveDown;
  353. //双击(头部)效果不想要可以注释
  354. dialogHeaderEl.ondblclick = (e) => {
  355. if (isFullScreen === false) {
  356. nowHight = dragDom.clientHeight;
  357. nowWidth = dragDom.clientWidth;
  358. nowMarginTop = dragDom.style.marginTop;
  359. dragDom.style.left = 0;
  360. dragDom.style.top = 0;
  361. dragDom.style.height = "82VH";
  362. dragDom.style.width = "100VW";
  363. dragDom.style.marginTop = 33;
  364. isFullScreen = true;
  365. dialogHeaderEl.style.cursor = 'initial';
  366. dialogHeaderEl.onmousedown = null;
  367. } else {
  368. dragDom.style.height = "auto";
  369. dragDom.style.width = nowWidth + 'px';
  370. dragDom.style.marginTop = nowMarginTop;
  371. isFullScreen = false;
  372. dialogHeaderEl.style.cursor = 'move';
  373. dialogHeaderEl.onmousedown = moveDown;
  374. }
  375. }
  376. //拉伸(右下方)效果不想要可以注释
  377. let resizeEl = document.createElement("div");
  378. dragDom.appendChild(resizeEl);
  379. //在弹窗右下角加上一个10-10px的控制块
  380. resizeEl.style.cursor = 'se-resize';
  381. resizeEl.style.position = 'absolute';
  382. resizeEl.style.height = '10px';
  383. resizeEl.style.width = '10px';
  384. resizeEl.style.right = '0px';
  385. resizeEl.style.bottom = '0px';
  386. resizeEl.style.zIndex = '99';
  387. //鼠标拉伸弹窗
  388. resizeEl.onmousedown = (e) => {
  389. // 记录初始x位置
  390. let clientX = e.clientX;
  391. // 鼠标按下,计算当前元素距离可视区的距离
  392. let disX = e.clientX - resizeEl.offsetLeft;
  393. let disY = e.clientY - resizeEl.offsetTop;
  394. document.onmousemove = function (e) {
  395. e.preventDefault(); // 移动时禁用默认事件
  396. // 通过事件委托,计算移动的距离
  397. let x = e.clientX - disX + (e.clientX - clientX);//这里 由于elementUI的dialog控制居中的,所以水平拉伸效果是双倍
  398. let y = e.clientY - disY;
  399. //比较是否小于最小宽高
  400. dragDom.style.width = x > minWidth ? `${x}px` : minWidth + 'px';
  401. dragDom.style.height = y > minHeight ? `${y}px` : minHeight + 'px';
  402. };
  403. //拉伸结束
  404. document.onmouseup = function (e) {
  405. document.onmousemove = null;
  406. document.onmouseup = null;
  407. };
  408. }
  409. //拉伸(右边)效果不想要可以注释
  410. let resizeElR = document.createElement("div");
  411. dragDom.appendChild(resizeElR);
  412. //在弹窗右下角加上一个10-10px的控制块
  413. resizeElR.style.cursor = 'w-resize';
  414. resizeElR.style.position = 'absolute';
  415. resizeElR.style.height = '100%';
  416. resizeElR.style.width = '10px';
  417. resizeElR.style.right = '0px';
  418. resizeElR.style.top = '0px';
  419. //鼠标拉伸弹窗
  420. resizeElR.onmousedown = (e) => {
  421. let elW = dragDom.clientWidth;
  422. let EloffsetLeft = dragDom.offsetLeft;
  423. // 记录初始x位置
  424. let clientX = e.clientX;
  425. document.onmousemove = function (e) {
  426. e.preventDefault(); // 移动时禁用默认事件
  427. //右侧鼠标拖拽位置
  428. if (clientX > EloffsetLeft + elW - 10 && clientX < EloffsetLeft + elW) {
  429. //往左拖拽
  430. if (clientX > e.clientX) {
  431. if (dragDom.clientWidth < minWidth) {
  432. } else {
  433. dragDom.style.width = elW - (clientX - e.clientX) * 2 + 'px';
  434. }
  435. }
  436. //往右拖拽
  437. if (clientX < e.clientX) {
  438. dragDom.style.width = elW + (e.clientX - clientX) * 2 + 'px';
  439. }
  440. }
  441. };
  442. //拉伸结束
  443. document.onmouseup = function (e) {
  444. document.onmousemove = null;
  445. document.onmouseup = null;
  446. };
  447. }
  448. //拉伸(左边)效果不想要可以注释
  449. let resizeElL = document.createElement("div");
  450. dragDom.appendChild(resizeElL);
  451. //在弹窗右下角加上一个10-10px的控制块
  452. resizeElL.style.cursor = 'w-resize';
  453. resizeElL.style.position = 'absolute';
  454. resizeElL.style.height = '100%';
  455. resizeElL.style.width = '10px';
  456. resizeElL.style.left = '0px';
  457. resizeElL.style.top = '0px';
  458. //鼠标拉伸弹窗
  459. resizeElL.onmousedown = (e) => {
  460. let elW = dragDom.clientWidth;
  461. let EloffsetLeft = dragDom.offsetLeft;
  462. // 记录初始x位置
  463. let clientX = e.clientX;
  464. document.onmousemove = function (e) {
  465. e.preventDefault(); // 移动时禁用默认事件
  466. //左侧鼠标拖拽位置
  467. if (clientX > EloffsetLeft && clientX < EloffsetLeft + 10) {
  468. //往左拖拽
  469. if (clientX > e.clientX) {
  470. dragDom.style.width = elW + (clientX - e.clientX) * 2 + 'px';
  471. }
  472. //往右拖拽
  473. if (clientX < e.clientX) {
  474. if (dragDom.clientWidth < minWidth) {
  475. } else {
  476. dragDom.style.width = elW - (e.clientX - clientX) * 2 + 'px';
  477. }
  478. }
  479. }
  480. };
  481. //拉伸结束
  482. document.onmouseup = function (e) {
  483. document.onmousemove = null;
  484. document.onmouseup = null;
  485. };
  486. }
  487. // 拉伸(下边)效果不想要可以注释
  488. let resizeElB = document.createElement("div");
  489. dragDom.appendChild(resizeElB);
  490. //在弹窗右下角加上一个10-10px的控制块
  491. resizeElB.style.cursor = 'n-resize';
  492. resizeElB.style.position = 'absolute';
  493. resizeElB.style.height = '10px';
  494. resizeElB.style.width = '100%';
  495. resizeElB.style.left = '0px';
  496. resizeElB.style.bottom = '0px';
  497. //鼠标拉伸弹窗
  498. resizeElB.onmousedown = (e) => {
  499. let EloffsetTop = dragDom.offsetTop;
  500. let ELscrollTop = el.scrollTop;
  501. let clientY = e.clientY;
  502. let elH = dragDom.clientHeight;
  503. document.onmousemove = function (e) {
  504. e.preventDefault(); // 移动时禁用默认事件
  505. //底部鼠标拖拽位置
  506. if (ELscrollTop + clientY > EloffsetTop + elH - 20 && ELscrollTop + clientY < EloffsetTop + elH) {
  507. //往上拖拽
  508. if (clientY > e.clientY) {
  509. if (dragDom.clientHeight < minHeight) {
  510. } else {
  511. dragDom.style.height = elH - (clientY - e.clientY) * 2 + 'px';
  512. }
  513. }
  514. //往下拖拽
  515. if (clientY < e.clientY) {
  516. dragDom.style.height = elH + (e.clientY - clientY) * 2 + 'px';
  517. }
  518. }
  519. };
  520. //拉伸结束
  521. document.onmouseup = function (e) {
  522. document.onmousemove = null;
  523. document.onmouseup = null;
  524. };
  525. }
  526. }
  527. })
  528. export default {
  529. data() {
  530. return {
  531. height: 200,
  532. fileURL: '',
  533. pdfUrl: '',
  534. dataList: [],
  535. sopFileList: [],
  536. dialogVisible: false, // 控制弹窗显示与否
  537. searchData: {
  538. site: this.$store.state.user.site,
  539. userName: this.$store.state.user.name,
  540. orderNo: '',
  541. status: '有效',
  542. },
  543. modelData: {
  544. uCustomer: '',
  545. uModel: '',
  546. uColorID: '',
  547. docEntry: '',
  548. postDate: '',
  549. uPn: '',
  550. uPn2: '',
  551. uSmplCard: '',
  552. dueDate: '',
  553. onHand: '',
  554. itemCode: '',
  555. plannedQty: '',
  556. uProcess: '',
  557. uStatus: '',
  558. uBhbum: '',
  559. uDimen: '',
  560. uPackage: '',
  561. itemName: '',
  562. uRangle: '',
  563. uCangle: '',
  564. uAttn: '',
  565. uUddist: '',
  566. uLrdist: '',
  567. uPackDesp: '',
  568. uDotline: '',
  569. uSip: '',
  570. uYangpinno: '',
  571. uChSheet: '',
  572. uMold: '',
  573. uMoldNo: '',
  574. uMold2: '',
  575. uMoldNo2: '',
  576. uFilm: '',
  577. uPlatenum: '',
  578. uPlate: '',
  579. uMoldQty: '',
  580. uColor: '',
  581. uUl: '',
  582. uEcn: '',
  583. uAttn2: '',
  584. uCheck: '',
  585. uCheckt: '',
  586. uattach1: '',
  587. uattach2: '',
  588. uattach3: '',
  589. uAttach1: false,
  590. uAttach2: false,
  591. uAttach3: false,
  592. comments: '',
  593. uPackunit: '',
  594. uEdge: '',
  595. },
  596. columnSopFileList:[
  597. {
  598. userId: this.$store.state.user.name,
  599. functionId: 103004,
  600. serialNumber: '103004Table4VersionNumber',
  601. tableId: "103004Table3",
  602. tableName: "SOP文件表",
  603. columnProp: "versionNumber",
  604. headerAlign: "center",
  605. align: "center",
  606. columnLabel: "版本号",
  607. columnHidden: false,
  608. columnImage: false,
  609. columnSortable: false,
  610. sortLv: 0,
  611. status: true,
  612. fixed: '',
  613. columnWidth: 50
  614. },
  615. {
  616. userId: this.$store.state.user.name,
  617. functionId: 103004,
  618. serialNumber: '103004Table4FileName',
  619. tableId: "103004Table3",
  620. tableName: "SOP文件表",
  621. columnProp: "fileName",
  622. headerAlign: "center",
  623. align: "left",
  624. columnLabel: "文件名称",
  625. columnHidden: false,
  626. columnImage: false,
  627. columnSortable: false,
  628. sortLv: 0,
  629. status: true,
  630. fixed: '',
  631. columnWidth: 300
  632. },
  633. {
  634. userId: this.$store.state.user.name,
  635. functionId: 103004,
  636. serialNumber: '103004Table4ResourceID',
  637. tableId: "103004Table2",
  638. tableName: "SOP文件表",
  639. columnProp: "resourceInfo",
  640. headerAlign: "center",
  641. align: "left",
  642. columnLabel: "机台编码(名称)",
  643. columnHidden: false,
  644. columnImage: false,
  645. columnSortable: false,
  646. sortLv: 0,
  647. status: true,
  648. fixed: '',
  649. columnWidth: 120
  650. },
  651. {
  652. userId: this.$store.state.user.name,
  653. functionId: 103004,
  654. serialNumber: '103004Table4CreatedBy',
  655. tableId: "103004Table3",
  656. tableName: "SOP文件表",
  657. columnProp: "createdBy",
  658. headerAlign: "center",
  659. align: "left",
  660. columnLabel: "上传人",
  661. columnHidden: false,
  662. columnImage: false,
  663. columnSortable: false,
  664. sortLv: 0,
  665. status: true,
  666. fixed: '',
  667. columnWidth: 60
  668. },
  669. {
  670. userId: this.$store.state.user.name,
  671. functionId: 103004,
  672. serialNumber: '103004Table4CreateDate',
  673. tableId: "103004Table3",
  674. tableName: "SOP文件表",
  675. columnProp: "createDate",
  676. headerAlign: "center",
  677. align: "center",
  678. columnLabel: "上传时间",
  679. columnHidden: false,
  680. columnImage: false,
  681. columnSortable: false,
  682. sortLv: 0,
  683. status: true,
  684. fixed: '',
  685. columnWidth: 120
  686. },
  687. {
  688. userId: this.$store.state.user.name,
  689. functionId: 103004,
  690. serialNumber: '103004Table4EffectiveDate',
  691. tableId: "103004Table3",
  692. tableName: "SOP文件表",
  693. columnProp: "effectiveDate",
  694. headerAlign: "center",
  695. align: "center",
  696. columnLabel: "生效日期",
  697. columnHidden: false,
  698. columnImage: false,
  699. columnSortable: false,
  700. sortLv: 0,
  701. status: true,
  702. fixed: '',
  703. columnWidth: 80
  704. },
  705. {
  706. userId: this.$store.state.user.name,
  707. functionId: 103004,
  708. serialNumber: '103004Table4ExpiryDate',
  709. tableId: "103004Table3",
  710. tableName: "SOP文件表",
  711. columnProp: "expiryDate",
  712. headerAlign: "center",
  713. align: "center",
  714. columnLabel: "失效日期",
  715. columnHidden: false,
  716. columnImage: false,
  717. columnSortable: false,
  718. sortLv: 0,
  719. status: true,
  720. fixed: '',
  721. columnWidth: 80
  722. },
  723. {
  724. userId: this.$store.state.user.name,
  725. functionId: 103004,
  726. serialNumber: '103004Table4Status',
  727. tableId: "103004Table3",
  728. tableName: "SOP文件表",
  729. columnProp: "status",
  730. headerAlign: "center",
  731. align: "center",
  732. columnLabel: "状态",
  733. columnHidden: false,
  734. columnImage: false,
  735. columnSortable: false,
  736. sortLv: 0,
  737. status: true,
  738. fixed: '',
  739. columnWidth: 50
  740. },
  741. ],
  742. }
  743. },
  744. mounted() {
  745. this.$nextTick(() => {
  746. this.height = window.innerHeight - 225;
  747. })
  748. },
  749. methods: {
  750. getDataList() {
  751. let inData = {
  752. site: this.$store.state.user.site,
  753. userName: this.$store.state.user.name,
  754. orderNo: this.searchData.orderNo,
  755. customer: this.searchData.customer,
  756. }
  757. this.dataList = []
  758. this.sopFileList = []
  759. shopNoticeSearch(inData).then(({data}) => {
  760. if (data.code === 0) {
  761. if ( data.rows1 !== null && data.rows1 !== undefined) {
  762. data.rows1.uAttach1 = false
  763. data.rows1.uAttach2 = false
  764. data.rows1.uAttach3 = false
  765. if (data.rows1.uattach1 === '有' || data.rows1.uattach1 === 'Y' || data.rows1.uattach1 === '样品') {
  766. data.rows1.uAttach1 = true
  767. } else if (data.rows1.uattach1 === '图纸') {
  768. data.rows1.uAttach2 = true
  769. } else if (data.rows1.uattach1 === '刀线') {
  770. data.rows1.uAttach3 = true
  771. }
  772. if (data.rows1.uattach2 === '有' || data.rows1.uattach2 === 'Y' || data.rows1.uattach2 === '图纸') {
  773. data.rows1.uAttach2 = true
  774. }else if (data.rows1.uattach2 === '刀线') {
  775. data.rows1.uAttach3 = true
  776. } else if (data.rows1.uattach2 === '样品'){
  777. data.rows1.uAttach1 = true
  778. }
  779. if (data.rows1.uattach3 === '有' || data.rows1.uattach3 === 'Y' || data.rows1.uattach3 === '刀线') {
  780. data.rows1.uAttach3 = true
  781. } else if (data.rows1.uattach3 === '图纸') {
  782. data.rows1.uAttach2 = true
  783. } else if (data.rows1.uattach3 === '样品') {
  784. data.rows1.uAttach1 = true
  785. }
  786. this.modelData = data.rows1
  787. }
  788. this.dataList = data.rows2
  789. // 遍历sopFileList,将每个对象的orderRef4赋值给versionNumber
  790. data.rows3.forEach((item) => {
  791. item.fileType = item.fileSuffix
  792. item.versionNumber = item.orderRef4
  793. item.resourceInfo = item.orderRef3 + '(' + item.resourceDesc + ')'
  794. if (item.expiryDate !== null) {
  795. if (new Date(item.expiryDate) < new Date()) {
  796. item.status = '失效'
  797. }
  798. else {
  799. item.status = '有效'
  800. }
  801. } else {
  802. item.status = '有效'
  803. }
  804. if (this.searchData.status === '有效'){
  805. if (item.status !== '失效'){
  806. this.sopFileList.push(item)
  807. }
  808. } else {
  809. this.sopFileList.push(item)
  810. }
  811. })
  812. }
  813. })
  814. },
  815. openDialog(row) {
  816. let image = ['jpg', 'jpeg', 'png', 'gif', 'bmp']
  817. let pdf = ['pdf']
  818. let type = ''
  819. if (image.includes(row.fileType.toLowerCase())) {
  820. this.pdfUrl = '/file/' + row.newFileName
  821. }
  822. else if (pdf.includes(row.fileType.toLowerCase())) {
  823. this.pdfUrl = '/file/' + row.newFileName
  824. }
  825. else {
  826. this.$message({
  827. message: '不支持的文件类型',
  828. type: 'warning'
  829. })
  830. return
  831. }
  832. this.dialogVisible = true; // 打开弹窗
  833. },
  834. // 查看文件
  835. viewSopFile(row) {
  836. const fileName = row.fileName || row.fileType
  837. downLoadObjectFile(row).then(({data}) => {
  838. this.$filePreview.previewFile(data, fileName).then(result => {
  839. if (result.message) {
  840. this.$message.success(result.message)
  841. }
  842. }).catch(error => {
  843. this.$message.error('文件预览失败:' + (error.message || '未知错误'))
  844. })
  845. }).catch(() => {
  846. this.$message.error('文件下载失败,请稍后重试')
  847. })
  848. },
  849. // 下载
  850. downloadFile (row) {
  851. downLoadObjectFile(row)
  852. .then(({data}) => {
  853. // 不限制文件下载类型
  854. const blob = new Blob([data], {type:'application/octet-stream;charset=utf-8'})
  855. // 下载文件名称
  856. const fileName = row.fileName
  857. // a标签下载
  858. const linkNode = document.createElement('a')
  859. linkNode.download = fileName // a标签的download属性规定下载文件的名称
  860. linkNode.style.display = 'none'
  861. linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL
  862. document.body.appendChild(linkNode)
  863. linkNode.click() // 模拟在按钮上的一次鼠标单击
  864. URL.revokeObjectURL(linkNode.href) // 释放URL 对象
  865. document.body.removeChild(linkNode)
  866. })
  867. },
  868. }
  869. }
  870. </script>
  871. <style scoped>
  872. .right-align-input ::v-deep .el-input__inner {
  873. text-align: right;
  874. }
  875. /* 自定义 Dialog 样式使其可拖动 */
  876. .el-dialog__header {
  877. cursor: move;
  878. }
  879. </style>