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.

635 lines
20 KiB

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