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.

356 lines
13 KiB

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