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.

425 lines
16 KiB

3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
1 year ago
1 year 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
2 years ago
3 years ago
3 years ago
2 years ago
1 year ago
2 years ago
1 year 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
2 years ago
2 years ago
2 years ago
3 years ago
3 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
2 years ago
3 years ago
2 years ago
3 years ago
1 year ago
3 years ago
1 year ago
3 years ago
2 years ago
3 years ago
3 years ago
2 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
2 years ago
3 years ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
1 year ago
1 year 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
1 year 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
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
3 years ago
1 year ago
1 year 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="属性模板编码/Template ID">
  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:bmSave') && spForm.sp.includes(searchData.username) && baseForm.status === 'spz') || baseForm.status === 'cg' || superAdmin">更新模板</el-button>
  14. <el-button type="primary" @click="searchTable()">刷新数据</el-button>
  15. <el-button type="primary" @click="saveTable()" v-if="(!ifDisableFlag && isAuth('103002:bmSave') && spForm.sp.includes(searchData.username) && baseForm.status === 'spz') || baseForm.status === 'cg' || superAdmin">保存数据</el-button>
  16. <template v-if="defaultValue">
  17. <el-button v-if="baseForm.status === 'spz' && ((!ifDisableFlag && spForm.sp.includes(searchData.username)) || (superAdmin))" type="primary" :loading="submitLoading" @click="agreeSubmit">同意</el-button>
  18. <el-button v-if="baseForm.status === 'spz' && (( baseForm.isReject === 'Y' && !ifDisableFlag && spForm.sp.includes(searchData.username)) || (superAdmin))" type="primary" @click="submitDataModal">驳回</el-button>
  19. </template>
  20. </el-form-item>
  21. </el-col>
  22. <el-col :span="3"><div class="grid-content bg-purple">
  23. <el-form-item label="当前节点/Status" style="width: 100%">
  24. <el-input v-model="spForm.nodeName" disabled></el-input>
  25. </el-form-item>
  26. </div>
  27. </el-col>
  28. <el-col :span="3"><div class="grid-content bg-purple">
  29. <el-form-item label="当前节点审批人/Authorizer" style="width: 100%">
  30. <el-input v-model="spForm.sp" disabled></el-input>
  31. </el-form-item>
  32. </div>
  33. </el-col>
  34. </el-row>
  35. <div class="rq ">
  36. <el-table
  37. :height="height"
  38. :data="tableData"
  39. border
  40. style="width: 100%">
  41. <el-table-column
  42. prop="propertiesItemNo"
  43. header-align="center"
  44. align="left"
  45. width="150"
  46. label="属性编码">
  47. </el-table-column>
  48. <el-table-column
  49. prop="itemDesc"
  50. header-align="center"
  51. align="left"
  52. width="150"
  53. label="属性名称">
  54. </el-table-column>
  55. <el-table-column
  56. prop="valueTypeDb"
  57. header-align="center"
  58. align="center"
  59. width="80"
  60. label="数据类型">
  61. <template slot-scope="scope">
  62. <span v-if="scope.row.valueTypeDb === 'N'">数字</span>
  63. <span v-else-if="scope.row.valueTypeDb === 'T'">文本</span>
  64. <!-- <a v-else-if="scope.row.valueTypeDb === 'S'" @click="openNewPage(scope.row.textValue)" >超链接</a>-->
  65. <a v-else-if="scope.row.valueTypeDb === 'S'" @click="openNewPage(scope.row.textValue)" >超链接</a>
  66. </template>
  67. </el-table-column>
  68. <el-table-column
  69. header-align="center"
  70. align="left"
  71. min-width="400"
  72. label="值">
  73. <template slot-scope="scope">
  74. <div v-highlight-container>
  75. <el-input v-if="scope.row.valueTypeDb === 'T'&&scope.row.valueChooseFlag === 'N'" v-model="scope.row.textValue" style="height: 11px;padding: 0px ;width:98%" class="left-align" allow-create :disabled="ifDisableFlag" ></el-input>
  76. <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>
  77. <el-input v-if="scope.row.valueTypeDb === 'N'&&scope.row.valueChooseFlag === 'N'" v-model="scope.row.numValue" type="number" @input="(value) => scope.row.numValue = value.replace(/[^0-9.]/g, '')" class="left-align" style="height: 11px;padding: 0px;width:98%" allow-create :disabled="ifDisableFlag"></el-input>
  78. <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">
  79. <el-option
  80. v-for="item in scope.row.availableValueList"
  81. :key="index"
  82. :label="item.availableValue"
  83. :value="item.availableValue">
  84. </el-option>
  85. </el-select>
  86. <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">
  87. <el-option
  88. v-for="item in scope.row.availableValueList"
  89. :key="index"
  90. :label="item.availableValue"
  91. :value="item.availableValue">
  92. </el-option>
  93. </el-select>
  94. <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">
  95. <el-option
  96. v-for="item in scope.row.availableValueList"
  97. :key="index"
  98. :label="item.availableValue"
  99. :value="item.availableValue">
  100. </el-option>
  101. </el-select></div>
  102. </div>
  103. </template>
  104. </el-table-column>
  105. </el-table>
  106. </div>
  107. </el-form>
  108. <!-- 提交 -->
  109. <el-dialog title="驳回" top="30vh" :close-on-click-modal="false" v-drag :visible.sync="submitModalFlag" width="500px">
  110. <el-form :inline="true" label-position="top">
  111. <el-form-item :label="'驳回意见'">
  112. <el-input type="textarea" v-model="rejectOpinion" :rows="3" resize='none' show-word-limit style="width: 479px;height: 30px"></el-input>
  113. </el-form-item>
  114. </el-form>
  115. <el-footer style="height:30px;margin-top: 50px;text-align:center">
  116. <el-button type="primary" :loading="submitLoading" @click="rejectSubmit">确定</el-button>
  117. <el-button type="primary" @click="submitModalFlag = false">取消</el-button>
  118. </el-footer>
  119. </el-dialog>
  120. </div>
  121. </template>
  122. <script>
  123. import {
  124. searchBMPropertiesValue,
  125. saveBMPropertiesValue,
  126. refreshBMPageModal,
  127. searchBMPropertiesHeaderForBM,
  128. checkUrl,
  129. tsdBasicInformationSearch,getBMStatusDesc,
  130. submitChange, // 提交
  131. getOADetailForBM,
  132. } from "@/api/sampleManagement/technicalSpecificationList.js"
  133. import {
  134. getNodeAuthority, // 获取节点权限
  135. } from '@/api/changeManagement/changeManagement.js'
  136. export default {
  137. components: {
  138. },
  139. props:{
  140. // 审批显示控制
  141. defaultValue:{
  142. type:Boolean,
  143. default:true,
  144. }
  145. },
  146. data() {
  147. return {
  148. superAdmin:false,
  149. height:200,
  150. searchData: {
  151. site: '',
  152. username: this.$store.state.user.name,
  153. codeNo: '',
  154. oriCodeNo: '',
  155. buNo:'',
  156. type:'',
  157. propertiesCodeNo:'',
  158. fieldId:'',
  159. },
  160. type:'prepress',
  161. ifDisableFlag:false,
  162. tableData:[],
  163. baseForm:{
  164. status:'',
  165. isReject:'',
  166. },
  167. spForm:{
  168. sp:'',
  169. nodeName:'',
  170. },
  171. rejectOpinion: '',
  172. submitModalFlag: false,
  173. submitLoading: false
  174. }
  175. },
  176. mounted () {
  177. this.$nextTick(() => {
  178. this.height =0.7* window.innerHeight
  179. })
  180. },
  181. methods: {
  182. // 初始化组件的参数
  183. init (inData) {
  184. // if (this.searchData.codeNo != null && this.searchData.codeNo !== '') {
  185. // return false;
  186. // }
  187. // 初始化参数
  188. this.searchData = JSON.parse(JSON.stringify(inData))
  189. if (this.searchData.ifDisableFlag) {
  190. this.ifDisableFlag = true
  191. }
  192. //this.searchData.type= JSON.parse(JSON.stringify(this.type));
  193. // 刷新表格
  194. this.$nextTick(()=>{
  195. // this.searchTable();
  196. getOADetailForBM(this.searchData).then(({data}) => {
  197. this.spForm.nodeName = data.row.nodeName
  198. this.spForm.sp = data.row.sp == null ? '' : data.row.sp
  199. })
  200. searchBMPropertiesValue(this.searchData).then(({data}) => {
  201. this.tableData = data.rows
  202. })
  203. searchBMPropertiesHeaderForBM(this.searchData).then(({data}) => {
  204. // this.searchData.propertiesCodeNo = data.row.propertiesCodeNo;
  205. this.$set(this.searchData, 'propertiesCodeNo', data.row.propertiesCodeNo)
  206. })
  207. tsdBasicInformationSearch(this.searchData).then(({data}) => {
  208. this.baseForm = data.row
  209. this.getNodeAuthority(data.row)
  210. })
  211. this.$clearHighLight()
  212. })
  213. },
  214. searchTable () {
  215. getOADetailForBM(this.searchData).then(({data}) => {
  216. this.spForm.nodeName = data.row.nodeName
  217. this.spForm.sp = data.row.sp == null ? '' : data.row.sp
  218. })
  219. searchBMPropertiesValue(this.searchData).then(({data}) => {
  220. this.tableData = data.rows
  221. this.$message({
  222. message: '操作成功',
  223. type: 'success',
  224. duration: 1500,
  225. onClose: () => {}
  226. })
  227. })
  228. searchBMPropertiesHeaderForBM(this.searchData).then(({data}) => {
  229. // this.searchData.propertiesCodeNo = data.row.propertiesCodeNo;
  230. this.$set(this.searchData, 'propertiesCodeNo', data.row.propertiesCodeNo)
  231. })
  232. tsdBasicInformationSearch(this.searchData).then(({data}) => {
  233. this.baseForm = data.row
  234. this.getNodeAuthority(data.row)
  235. })
  236. this.$clearHighLight()
  237. },
  238. refreshBMPageModal () {
  239. this.$confirm(`是否刷新至最新模板界面,已填数据会更新到新模板中,若旧属性在新模板中被删除,该条数据会消失。`, '提示', {
  240. confirmButtonText: '确定',
  241. cancelButtonText: '取消',
  242. type: 'warning'
  243. }).then(() => {
  244. refreshBMPageModal(this.searchData).then(({data}) => {
  245. if (data && data.code === 0) {
  246. this.searchTable()
  247. } else {
  248. this.$alert(data.msg, '错误', {
  249. confirmButtonText: '确定'
  250. })
  251. }
  252. })
  253. })
  254. },
  255. saveTable () {
  256. saveBMPropertiesValue(this.tableData).then(({data}) => {
  257. if (data && data.code === 0) {
  258. this.$clearHighLight()
  259. this.$message({
  260. message: '操作成功',
  261. type: 'success',
  262. duration: 1500,
  263. onClose: () => {}
  264. })
  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 === '') {
  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 === '已升版' || data.status === 'Dead') {
  305. this.ifDisableFlag = true
  306. return false
  307. }
  308. if (data.status === '审批中' || 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. this.submitLoading = true
  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. // window.location.reload();
  381. this.submitModalFlag = false
  382. this.submitLoading = false
  383. this.$emit("closeModel")
  384. } else {
  385. this.submitLoading = false
  386. this.$alert(data.msg, '错误', {
  387. confirmButtonText: '确定'
  388. })
  389. }
  390. }).catch(()=>{
  391. this.submitLoading = false
  392. })
  393. } else {
  394. this.submitLoading = false
  395. this.$message.error(data.msg)
  396. }
  397. }).catch(()=>{
  398. this.submitLoading = false
  399. })
  400. },
  401. },
  402. }
  403. </script>
  404. <style scoped>
  405. input[readonly] {
  406. cursor: text;
  407. }
  408. .left-align /deep/ .el-input__inner {
  409. text-align: left !important;
  410. }
  411. </style>