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.

226 lines
7.9 KiB

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
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
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
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
2 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
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
  1. <template>
  2. <div class="mod-config">
  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.codeNo" 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-form-item>
  15. <div class="rq ">
  16. <el-table
  17. :height="height"
  18. :data="tableData"
  19. border
  20. style="width: 100%">
  21. <el-table-column
  22. prop="propertiesItemNo"
  23. header-align="center"
  24. align="left"
  25. width="150"
  26. label="属性编码">
  27. </el-table-column>
  28. <el-table-column
  29. prop="itemDesc"
  30. header-align="center"
  31. align="left"
  32. width="150"
  33. label="属性名称">
  34. </el-table-column>
  35. <el-table-column
  36. prop="valueTypeDb"
  37. header-align="center"
  38. align="center"
  39. width="80"
  40. label="数据类型">
  41. <template slot-scope="scope">
  42. <span v-if="scope.row.valueTypeDb === 'N'">数字</span>
  43. <span v-else-if="scope.row.valueTypeDb === 'T'">文本</span>
  44. <!-- <a v-else-if="scope.row.valueTypeDb === 'S'" @click="openNewPage(scope.row.textValue)" >超链接</a>-->
  45. <a v-else-if="scope.row.valueTypeDb === 'S'" @click="openNewPage(scope.row.textValue)" >超链接</a>
  46. </template>
  47. </el-table-column>
  48. <el-table-column
  49. header-align="center"
  50. align="left"
  51. min-width="400"
  52. label="值">
  53. <template slot-scope="scope">
  54. <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></el-input>
  55. <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></el-input></div>
  56. <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></el-input>
  57. <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>
  58. <el-option
  59. v-for="item in scope.row.availableValueList"
  60. :key="index"
  61. :label="item.availableValue"
  62. :value="item.availableValue">
  63. </el-option>
  64. </el-select>
  65. <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>
  66. <el-option
  67. v-for="item in scope.row.availableValueList"
  68. :key="index"
  69. :label="item.availableValue"
  70. :value="item.availableValue">
  71. </el-option>
  72. </el-select>
  73. <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>
  74. <el-option
  75. v-for="item in scope.row.availableValueList"
  76. :key="index"
  77. :label="item.availableValue"
  78. :value="item.availableValue">
  79. </el-option>
  80. </el-select></div>
  81. </template>
  82. </el-table-column>
  83. </el-table>
  84. </div>
  85. </el-form>
  86. </div>
  87. </template>
  88. <script>
  89. import {
  90. searchBMPropertiesValue,
  91. saveBMPropertiesValue,
  92. refreshBMPageModal,
  93. searchBMPropertiesHeaderForBM,
  94. checkUrl,
  95. } from "@/api/sampleManagement/technicalSpecificationList.js"
  96. export default {
  97. components: {
  98. },
  99. data() {
  100. return {
  101. height:200,
  102. searchData: {
  103. site: '',
  104. username: this.$store.state.user.name,
  105. codeNo: '',
  106. buNo:'',
  107. type:'',
  108. propertiesCodeNo:'',
  109. },
  110. type:'prepress',
  111. ifDisableFlag:false,
  112. tableData:[],
  113. }
  114. },
  115. mounted () {
  116. this.$nextTick(() => {
  117. this.height =0.7* window.innerHeight
  118. })
  119. },
  120. methods: {
  121. //初始化组件的参数
  122. init(inData) {
  123. if(this.searchData.codeNo!=null&&this.searchData.codeNo!=''){
  124. return false;
  125. }
  126. //初始化参数
  127. this.searchData = JSON.parse(JSON.stringify(inData));
  128. if(this.searchData.ifDisableFlag){
  129. this.ifDisableFlag=true
  130. }
  131. //this.searchData.type= JSON.parse(JSON.stringify(this.type));
  132. //刷新表格
  133. this.$nextTick(()=>{
  134. this.searchTable();
  135. } )
  136. },
  137. searchTable(){
  138. searchBMPropertiesValue(this.searchData).then(({data}) => {
  139. this.tableData = data.rows;
  140. });
  141. searchBMPropertiesHeaderForBM(this.searchData).then(({data}) => {
  142. // this.searchData.propertiesCodeNo = data.row.propertiesCodeNo;
  143. this.$set(this.searchData, 'propertiesCodeNo', data.row.propertiesCodeNo);
  144. });
  145. },
  146. refreshBMPageModal(){
  147. this.$confirm(`是否刷新至最新模板界面,已填数据会更新到新模板中,若旧属性在新模板中被删除,该条数据会消失。`, '提示', {
  148. confirmButtonText: '确定',
  149. cancelButtonText: '取消',
  150. type: 'warning'
  151. }).then(() => {
  152. refreshBMPageModal(this.searchData).then(({data}) => {
  153. if (data && data.code === 0) {
  154. this.searchTable();
  155. this.$message({
  156. message: '操作成功',
  157. type: 'success',
  158. duration: 1500,
  159. onClose: () => {
  160. }
  161. })
  162. } else {
  163. this.$alert(data.msg, '错误', {
  164. confirmButtonText: '确定'
  165. })
  166. }
  167. })
  168. }).catch(() => {
  169. })
  170. },
  171. saveTable(){
  172. saveBMPropertiesValue(this.tableData).then(({data}) => {
  173. if (data && data.code === 0) {
  174. this.$message({
  175. message: '操作成功',
  176. type: 'success',
  177. duration: 1500,
  178. onClose: () => {
  179. }
  180. })
  181. this.$emit("closeModel")
  182. } else {
  183. this.$alert(data.msg, '错误', {
  184. confirmButtonText: '确定'
  185. })
  186. }
  187. });
  188. },
  189. openNewPage(url){
  190. // window.open(this.$store.state.user.bmPicUrl +url);
  191. if(url==null||url===''){
  192. this.$alert("链接没有数据!", '错误', {
  193. confirmButtonText: '确定'
  194. })
  195. return false;
  196. }
  197. let data={
  198. url:url
  199. }
  200. checkUrl(data).then(({data}) => {
  201. if (data && data.code === 0) {
  202. window.open(data.url);
  203. } else {
  204. this.$alert(data.msg, '错误', {
  205. confirmButtonText: '确定'
  206. })
  207. }
  208. });
  209. },
  210. },
  211. }
  212. </script>
  213. <style scoped>
  214. </style>