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.

410 lines
15 KiB

3 years ago
2 years ago
3 years ago
3 years ago
​
​
2 years ago
​
3 years ago
​
3 years ago
​
2 years ago
3 years ago
2 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
​
​
​
​
​
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
2 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
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
​
​
​
2 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
2 years ago
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
3 years ago
3 years ago
​
​
2 years ago
​
2 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
​
3 years ago
3 years ago
​
​
​
2 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
2 years ago
3 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
3 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
3 years ago
2 years ago
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
3 years ago
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
3 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'))||(superAdmin)">保存数据</el-button>
  16. <el-button v-if="baseForm.status === 'spz'&&((!ifDisableFlag&&spForm.sp.includes(searchData.username))||(superAdmin))" type="primary" @click="agreeSubmit">同意</el-button>
  17. <el-button v-if="baseForm.status === 'spz' &&(( baseForm.isReject === 'Y' &&!ifDisableFlag&&spForm.sp.includes(searchData.username))||(superAdmin))" 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. superAdmin:false,
  140. height:200,
  141. searchData: {
  142. site: '',
  143. username: this.$store.state.user.name,
  144. codeNo: '',
  145. oriCodeNo: '',
  146. buNo:'',
  147. type:'',
  148. propertiesCodeNo:'',
  149. fieldId:'',
  150. },
  151. type:'prepress',
  152. ifDisableFlag:false,
  153. tableData:[],
  154. baseForm:{
  155. status:'',
  156. isReject:'',
  157. },
  158. spForm:{
  159. sp:'',
  160. nodeName:'',
  161. },
  162. rejectOpinion: '',
  163. submitModalFlag: false,
  164. }
  165. },
  166. mounted () {
  167. this.$nextTick(() => {
  168. this.height =0.7* window.innerHeight
  169. })
  170. },
  171. methods: {
  172. //初始化组件的参数
  173. init(inData) {
  174. if(this.searchData.codeNo!=null&&this.searchData.codeNo!=''){
  175. return false;
  176. }
  177. //初始化参数
  178. this.searchData = JSON.parse(JSON.stringify(inData));
  179. if(this.searchData.ifDisableFlag){
  180. this.ifDisableFlag=true
  181. }
  182. //this.searchData.type= JSON.parse(JSON.stringify(this.type));
  183. //刷新表格
  184. this.$nextTick(()=>{
  185. // this.searchTable();
  186. getOADetailForBM(this.searchData).then(({data}) => {
  187. this.spForm.nodeName = data.row.nodeName
  188. this.spForm.sp = data.row.sp==null?'':data.row.sp
  189. })
  190. searchBMPropertiesValue(this.searchData).then(({data}) => {
  191. this.tableData = data.rows;
  192. // this.$message({
  193. // message: '操作成功',
  194. // type: 'success',
  195. // duration: 1500,
  196. // onClose: () => {
  197. // }
  198. // })
  199. });
  200. searchBMPropertiesHeaderForBM(this.searchData).then(({data}) => {
  201. // this.searchData.propertiesCodeNo = data.row.propertiesCodeNo;
  202. this.$set(this.searchData, 'propertiesCodeNo', data.row.propertiesCodeNo);
  203. });
  204. tsdBasicInformationSearch(this.searchData).then(({data}) => {
  205. this.baseForm=data.row;
  206. this.getNodeAuthority(data.row)
  207. })
  208. this.$clearHighLight()
  209. } )
  210. },
  211. searchTable(){
  212. getOADetailForBM(this.searchData).then(({data}) => {
  213. this.spForm.nodeName = data.row.nodeName
  214. this.spForm.sp = data.row.sp==null?'':data.row.sp
  215. })
  216. searchBMPropertiesValue(this.searchData).then(({data}) => {
  217. this.tableData = data.rows;
  218. this.$message({
  219. message: '操作成功',
  220. type: 'success',
  221. duration: 1500,
  222. onClose: () => {
  223. }
  224. })
  225. });
  226. searchBMPropertiesHeaderForBM(this.searchData).then(({data}) => {
  227. // this.searchData.propertiesCodeNo = data.row.propertiesCodeNo;
  228. this.$set(this.searchData, 'propertiesCodeNo', data.row.propertiesCodeNo);
  229. });
  230. tsdBasicInformationSearch(this.searchData).then(({data}) => {
  231. this.baseForm=data.row;
  232. this.getNodeAuthority(data.row)
  233. })
  234. this.$clearHighLight()
  235. },
  236. refreshBMPageModal(){
  237. this.$confirm(`是否刷新至最新模板界面,已填数据会更新到新模板中,若旧属性在新模板中被删除,该条数据会消失。`, '提示', {
  238. confirmButtonText: '确定',
  239. cancelButtonText: '取消',
  240. type: 'warning'
  241. }).then(() => {
  242. refreshBMPageModal(this.searchData).then(({data}) => {
  243. if (data && data.code === 0) {
  244. this.searchTable();
  245. // this.$message({
  246. // message: '操作成功',
  247. // type: 'success',
  248. // duration: 1500,
  249. // onClose: () => {
  250. // }
  251. // })
  252. } else {
  253. this.$alert(data.msg, '错误', {
  254. confirmButtonText: '确定'
  255. })
  256. }
  257. })
  258. }).catch(() => {
  259. })
  260. },
  261. saveTable(){
  262. saveBMPropertiesValue(this.tableData).then(({data}) => {
  263. if (data && data.code === 0) {
  264. this.$clearHighLight()
  265. this.$emit("closeModel")
  266. } else {
  267. this.$alert(data.msg, '错误', {
  268. confirmButtonText: '确定'
  269. })
  270. }
  271. });
  272. },
  273. openNewPage(url){
  274. // window.open(this.$store.state.user.bmPicUrl +url);
  275. let urlIn=url.replaceAll('\\','/')
  276. if(url==null||url===''){
  277. this.$alert("链接没有数据!", '错误', {
  278. confirmButtonText: '确定'
  279. })
  280. return false;
  281. }
  282. // window.open(url);
  283. let data={
  284. url:urlIn
  285. }
  286. checkUrl(data).then(({data}) => {
  287. if (data && data.code === 0) {
  288. window.open(data.url);
  289. } else {
  290. this.$alert(data.msg, '错误', {
  291. confirmButtonText: '确定'
  292. })
  293. }
  294. });
  295. },
  296. // 获取流程的配置权限
  297. getNodeAuthority (row) {
  298. getBMStatusDesc(this.searchData).then(({data}) => {
  299. this.superAdmin=data.superAdmin
  300. if(data.superAdmin){
  301. this.ifDisableFlag = false
  302. return false
  303. }
  304. if (data.status === '已完成' || data.status === '已升版') {
  305. this.ifDisableFlag = true
  306. return false
  307. }
  308. if(data.status === '审批中') {
  309. let tempData = {
  310. site: row.site,
  311. stepId: row.stepId,
  312. menuId: '103002'
  313. }
  314. getNodeAuthority(tempData).then(({data}) => {
  315. if (data && data.code === 0) {
  316. this.ifDisableFlag = true
  317. let plmStepRoleBaseBm = data.rows.plm_stepRole_base_bm
  318. let arr = plmStepRoleBaseBm.filter(a => a.fieldId === this.searchData.fieldId)
  319. if (arr.length > 0) {
  320. if (arr[0].updateFlag === 'N') {
  321. this.ifDisableFlag = true
  322. } else {
  323. this.ifDisableFlag = false
  324. }
  325. } else {
  326. this.ifDisableFlag = true
  327. }
  328. }
  329. })
  330. }
  331. })
  332. },
  333. // 同意提交
  334. agreeSubmit () {
  335. this.$confirm(`是否确认提交?`, '提示', {
  336. confirmButtonText: '确定',
  337. cancelButtonText: '取消',
  338. type: 'warning'
  339. }).then(() => {
  340. let tempData = {
  341. site: this.searchData.site,
  342. userName: this.$store.state.user.name,
  343. codeNo: this.searchData.codeNo,
  344. menuId: '103002',
  345. nodeConclusion: 'Y'
  346. }
  347. this.submitData(tempData)
  348. })
  349. },
  350. // 打开提交模态框
  351. submitDataModal () {
  352. this.rejectOpinion = ''
  353. this.submitModalFlag = true
  354. },
  355. // 驳回提交
  356. rejectSubmit () {
  357. this.$confirm(`是否确认驳回?`, '提示', {
  358. confirmButtonText: '确定',
  359. cancelButtonText: '取消',
  360. type: 'warning'
  361. }).then(() => {
  362. let tempData = {
  363. site: this.searchData.site,
  364. userName: this.$store.state.user.name,
  365. codeNo: this.searchData.codeNo,
  366. menuId: '103002',
  367. nodeConclusion: 'N',
  368. rejectOpinion : this.rejectOpinion
  369. }
  370. this.submitData(tempData)
  371. })
  372. },
  373. submitData (tempData) {
  374. saveBMPropertiesValue(this.tableData).then(({data}) => {
  375. if (data && data.code === 0) {
  376. submitChange(tempData).then(({data}) => {
  377. if (data && data.code === 0) {
  378. this.searchTable()
  379. this.submitModalFlag = false
  380. this.$emit("closeModel")
  381. } else {
  382. this.$alert(data.msg, '错误', {
  383. confirmButtonText: '确定'
  384. })
  385. }
  386. })
  387. } else {
  388. this.$message.error(data.msg)
  389. }
  390. })
  391. },
  392. },
  393. }
  394. </script>
  395. <style scoped>
  396. </style>