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.

641 lines
20 KiB

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