plm前端
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.

591 lines
19 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
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
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
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
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-dialog
  4. width="600px"
  5. :title="!dataForm.id ? '添加' :'编辑'"
  6. :close-on-click-modal="false"
  7. :visible.sync="visible">
  8. <el-form :inline="true" label-position="top" label-width="100px" :rules="dataRole">
  9. <el-form-item >
  10. <span slot="label" style="" @click="chooseProofingModel()"><a herf="#">打样单号</a></span>
  11. <el-input v-model="dataForm.proofingNo" style="width: 130px" @change="changeProofingNoChange" :disabled="dataForm.id!=0"></el-input>
  12. </el-form-item>
  13. </el-form>
  14. <el-form :inline="true" label-position="top" label-width="100px" :rules="dataRole">
  15. <el-form-item prop="testPartNo" :rules="dataRole.testPartNo">
  16. <span slot="label" style="" @click="getBaseList(105,1)" ><a herf="#">项目料号</a></span>
  17. <el-input v-model="dataForm.testPartNo" @change="changeTestDesc" style="width: 130px" ></el-input>
  18. </el-form-item>
  19. <el-form-item :label="'项目号'">
  20. <el-input v-model="dataForm.projectId" style="width: 130px" disabled></el-input>
  21. </el-form-item>
  22. <el-form-item :label="'物料描述'">
  23. <el-input v-model="dataForm.partDesc" style="width: 274px" disabled></el-input>
  24. </el-form-item>
  25. </el-form>
  26. <el-form :inline="true" label-position="top" label-width="100px" :rules="dataRole">
  27. <el-form-item :label="'参数卡编码'" >
  28. <el-input v-model="dataForm.codeNo" disabled style="width: 130px" ></el-input>
  29. </el-form-item>
  30. <el-form-item :label="'版本号'" prop="revNo" :rules="dataRole.revNo">
  31. <el-input v-model="dataForm.revNo" style="width: 130px" ></el-input>
  32. </el-form-item>
  33. <el-form-item >
  34. <span slot="label" style="" @click="quotationOfficerChooseModal()"><a herf="#">报价员</a></span>
  35. <el-input v-model="dataForm.quotationOfficer" readonly style="width: 274px" @focus="quotationOfficerChooseModal()"></el-input>
  36. </el-form-item>
  37. </el-form>
  38. <el-form :inline="true" label-position="top" label-width="100px" >
  39. <el-form-item >
  40. <span slot="label" style="" @click="engineerChooseModal()"><a herf="#">工程师</a></span>
  41. <el-input v-model="dataForm.engineer" readonly style="width: 274px" @focus="engineerChooseModal()"></el-input>
  42. </el-form-item>
  43. <el-form-item >
  44. <span slot="label" style="" @click="technicianModal()"><a herf="#">技术员</a></span>
  45. <el-input v-model="dataForm.technician" readonly style="width: 274px" @focus="technicianModal()"></el-input>
  46. </el-form-item>
  47. </el-form>
  48. <el-form :inline="true" label-position="top" label-width="100px" >
  49. <el-form-item :label="'备注'">
  50. <el-input
  51. type="textarea"
  52. v-model="dataForm.remark "
  53. :rows="3"
  54. resize='none'
  55. maxlength="120"
  56. show-word-limit
  57. style="width: 562px;height: 60px">
  58. </el-input>
  59. </el-form-item>
  60. </el-form>
  61. <el-form label-position="top" style="margin-top: 60px; margin-left: 0px;text-align:center">
  62. <el-button type="primary" @click="dataFormSubmit()">{{'确定'}}</el-button>
  63. <el-button type="primary" @click="visible = false">{{'关闭'}}</el-button>
  64. </el-form>
  65. </el-dialog>
  66. <el-dialog
  67. width="530px"
  68. title="报价员"
  69. :close-on-click-modal="false"
  70. :visible.sync="quotationOfficerFlag">
  71. <el-transfer v-model="quotationOfficerList" class="rq" filterable :props="{
  72. key: 'operatorId',
  73. label: 'operatorName'
  74. }" :data="operatorList" :titles="['未选择', '已选择']"></el-transfer>
  75. <span slot="footer" class="dialog-footer">
  76. <div style="margin-top: 5px">
  77. <el-button type="primary" @click="saveQuotationOfficerList()">确定</el-button>
  78. <el-button @click="quotationOfficerFlag = false" type="primary">取消</el-button>
  79. </div>
  80. </span>
  81. </el-dialog>
  82. <el-dialog
  83. width="530px"
  84. title="工程师"
  85. :close-on-click-modal="false"
  86. :visible.sync="engineerFlag">
  87. <el-transfer v-model="engineerList" class="rq" filterable :props="{
  88. key: 'operatorId',
  89. label: 'operatorName'
  90. }" :data="operatorList" :titles="['未选择', '已选择']"></el-transfer>
  91. <span slot="footer" class="dialog-footer">
  92. <div style="margin-top: 5px">
  93. <el-button type="primary" @click="saveEngineerList()">确定</el-button>
  94. <el-button @click="engineerFlag = false" type="primary">取消</el-button>
  95. </div>
  96. </span>
  97. </el-dialog>
  98. <el-dialog
  99. width="530px"
  100. title="项目负责人"
  101. :close-on-click-modal="false"
  102. :visible.sync="ownerFlag">
  103. <el-transfer v-model="technicianList" class="rq" filterable :props="{
  104. key: 'operatorId',
  105. label: 'operatorName'
  106. }" :data="operatorList" :titles="['未选择', '已选择']"></el-transfer>
  107. <span slot="footer" class="dialog-footer">
  108. <div style="margin-top: 5px">
  109. <el-button type="primary" @click="savetechnicianList()">确定</el-button>
  110. <el-button @click="ownerFlag = false" type="primary">取消</el-button>
  111. </div>
  112. </span>
  113. </el-dialog>
  114. <el-dialog
  115. width="600px"
  116. title="选择打样单"
  117. :close-on-click-modal="false"
  118. :visible.sync="proofingModelFlag">
  119. <el-form :inline="true" label-position="top" label-width="100px" :rules="dataRole">
  120. <el-table
  121. height="300"
  122. :data="proofingList"
  123. border
  124. @row-dblclick="chooseProofingNo"
  125. style="width: 100%;">
  126. <el-table-column
  127. prop="proofingNo"
  128. header-align="center"
  129. align="left"
  130. min-width="40"
  131. style="font-size: 20px"
  132. label="打样单">
  133. </el-table-column>
  134. <el-table-column
  135. prop="projectId"
  136. header-align="center"
  137. align="left"
  138. min-width="40"
  139. style="font-size: 20px"
  140. label="项目号">
  141. </el-table-column>
  142. <el-table-column
  143. prop="testPartNo"
  144. header-align="center"
  145. align="left"
  146. min-width="50"
  147. label="测试料号">
  148. </el-table-column>
  149. <el-table-column
  150. prop="partDesc"
  151. header-align="center"
  152. align="left"
  153. min-width="80"
  154. label="物料名称">
  155. </el-table-column>
  156. </el-table>
  157. </el-form>
  158. </el-dialog>
  159. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  160. </div>
  161. </template>
  162. <script>
  163. import {
  164. searchOperatorWithSite,
  165. } from "@/api/project/project.js"
  166. import {technicalSpecificationListSearch,
  167. saveTechnicalSpecificationSheet,
  168. searchTechnicalSpecificationTeamStr,
  169. getTestPartChangeData,
  170. getProofingDataByUserRole,
  171. } from "@/api/sampleManagement/technicalSpecificationList.js"
  172. import Chooselist from '@/views/modules/common/Chooselist'
  173. export default {
  174. components: {
  175. Chooselist
  176. },
  177. data () {
  178. return {
  179. tagNo:'',
  180. tagNo1:'',
  181. visible: false,
  182. treeVisible: false,
  183. quotationOfficerFlag:false,
  184. engineerFlag:false,
  185. userRoleFlag:false,
  186. ownerFlag:false,
  187. operatorList:[],
  188. dataForm: {
  189. id: 0,
  190. site:this.$store.state.user.site,
  191. proofingNo:'',
  192. projectId:'',
  193. codeNo:'',
  194. testPartNo:'',
  195. partDesc:'',
  196. status:'',
  197. revNo:'',
  198. remark:'',
  199. technician:'',
  200. quotationOfficer:'',
  201. engineer:'',
  202. quotationOfficerList:[],
  203. engineerList:[],
  204. technicianList:[],
  205. },
  206. quotationOfficerList:[],
  207. engineerList:[],
  208. technicianList:[],
  209. dataRole: {
  210. testPartNo: [
  211. {
  212. required: true,
  213. message: ' ',
  214. trigger: 'change'
  215. }
  216. ],
  217. revNo: [
  218. {
  219. required: true,
  220. message: ' ',
  221. trigger: 'change'
  222. }
  223. ],
  224. quotationOfficer: [
  225. {
  226. required: true,
  227. message: ' ',
  228. trigger: 'change'
  229. }
  230. ],
  231. engineer: [
  232. {
  233. required: true,
  234. message: ' ',
  235. trigger: 'change'
  236. }
  237. ],
  238. technician: [
  239. {
  240. required: true,
  241. message: ' ',
  242. trigger: 'change'
  243. }
  244. ],
  245. },
  246. proofingList:[],
  247. proofingModelFlag:false,
  248. }
  249. },
  250. created () {
  251. },
  252. methods: {
  253. // 获取基础数据列表S
  254. getBaseList (val, type) {
  255. this.tagNo = val
  256. this.tagNo1 = type
  257. this.$nextTick(() => {
  258. let strVal = ''
  259. if (val === 105) {
  260. if(type==1) {
  261. strVal = this.dataForm.testPartNo
  262. }
  263. }
  264. if (val === 102) {
  265. if(type==1) {
  266. strVal = this.dataForm.customerId
  267. }
  268. }
  269. if (val === 1011) {
  270. if(type==1) {
  271. strVal = this.dataForm.projectSource
  272. }
  273. }
  274. if (val === 1012) {
  275. if(type==1) {
  276. strVal = this.dataForm.priority
  277. }
  278. }
  279. this.$refs.baseList.init(val, strVal)
  280. })
  281. },
  282. /* 列表方法的回调 */
  283. getBaseData (val) {
  284. if (this.tagNo === 105) {
  285. if(this.tagNo1==1) {
  286. this.dataForm.testPartNo = val.Test_part_no
  287. this.dataForm.proofingNo = ''
  288. this.changeTestDesc();
  289. }
  290. }
  291. if (this.tagNo === 102) {
  292. if(this.tagNo1==1) {
  293. this.dataForm.customerId = val.Customer_no
  294. this.dataForm.customerName = val.Customer_desc
  295. }
  296. }
  297. if (this.tagNo === 1011) {
  298. if(this.tagNo1==1) {
  299. this.dataForm.projectSource = val.Base_id
  300. this.dataForm.projectSourceDesc = val.Base_desc
  301. }
  302. }
  303. if (this.tagNo === 1012) {
  304. if(this.tagNo1==1) {
  305. this.dataForm.priority = val.Base_id
  306. this.dataForm.priorityDesc = val.Base_desc
  307. }
  308. }
  309. },
  310. init (id) {
  311. this.dataForm.id = id || 0
  312. if(this.dataForm.id!=0){
  313. let inData={
  314. page: 1,
  315. limit: 10,
  316. id:id,
  317. site:this.$store.state.user.site,
  318. }
  319. technicalSpecificationListSearch(inData).then(({data}) => {
  320. if(data.page.list.length>0){
  321. this.dataForm= data.page.list[0];
  322. let inData={
  323. site:this.dataForm.site,
  324. codeNo:this.dataForm.codeNo,
  325. type:'quotationOfficer',
  326. }
  327. searchTechnicalSpecificationTeamStr(inData).then(({data}) => {
  328. this.dataForm.quotationOfficerList=data.rows
  329. })
  330. let inData2={
  331. site:this.dataForm.site,
  332. codeNo:this.dataForm.codeNo,
  333. type:'technician',
  334. }
  335. searchTechnicalSpecificationTeamStr(inData2).then(({data}) => {
  336. this.dataForm.technicianList=data.rows
  337. })
  338. let inData3={
  339. site:this.dataForm.site,
  340. codeNo:this.dataForm.codeNo,
  341. type:'engineer',
  342. }
  343. searchTechnicalSpecificationTeamStr(inData3).then(({data}) => {
  344. this.dataForm.engineerList=data.rows
  345. })
  346. }
  347. })
  348. }else {
  349. this.dataForm={
  350. id: 0,
  351. site:this.$store.state.user.site,
  352. proofingNo:'',
  353. projectId:'',
  354. codeNo:'',
  355. testPartNo:'',
  356. partDesc:'',
  357. status:'',
  358. revNo:'',
  359. remark:'',
  360. technician:'',
  361. quotationOfficer:'',
  362. engineer:'',
  363. quotationOfficerList:[],
  364. engineerList:[],
  365. technicianList:[],
  366. }
  367. }
  368. this.visible = true
  369. },
  370. chooseProofingModel(){
  371. if(this.dataForm.id!=0){
  372. return false;
  373. }
  374. let inData={
  375. site:this.dataForm.site,
  376. username:this.$store.state.user.name,
  377. }
  378. getProofingDataByUserRole(inData).then(({data}) => {
  379. this.proofingList=data.rows
  380. })
  381. this.proofingModelFlag=true
  382. },
  383. changeProofingNoChange(){
  384. let inData={
  385. site:this.dataForm.site,
  386. username:this.$store.state.user.name,
  387. proofingNo:this.dataForm.proofingNo,
  388. }
  389. getProofingDataByUserRole(inData).then(({data}) => {
  390. let row={
  391. projectId:'',
  392. testPartNo:'',
  393. partDesc:'',
  394. }
  395. if(data.rows.length>0){
  396. row=data.rows[0]
  397. }
  398. this.changeProofingNo(row)
  399. })
  400. },
  401. chooseProofingNo(row){
  402. this.dataForm.proofingNo=row.proofingNo
  403. this.dataForm.projectId=row.projectId
  404. this.dataForm.testPartNo=row.testPartNo
  405. this.dataForm.partDesc=row.partDesc
  406. this.proofingModelFlag=false
  407. },
  408. changeProofingNo(row){
  409. this.dataForm.projectId=row.projectId
  410. this.dataForm.testPartNo=row.testPartNo
  411. this.dataForm.partDesc=row.partDesc
  412. this.proofingModelFlag=false
  413. },
  414. quotationOfficerChooseModal(){
  415. let inData={
  416. site:this.dataForm.site,
  417. }
  418. searchOperatorWithSite(inData).then(({data}) => {
  419. this.operatorList=data.rows
  420. })
  421. this.quotationOfficerList = JSON.parse(JSON.stringify(this.dataForm.quotationOfficerList));
  422. this.quotationOfficerFlag=true
  423. },
  424. saveQuotationOfficerList(){
  425. let quotationOfficerName='';
  426. for (let i = 0; i < this.quotationOfficerList.length; i++) {
  427. let select= this.operatorList.filter(item => item.operatorId === this.quotationOfficerList[i])
  428. if(select.length>0){
  429. quotationOfficerName+=select[0].operatorName+';'
  430. }
  431. }
  432. this.dataForm.quotationOfficer=quotationOfficerName
  433. this.dataForm.quotationOfficerList=JSON.parse(JSON.stringify(this.quotationOfficerList));
  434. this.quotationOfficerFlag=false
  435. },
  436. engineerChooseModal(){
  437. let inData={
  438. site:this.dataForm.site,
  439. }
  440. searchOperatorWithSite(inData).then(({data}) => {
  441. this.operatorList=data.rows
  442. })
  443. this.engineerList = JSON.parse(JSON.stringify(this.dataForm.engineerList));
  444. this.engineerFlag=true
  445. },
  446. saveEngineerList(){
  447. let engineerName='';
  448. for (let i = 0; i < this.engineerList.length; i++) {
  449. let select= this.operatorList.filter(item => item.operatorId === this.engineerList[i])
  450. if(select.length>0){
  451. engineerName+=select[0].operatorName+';'
  452. }
  453. }
  454. this.dataForm.engineer=engineerName
  455. this.dataForm.engineerList=JSON.parse(JSON.stringify(this.engineerList));
  456. this.engineerFlag=false
  457. },
  458. technicianModal(){
  459. let inData={
  460. site:this.dataForm.site,
  461. }
  462. searchOperatorWithSite(inData).then(({data}) => {
  463. this.operatorList=data.rows
  464. })
  465. this.technicianList = JSON.parse(JSON.stringify(this.dataForm.technicianList));
  466. this.ownerFlag=true
  467. },
  468. savetechnicianList(){
  469. let technicianName='';
  470. for (let i = 0; i < this.technicianList.length; i++) {
  471. let select= this.operatorList.filter(item => item.operatorId === this.technicianList[i])
  472. if(select.length>0){
  473. technicianName+=select[0].operatorName+';'
  474. }
  475. }
  476. this.dataForm.technician=technicianName
  477. this.dataForm.technicianList=JSON.parse(JSON.stringify(this.technicianList));
  478. this.ownerFlag=false
  479. },
  480. // 表单提交
  481. dataFormSubmit () {
  482. if(this.dataForm.testPartNo===''){
  483. this.$alert('请输入测试料号!', '错误', {
  484. confirmButtonText: '确定'
  485. })
  486. return false
  487. }
  488. if(this.dataForm.revNo===''){
  489. this.$alert('请输入版本号!', '错误', {
  490. confirmButtonText: '确定'
  491. })
  492. return false
  493. }
  494. saveTechnicalSpecificationSheet(this.dataForm).then(({data}) => {
  495. if (data && data.code === 0) {
  496. this.$message.success( '操作成功')
  497. this.visible = false
  498. this.$emit('refreshDataList')
  499. } else {
  500. this.$message.error(data.msg)
  501. }
  502. })
  503. },
  504. changeTestDesc(){
  505. this.dataForm.proofingNo="";
  506. let inData={
  507. site:this.$store.state.user.site,
  508. testPartNo: this.dataForm.testPartNo
  509. }
  510. getTestPartChangeData(inData).then(({data}) => {
  511. if (data && data.code === 0) {
  512. if(data.row!=null){
  513. this.dataForm.projectId=data.row.projectId
  514. this.dataForm.partDesc=data.row.partDesc
  515. }else {
  516. this.dataForm.projectId=''
  517. this.dataForm.partDesc=''
  518. }
  519. }
  520. })
  521. },
  522. // changeTestPartNo(){
  523. // let inData={
  524. // site:this.dataForm.site,
  525. // username:this.$store.state.user.name,
  526. // testPartNo:this.dataForm.testPartNo,
  527. // }
  528. // getTestPartChangeData(inData).then(({data}) => {
  529. // let row={
  530. // projectId:'',
  531. // testPartNo:'',
  532. // partDesc:'',
  533. // }
  534. // if(data.rows.length>0){
  535. // row=data.rows[0]
  536. // }
  537. // this.changeProofingNo(row)
  538. // })
  539. // },
  540. },
  541. }
  542. </script>
  543. <style >
  544. .el-transfer-panel {
  545. border: 2px solid #17b3a3;
  546. border-radius: 4px;
  547. overflow: hidden;
  548. background: #fff;
  549. display: inline-block;
  550. vertical-align: middle;
  551. width: 200px;
  552. max-height: 100%;
  553. -webkit-box-sizing: border-box;
  554. box-sizing: border-box;
  555. position: relative;
  556. }
  557. .el-transfer-panel .el-transfer-panel__header {
  558. height: 40px;
  559. line-height: 40px;
  560. background: #17b3a3;
  561. margin: 0;
  562. padding-left: 15px;
  563. border-bottom: 1px solid #17b3a3;
  564. -webkit-box-sizing: border-box;
  565. box-sizing: border-box;
  566. color: #000;
  567. }
  568. .el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label {
  569. font-size: 14px;
  570. color: #303133;
  571. font-weight: 400;
  572. }
  573. </style>