Browse Source

plm 工具具

master
ruanqi 1 year ago
parent
commit
b19ccc1072
  1. 4
      src/api/base/properties.js
  2. 24
      src/views/modules/demoComponents/orderProperties.vue

4
src/api/base/properties.js

@ -59,3 +59,7 @@ export const updatePropertiesList= (data) => createAPI(`/properties/updateProper
export const refreshPropertiesModal= (data) => createAPI(`/properties/refreshPropertiesModal`,'post',data) export const refreshPropertiesModal= (data) => createAPI(`/properties/refreshPropertiesModal`,'post',data)
export const getItemListsForPartAndCode= (data) => createAPI(`/properties/getItemListsForPartAndCode`,'post',data) export const getItemListsForPartAndCode= (data) => createAPI(`/properties/getItemListsForPartAndCode`,'post',data)
export const searchPropertiesItemList= data => createAPI(`/properties/searchPropertiesItemList`,'post',data) export const searchPropertiesItemList= data => createAPI(`/properties/searchPropertiesItemList`,'post',data)
export const saveSubPropertiesValueForAlone= data => createAPI(`/properties/saveSubPropertiesValueForAlone`,'post',data)
export const deleteSubPropertiesValueForAlone= data => createAPI(`/properties/deleteSubPropertiesValueForAlone`,'post',data)

24
src/views/modules/demoComponents/orderProperties.vue

@ -3,7 +3,7 @@
<div style="margin-top: 5px"> <div style="margin-top: 5px">
<el-button type="primary" @click="clickSaveBtn" v-if="orderNo">新增</el-button> <el-button type="primary" @click="clickSaveBtn" v-if="orderNo">新增</el-button>
<el-button type="primary" :loading="loading" v-if="orderNo" @click="clickSave">{{ attributeDialog?'编辑':'保存' }}</el-button> <el-button type="primary" :loading="loading" v-if="orderNo" @click="clickSave">{{ attributeDialog?'编辑':'保存' }}</el-button>
<!-- <el-button type="primary" @click="refreshPropertiesModal" v-if="attributeDialog">刷新属性模板</el-button>-->
<el-button type="primary" @click="refreshPropertiesModal" v-if="attributeDialog">刷新属性模板</el-button>
</div> </div>
<div class="rq " v-if="attributeDialog"> <div class="rq " v-if="attributeDialog">
<el-table <el-table
@ -90,7 +90,7 @@
<script> <script>
import {propertiesList,refreshPropertiesModal,updatePropertiesList,getPropertiesListByPartAndCodeNo import {propertiesList,refreshPropertiesModal,updatePropertiesList,getPropertiesListByPartAndCodeNo
,searchPropertiesItemList
,searchPropertiesItemList,saveSubPropertiesValueForAlone,deleteSubPropertiesValueForAlone
} from "@/api/base/properties.js"; } from "@/api/base/properties.js";
import { import {
@ -319,6 +319,7 @@ export default {
for (let i = 0; i <this.dataList2.length ; i++) { for (let i = 0; i <this.dataList2.length ; i++) {
this.dataList2[i].itemNo= this.dataList2[i].propertiesItemNo this.dataList2[i].itemNo= this.dataList2[i].propertiesItemNo
} }
this.searchAttributeList({})
}else { }else {
this.$message.warning(data.msg) this.$message.warning(data.msg)
} }
@ -364,11 +365,17 @@ export default {
saveTestPropertiesItem(params){ saveTestPropertiesItem(params){
let i = 0; let i = 0;
let arr = params.searchTableList.map(item=>{ let arr = params.searchTableList.map(item=>{
item.testNo = this.testNo;
item.seqNo = i++;
item.partNo = this.orderNo;
item.site = this.$store.state.user.site;
item.codeNo = this.codeNo;
item.recordType = this.functionType;
return item return item
}) })
saveTestPropertiesItem(arr).then(({data})=>{
for (let j = 0; j <arr.length ; j++) {
arr[j].propertiesItemNo= arr[j].itemNo
arr[j].itemNo=999
}
saveSubPropertiesValueForAlone(arr).then(({data})=>{
if (data && data.code === 0){ if (data && data.code === 0){
this.$message.success(data.msg); this.$message.success(data.msg);
this.getProperties(params) this.getProperties(params)
@ -380,10 +387,15 @@ export default {
}) })
}, },
removeTestPropertiesItem(params){ removeTestPropertiesItem(params){
removeTestPropertiesItem(params.dataTableList).then(({data})=>{
for (let i = 0; i <params.dataTableList.length ; i++) {
params.dataTableList[i].propertiesItemNo= params.dataTableList[i].itemNo
params.dataTableList[i].itemNo=999
}
deleteSubPropertiesValueForAlone(params.dataTableList).then(({data})=>{
if (data && data.code === 0){ if (data && data.code === 0){
this.$message.success(data.msg); this.$message.success(data.msg);
this.getProperties(params) this.getProperties(params)
}else { }else {
this.$message.warning(data.msg); this.$message.warning(data.msg);
} }

Loading…
Cancel
Save