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.

411 lines
15 KiB

2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
11 months ago
2 years ago
1 year 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 year 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 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year 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 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
11 months ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
2 years ago
2 years ago
  1. <template>
  2. <div class="mod-config" v-highlight-container>
  3. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 1px; margin-left: 0px;" >
  4. <!-- <el-form-item :label="'技术参数卡编码'">-->
  5. <!-- <el-input v-model="searchData.oriCodeNo" readonly style="width: 150px" ></el-input>-->
  6. <!-- </el-form-item>-->
  7. <el-row :gutter="20">
  8. <el-col :span="18">
  9. <el-form-item :label="'属性模板编码'">
  10. <el-input v-model="searchData.propertiesCodeNo" readonly style="width: 150px" ></el-input>
  11. </el-form-item>
  12. <el-form-item label=" ">
  13. <el-button type="primary" @click="refreshBMPageModal()" v-if="!ifDisableFlag&&isAuth('103002:bmModel')">更新模板</el-button>
  14. <el-button type="primary" @click="searchTable()" >刷新数据</el-button>
  15. <el-button type="primary" @click="saveTable()" v-if="!ifDisableFlag&&isAuth('103002:bmSave')">保存数据</el-button>
  16. <el-button v-if="baseForm.status === 'spz'&&!ifDisableFlag&&spForm.sp.includes(searchData.username)" type="primary" @click="agreeSubmit">同意</el-button>
  17. <el-button v-if="baseForm.status === 'spz' && baseForm.isReject === 'Y' &&!ifDisableFlag&&spForm.sp.includes(searchData.username)" type="primary" @click="submitDataModal">驳回</el-button>
  18. </el-form-item>
  19. </el-col>
  20. <el-col :span="3"><div class="grid-content bg-purple">
  21. <el-form-item :label="'当前节点'" style="width: 100%">
  22. <el-input v-model="spForm.nodeName" disabled ></el-input>
  23. </el-form-item>
  24. </div>
  25. </el-col>
  26. <el-col :span="3"><div class="grid-content bg-purple">
  27. <el-form-item :label="'审批人'" style="width: 100%">
  28. <el-input v-model="spForm.sp" disabled ></el-input>
  29. </el-form-item>
  30. </div>
  31. </el-col>
  32. </el-row>
  33. <div class="rq ">
  34. <el-table
  35. :height="height"
  36. :data="tableData"
  37. border
  38. style="width: 100%">
  39. <el-table-column
  40. prop="propertiesItemNo"
  41. header-align="center"
  42. align="left"
  43. width="150"
  44. label="属性编码">
  45. </el-table-column>
  46. <el-table-column
  47. prop="itemDesc"
  48. header-align="center"
  49. align="left"
  50. width="150"
  51. label="属性名称">
  52. </el-table-column>
  53. <el-table-column
  54. prop="valueTypeDb"
  55. header-align="center"
  56. align="center"
  57. width="80"
  58. label="数据类型">
  59. <template slot-scope="scope">
  60. <span v-if="scope.row.valueTypeDb === 'N'">数字</span>
  61. <span v-else-if="scope.row.valueTypeDb === 'T'">文本</span>
  62. <!-- <a v-else-if="scope.row.valueTypeDb === 'S'" @click="openNewPage(scope.row.textValue)" >超链接</a>-->
  63. <a v-else-if="scope.row.valueTypeDb === 'S'" @click="openNewPage(scope.row.textValue)" >超链接</a>
  64. </template>
  65. </el-table-column>
  66. <el-table-column
  67. header-align="center"
  68. align="left"
  69. min-width="400"
  70. label="值">
  71. <template slot-scope="scope">
  72. <div v-highlight-container>
  73. <el-input v-if="scope.row.valueTypeDb === 'T'&&scope.row.valueChooseFlag === 'N'" v-model="scope.row.textValue" style="height: 11px;padding: 0px ;width:98%" allow-create :disabled="ifDisableFlag" ></el-input>
  74. <div v-if="scope.row.valueTypeDb === 'S'&&scope.row.valueChooseFlag === 'N'"><el-input v-model="scope.row.textValue" style="height: 11px;padding: 0px ;width:98%" allow-create :disabled="ifDisableFlag"></el-input></div>
  75. <el-input v-if="scope.row.valueTypeDb === 'N'&&scope.row.valueChooseFlag === 'N'" v-model="scope.row.numValue" type="number" style="height: 11px;padding: 0px;width:98%" allow-create :disabled="ifDisableFlag"></el-input>
  76. <el-select v-if="scope.row.valueTypeDb === 'T'&&scope.row.valueChooseFlag === 'Y'" v-model="scope.row.textValue" placeholder="请选择" style="height: 11px;padding: 0px " allow-create :disabled="ifDisableFlag">
  77. <el-option
  78. v-for="item in scope.row.availableValueList"
  79. :key="index"
  80. :label="item.availableValue"
  81. :value="item.availableValue">
  82. </el-option>
  83. </el-select>
  84. <el-select v-if="scope.row.valueTypeDb === 'N'&&scope.row.valueChooseFlag === 'Y'" v-model="scope.row.numValue" placeholder="请选择" style="height: 11px;padding: 0px " allow-create :disabled="ifDisableFlag">
  85. <el-option
  86. v-for="item in scope.row.availableValueList"
  87. :key="index"
  88. :label="item.availableValue"
  89. :value="item.availableValue">
  90. </el-option>
  91. </el-select>
  92. <div v-if="scope.row.valueTypeDb === 'S'&&scope.row.valueChooseFlag === 'Y'"> <el-select v-model="scope.row.textValue" placeholder="请选择" style="height: 11px;padding: 0px ;width:98%" allow-create :disabled="ifDisableFlag">
  93. <el-option
  94. v-for="item in scope.row.availableValueList"
  95. :key="index"
  96. :label="item.availableValue"
  97. :value="item.availableValue">
  98. </el-option>
  99. </el-select></div>
  100. </div>
  101. </template>
  102. </el-table-column>
  103. </el-table>
  104. </div>
  105. </el-form>
  106. <!-- 提交 -->
  107. <el-dialog title="驳回" top="30vh" :close-on-click-modal="false" v-drag :visible.sync="submitModalFlag" width="500px">
  108. <el-form :inline="true" label-position="top">
  109. <el-form-item :label="'驳回意见'">
  110. <el-input type="textarea" v-model="rejectOpinion" :rows="3" resize='none' show-word-limit style="width: 479px;height: 30px"></el-input>
  111. </el-form-item>
  112. </el-form>
  113. <el-footer style="height:30px;margin-top: 50px;text-align:center">
  114. <el-button type="primary" @click="rejectSubmit">确定</el-button>
  115. <el-button type="primary" @click="submitModalFlag = false">取消</el-button>
  116. </el-footer>
  117. </el-dialog>
  118. </div>
  119. </template>
  120. <script>
  121. import {
  122. searchBMPropertiesValue,
  123. saveBMPropertiesValue,
  124. refreshBMPageModal,
  125. searchBMPropertiesHeaderForBM,
  126. checkUrl,
  127. tsdBasicInformationSearch,getBMStatusDesc,
  128. submitChange, // 提交
  129. getOADetailForBM,
  130. } from "@/api/sampleManagement/technicalSpecificationList.js"
  131. import {
  132. getNodeAuthority, // 获取节点权限
  133. } from '@/api/changeManagement/changeManagement.js'
  134. export default {
  135. components: {
  136. },
  137. data() {
  138. return {
  139. height:200,
  140. searchData: {
  141. site: '',
  142. username: this.$store.state.user.name,
  143. codeNo: '',
  144. oriCodeNo: '',
  145. buNo:'',
  146. type:'',
  147. propertiesCodeNo:'',
  148. fieldId:'',
  149. },
  150. type:'prepress',
  151. ifDisableFlag:false,
  152. tableData:[],
  153. baseForm:{
  154. status:'',
  155. isReject:'',
  156. },
  157. spForm:{
  158. sp:'',
  159. nodeName:'',
  160. },
  161. rejectOpinion: '',
  162. submitModalFlag: false,
  163. }
  164. },
  165. mounted () {
  166. this.$nextTick(() => {
  167. this.height =0.7* window.innerHeight
  168. })
  169. },
  170. methods: {
  171. //初始化组件的参数
  172. init(inData) {
  173. if(this.searchData.codeNo!=null&&this.searchData.codeNo!=''){
  174. return false;
  175. }
  176. //初始化参数
  177. this.searchData = JSON.parse(JSON.stringify(inData));
  178. if(this.searchData.ifDisableFlag){
  179. this.ifDisableFlag=true
  180. }
  181. //this.searchData.type= JSON.parse(JSON.stringify(this.type));
  182. //刷新表格
  183. this.$nextTick(()=>{
  184. // this.searchTable();
  185. getOADetailForBM(this.searchData).then(({data}) => {
  186. this.spForm.nodeName = data.row.nodeName
  187. this.spForm.sp = data.row.sp
  188. })
  189. searchBMPropertiesValue(this.searchData).then(({data}) => {
  190. this.tableData = data.rows;
  191. // this.$message({
  192. // message: '操作成功',
  193. // type: 'success',
  194. // duration: 1500,
  195. // onClose: () => {
  196. // }
  197. // })
  198. });
  199. searchBMPropertiesHeaderForBM(this.searchData).then(({data}) => {
  200. // this.searchData.propertiesCodeNo = data.row.propertiesCodeNo;
  201. this.$set(this.searchData, 'propertiesCodeNo', data.row.propertiesCodeNo);
  202. });
  203. tsdBasicInformationSearch(this.searchData).then(({data}) => {
  204. this.baseForm=data.row;
  205. this.getNodeAuthority(data.row)
  206. })
  207. this.$clearHighLight()
  208. } )
  209. },
  210. searchTable(){
  211. getOADetailForBM(this.searchData).then(({data}) => {
  212. this.spForm.nodeName = data.row.nodeName
  213. this.spForm.sp = data.row.sp
  214. })
  215. searchBMPropertiesValue(this.searchData).then(({data}) => {
  216. this.tableData = data.rows;
  217. this.$message({
  218. message: '操作成功',
  219. type: 'success',
  220. duration: 1500,
  221. onClose: () => {
  222. }
  223. })
  224. });
  225. searchBMPropertiesHeaderForBM(this.searchData).then(({data}) => {
  226. // this.searchData.propertiesCodeNo = data.row.propertiesCodeNo;
  227. this.$set(this.searchData, 'propertiesCodeNo', data.row.propertiesCodeNo);
  228. });
  229. tsdBasicInformationSearch(this.searchData).then(({data}) => {
  230. this.baseForm=data.row;
  231. this.getNodeAuthority(data.row)
  232. })
  233. this.$clearHighLight()
  234. },
  235. refreshBMPageModal(){
  236. this.$confirm(`是否刷新至最新模板界面,已填数据会更新到新模板中,若旧属性在新模板中被删除,该条数据会消失。`, '提示', {
  237. confirmButtonText: '确定',
  238. cancelButtonText: '取消',
  239. type: 'warning'
  240. }).then(() => {
  241. refreshBMPageModal(this.searchData).then(({data}) => {
  242. if (data && data.code === 0) {
  243. this.searchTable();
  244. // this.$message({
  245. // message: '操作成功',
  246. // type: 'success',
  247. // duration: 1500,
  248. // onClose: () => {
  249. // }
  250. // })
  251. } else {
  252. this.$alert(data.msg, '错误', {
  253. confirmButtonText: '确定'
  254. })
  255. }
  256. })
  257. }).catch(() => {
  258. })
  259. },
  260. saveTable(){
  261. saveBMPropertiesValue(this.tableData).then(({data}) => {
  262. if (data && data.code === 0) {
  263. this.$clearHighLight()
  264. this.$message({
  265. message: '操作成功',
  266. type: 'success',
  267. duration: 1500,
  268. onClose: () => {
  269. }
  270. })
  271. this.$emit("closeModel")
  272. } else {
  273. this.$alert(data.msg, '错误', {
  274. confirmButtonText: '确定'
  275. })
  276. }
  277. });
  278. },
  279. openNewPage(url){
  280. // window.open(this.$store.state.user.bmPicUrl +url);
  281. let urlIn=url.replaceAll('\\','/')
  282. if(url==null||url===''){
  283. this.$alert("链接没有数据!", '错误', {
  284. confirmButtonText: '确定'
  285. })
  286. return false;
  287. }
  288. // window.open(url);
  289. let data={
  290. url:urlIn
  291. }
  292. checkUrl(data).then(({data}) => {
  293. if (data && data.code === 0) {
  294. window.open(data.url);
  295. } else {
  296. this.$alert(data.msg, '错误', {
  297. confirmButtonText: '确定'
  298. })
  299. }
  300. });
  301. },
  302. // 获取流程的配置权限
  303. getNodeAuthority (row) {
  304. getBMStatusDesc(this.searchData).then(({data}) => {
  305. if (data.status === '已完成' || data.status === '已升版') {
  306. this.ifDisableFlag = true
  307. return false
  308. }
  309. if(data.status === '审批中') {
  310. let tempData = {
  311. site: row.site,
  312. stepId: row.stepId,
  313. menuId: '103002'
  314. }
  315. getNodeAuthority(tempData).then(({data}) => {
  316. if (data && data.code === 0) {
  317. this.ifDisableFlag = true
  318. let plmStepRoleBaseBm = data.rows.plm_stepRole_base_bm
  319. let arr = plmStepRoleBaseBm.filter(a => a.fieldId === this.searchData.fieldId)
  320. if (arr.length > 0) {
  321. if (arr[0].updateFlag === 'N') {
  322. this.ifDisableFlag = true
  323. } else {
  324. this.ifDisableFlag = false
  325. }
  326. } else {
  327. this.ifDisableFlag = true
  328. }
  329. }
  330. })
  331. }
  332. })
  333. },
  334. // 同意提交
  335. agreeSubmit () {
  336. this.$confirm(`是否确认提交?`, '提示', {
  337. confirmButtonText: '确定',
  338. cancelButtonText: '取消',
  339. type: 'warning'
  340. }).then(() => {
  341. let tempData = {
  342. site: this.searchData.site,
  343. userName: this.$store.state.user.name,
  344. codeNo: this.searchData.codeNo,
  345. menuId: '103002',
  346. nodeConclusion: 'Y'
  347. }
  348. this.submitData(tempData)
  349. })
  350. },
  351. // 打开提交模态框
  352. submitDataModal () {
  353. this.rejectOpinion = ''
  354. this.submitModalFlag = true
  355. },
  356. // 驳回提交
  357. rejectSubmit () {
  358. this.$confirm(`是否确认驳回?`, '提示', {
  359. confirmButtonText: '确定',
  360. cancelButtonText: '取消',
  361. type: 'warning'
  362. }).then(() => {
  363. let tempData = {
  364. site: this.searchData.site,
  365. userName: this.$store.state.user.name,
  366. codeNo: this.searchData.codeNo,
  367. menuId: '103002',
  368. nodeConclusion: 'N',
  369. rejectOpinion : this.rejectOpinion
  370. }
  371. this.submitData(tempData)
  372. })
  373. },
  374. submitData (tempData) {
  375. saveBMPropertiesValue(this.tableData).then(({data}) => {
  376. if (data && data.code === 0) {
  377. submitChange(tempData).then(({data}) => {
  378. if (data && data.code === 0) {
  379. this.searchTable()
  380. this.submitModalFlag = false
  381. this.$emit("closeModel")
  382. } else {
  383. this.$alert(data.msg, '错误', {
  384. confirmButtonText: '确定'
  385. })
  386. }
  387. })
  388. } else {
  389. this.$message.error(data.msg)
  390. }
  391. })
  392. },
  393. },
  394. }
  395. </script>
  396. <style scoped>
  397. </style>