Browse Source

2024-04-03

master
zelian_wu 2 years ago
parent
commit
b3742cce5d
  1. 2
      src/api/base/properties.js
  2. 2
      src/api/dict.js
  3. 1
      src/api/test/testProperties.js
  4. 513
      src/views/modules/base/propertiesItem/propertiesModel.vue
  5. 5
      src/views/modules/common/uploadFileList.vue
  6. 11
      src/views/modules/sys/dict-data-select.vue
  7. 2
      src/views/modules/test/file/testFile.vue
  8. 91
      src/views/modules/test/requestForTest.vue
  9. 106
      src/views/modules/test/testAttribute/testProperties.vue

2
src/api/base/properties.js

@ -47,4 +47,6 @@ export const updateBMModal= data => createAPI(`/technicalSpecification/updateBMM
export const searchMenuAllListId= (data) => createAPI(`/properties/menu/list`,'post',data) export const searchMenuAllListId= (data) => createAPI(`/properties/menu/list`,'post',data)
export const searchBUList= (data) => createAPI(`/properties/bu/list`,'post',data) export const searchBUList= (data) => createAPI(`/properties/bu/list`,'post',data)
export const searchPropertiesGroup= (data) => createAPI(`/properties/group/list`,'post',data) export const searchPropertiesGroup= (data) => createAPI(`/properties/group/list`,'post',data)
export const searchBUPropertiesList= (data) => createAPI(`/bu/properties/list`,'post',data)
export const saveBUPropertiesList= (data) => createAPI(`/bu/properties/save`,'post',data)

2
src/api/dict.js

@ -42,7 +42,7 @@ export const updateDictType = (data) => createAPI(`/sys/dictType/update`,'post',
* @returns {*} * @returns {*}
*/ */
export const selectDictDataPage = (no,size,data) =>createAPI(`/sys/dictData/${no}/${size}`,'get',data) export const selectDictDataPage = (no,size,data) =>createAPI(`/sys/dictData/${no}/${size}`,'get',data)
export const selectDictDataList = (data) =>createAPI(`/sys/dictData/list`,'get',data)
export const selectDictDataList = (data) =>createAPI(`/sys/dictData/list`,'post',data)
/** /**
* 新增字典数据 * 新增字典数据
* @param data * @param data

1
src/api/test/testProperties.js

@ -3,3 +3,4 @@ import {createAPI} from "../../utils/httpRequest";
export const getTestPropertiesList = (data)=>createAPI(`/test/properties/list`,'post',data) export const getTestPropertiesList = (data)=>createAPI(`/test/properties/list`,'post',data)
export const updateTestPropertiesList = (data)=>createAPI(`/test/properties/update`,'post',data) export const updateTestPropertiesList = (data)=>createAPI(`/test/properties/update`,'post',data)
export const searchTestPropertiesList = (data)=>createAPI(`/test/properties/search`,'post',data) export const searchTestPropertiesList = (data)=>createAPI(`/test/properties/search`,'post',data)
export const searchModalDetails = (data)=>createAPI(`/properties/searchModalDetails`,'post',data)

513
src/views/modules/base/propertiesItem/propertiesModel.vue

@ -7,34 +7,42 @@
<el-form-item :label="'属性模板名称'"> <el-form-item :label="'属性模板名称'">
<el-input v-model="searchData.codeDesc" style="width: 120px"></el-input> <el-input v-model="searchData.codeDesc" style="width: 120px"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="'模板分类'" >
<el-select filterable v-model="searchData.functionType" style="width: 120px">
<el-option label="全部" value=""></el-option>
<el-option label="A" value="A"></el-option>
<el-option label="IP" value="IP"></el-option>
<el-option label="MP" value="MP"></el-option>
<el-option label="BM" value="BM"></el-option>
<el-option label="ECN" value="ECN"></el-option>
<el-option label="TEST" value="TEST"></el-option>
</el-select>
</el-form-item>
<el-form-item label="模板分组">
<el-select v-model="searchData.group" @change="getDataList">
<el-form-item label="应用菜单">
<el-select v-model="searchData.group" @change="changeMenu('dictDataSelect')">
<el-option :value="i.menuId" :label="i.name" v-for="i in menuList" :key="i.menuId"></el-option> <el-option :value="i.menuId" :label="i.name" v-for="i in menuList" :key="i.menuId"></el-option>
</el-select> </el-select>
<!-- <el-select multiple-->
<!-- collapse-tags style="width: 200px;" v-model="searchData.menuList" @change="changeMenu('dictDataSelect')">-->
<!-- <el-option :value="i.menuId" :label="i.name" v-for="i in menuList" :key="i.menuId"></el-option>-->
<!-- </el-select>-->
</el-form-item>
<el-form-item :label="'模板分类'">
<!-- <el-select filterable v-model="searchData.functionType" style="width: 120px">-->
<!-- <el-option label="全部" value=""></el-option>-->
<!-- <el-option label="A" value="A"></el-option>-->
<!-- <el-option label="IP" value="IP"></el-option>-->
<!-- <el-option label="MP" value="MP"></el-option>-->
<!-- <el-option label="BM" value="BM"></el-option>-->
<!-- <el-option label="ECN" value="ECN"></el-option>-->
<!-- <el-option label="TEST" value="TEST"></el-option>-->
<!-- <el-option label="询价" value="PRICECHECK"></el-option>-->
<!-- </el-select>-->
<dict-data-select ref="dictDataSelect" @change="getDataList" v-model="searchData.functionType" clearable :dict-type="searchData.group"
:use-default-value="false"></dict-data-select>
</el-form-item> </el-form-item>
<el-form-item label="BU类别">
<el-select v-model="searchData.bu" @change="getDataList">
<el-form-item label="BU">
<el-select v-model="searchData.buNo" @change="getDataList" clearable>
<el-option :value="i.buNo" :label="i.buDesc" v-for="i in BUList" :key="i.buNo"></el-option> <el-option :value="i.buNo" :label="i.buDesc" v-for="i in BUList" :key="i.buNo"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="'状态'"> <el-form-item :label="'状态'">
<!-- <el-select filterable v-model="searchData.active" style="width: 130px">-->
<!-- <el-option label="全部" value=""></el-option>-->
<!-- <el-option label="是" value="Y"></el-option>-->
<!-- <el-option label="否" value="N"></el-option>-->
<!-- </el-select>-->
<dict-data-select v-model="searchData.active" clearable dict-type="sys_status" :use-default-value="false"></dict-data-select>
<!-- <el-select filterable v-model="searchData.active" style="width: 130px">-->
<!-- <el-option label="全部" value=""></el-option>-->
<!-- <el-option label="是" value="Y"></el-option>-->
<!-- <el-option label="否" value="N"></el-option>-->
<!-- </el-select>-->
<dict-data-select v-model="searchData.active" clearable dict-type="sys_status"
:use-default-value="false"></dict-data-select>
</el-form-item> </el-form-item>
<el-form-item :label="' '"> <el-form-item :label="' '">
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
@ -99,10 +107,11 @@
:label="item.columnLabel"> :label="item.columnLabel">
<template slot-scope="{row,$index}"> <template slot-scope="{row,$index}">
<div v-if="item.columnProp !== 'active'"> <div v-if="item.columnProp !== 'active'">
<span v-if="!item.columnHidden">{{row[item.columnProp]}}</span>
<span v-if="!item.columnHidden">{{ row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="row[item.columnProp]" style="width: 100px; height: 80px"/></span> <span v-if="item.columnImage"><img :src="row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</div> </div>
<span v-else :style="{color:row.active === 'Y'?'#67C23A':'red'}">{{row.active === 'Y'?'启用':'停用'}}</span>
<span v-else
:style="{color:row.active === 'Y'?'#67C23A':'red'}">{{ row.active === 'Y' ? '启用' : '停用' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -112,11 +121,15 @@
width="160" width="160"
label="操作"> label="操作">
<template slot-scope="{row,$index}"> <template slot-scope="{row,$index}">
<el-link style="cursor:pointer;" type="primary" v-if="row.isSystem !== 'Y'" @click="updateModal(row)">修改</el-link>
<el-link style="cursor:pointer;" type="primary" v-if="row.isSystem !== 'Y'" @click="updateModal(row)">修改
</el-link>
<span style="cursor:no-drop;color: #aaa" v-else>修改</span> <span style="cursor:no-drop;color: #aaa" v-else>修改</span>
<el-link style="cursor:pointer;" type="primary" size="small" @click="detailModal(row)">属性项目</el-link> <el-link style="cursor:pointer;" type="primary" size="small" @click="detailModal(row)">属性项目</el-link>
<el-link style="cursor:pointer;" type="primary" v-if="row.isSystem !== 'Y'" @click="deletePropertiesModel(row)">删除</el-link>
<el-link style="cursor:pointer;" type="primary" v-if="row.isSystem !== 'Y'"
@click="deletePropertiesModel(row)">删除
</el-link>
<span style="cursor:no-drop;color: #aaa" v-else>删除</span> <span style="cursor:no-drop;color: #aaa" v-else>删除</span>
<el-link style="cursor:pointer;" type="primary" @click="BUBtnDialog(row)">BU授权</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -129,37 +142,26 @@
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
</el-pagination> </el-pagination>
<el-dialog title="属性模板" top="20vh" :close-on-click-modal="false" @close="()=>{this.$refs.modeForm.resetFields();}" v-drag :visible.sync="modalFlag" width="27vw">
<el-dialog title="属性模板" top="20vh" :close-on-click-modal="false"
@close="()=>{this.$refs.modeForm.resetFields();}" v-drag :visible.sync="modalFlag" width="500px">
<el-form ref="modeForm" label-position="top" :model="modalData" :rules="rules"> <el-form ref="modeForm" label-position="top" :model="modalData" :rules="rules">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="8">
<el-col :span="10">
<el-form-item label="属性模板编码:" prop="codeNo"> <el-form-item label="属性模板编码:" prop="codeNo">
<el-input v-model="modalData.codeNo" :disabled="modalDisableFlag"></el-input>
<el-input v-model="modalData.codeNo" :disabled="this.modalData.flag !== '1'"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="16">
<el-col :span="14">
<el-form-item label="属性模板名称:" prop="codeDesc"> <el-form-item label="属性模板名称:" prop="codeDesc">
<el-input v-model="modalData.codeDesc"></el-input> <el-input v-model="modalData.codeDesc"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item :label="'模板分类'" >
<el-select filterable style="width: 100%;" v-model="modalData.functionType" :disabled="modalDisableFlag">
<el-option label="A" value="A"></el-option>
<el-option label="IP" value="IP"></el-option>
<el-option label="MP" value="MP"></el-option>
<el-option label="BM" value="BM"></el-option>
<el-option label="ECN" value="ECN"></el-option>
<!-- <el-option label="TEST" value="TEST"></el-option>-->
</el-select>
</el-form-item>
</el-col>
<el-col :span="16">
<el-form-item label="模板分组" required>
<el-select
v-model="modalData.menuList"
multiple clearable
collapse-tags style="width: 100%;"
<el-col :span="10">
<el-form-item label="应用菜单" required>
<el-select :disabled="this.modalData.flag !== '1'"
v-model="modalData.group"
@change="changeMenu('dialogDictDataSelect')"
style="width: 100%;"
placeholder="请选择"> placeholder="请选择">
<el-option <el-option
v-for="item in menuList" v-for="item in menuList"
@ -170,9 +172,25 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="14">
<el-form-item :label="'模板分类'" prop="functionType">
<!-- <el-select filterable style="width: 100%;" v-model="modalData.functionType" :disabled="modalDisableFlag">-->
<!-- <el-option label="A" value="A"></el-option>-->
<!-- <el-option label="IP" value="IP"></el-option>-->
<!-- <el-option label="MP" value="MP"></el-option>-->
<!-- <el-option label="BM" value="BM"></el-option>-->
<!-- <el-option label="ECN" value="ECN"></el-option>-->
<!-- <el-option label="TEST" value="TEST"></el-option>-->
<!-- <el-option label="询价" value="PRICECHECK"></el-option>-->
<!-- </el-select>-->
<dict-data-select :disabled="this.modalData.flag !== '1'" ref="dialogDictDataSelect" v-model="modalData.functionType" clearable :dict-type="modalData.group"
:use-default-value="false"></dict-data-select>
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="状态:" prop="active"> <el-form-item label="状态:" prop="active">
<dict-data-select v-model="modalData.active" clearable dict-type="sys_status" :use-default-value="false"></dict-data-select>
<dict-data-select v-model="modalData.active" clearable dict-type="sys_status"
:use-default-value="false"></dict-data-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -225,7 +243,8 @@
:label="item.columnLabel"> :label="item.columnLabel">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span> <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -235,7 +254,8 @@
width="130" width="130"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<a type="text" size="small" v-if="scope.row.valueChooseFlag === 'Y'" @click="chooseModal(scope.row)">可选值</a>
<a type="text" size="small" v-if="scope.row.valueChooseFlag === 'Y'"
@click="chooseModal(scope.row)">可选值</a>
<a type="text" size="small" @click="deleteModalDetails(scope.row)">删除属性</a> <a type="text" size="small" @click="deleteModalDetails(scope.row)">删除属性</a>
</template> </template>
</el-table-column> </el-table-column>
@ -261,7 +281,8 @@
<!-- </el-footer>--> <!-- </el-footer>-->
<!-- </el-dialog>--> <!-- </el-dialog>-->
<el-dialog title="新增" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="fastAddFlag" width="1000px">
<el-dialog title="新增" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="fastAddFlag"
width="1000px">
<div style="font-size: 12px"> <div style="font-size: 12px">
<!-- 属性模板编码<el-input v-model="detailData.codeNo" readonly style="width: 120px"></el-input>--> <!-- 属性模板编码<el-input v-model="detailData.codeNo" readonly style="width: 120px"></el-input>-->
<!-- 属性模板名称<el-input v-model="detailData.codeDesc" readonly style="width: 120px"></el-input>--> <!-- 属性模板名称<el-input v-model="detailData.codeDesc" readonly style="width: 120px"></el-input>-->
@ -279,7 +300,7 @@
</div> </div>
<el-container style="margin-top: 0px;"> <el-container style="margin-top: 0px;">
<el-main style="width: 350px;padding: 1px"> <el-main style="width: 350px;padding: 1px">
<span style="font-size: 12px" >可选属性</span>
<span style="font-size: 12px">可选属性</span>
<el-table <el-table
height="400px" height="400px"
:data="itemList1" :data="itemList1"
@ -322,7 +343,7 @@
</div> </div>
</el-main> </el-main>
<el-main style="width: 350px;padding: 1px"> <el-main style="width: 350px;padding: 1px">
<span style="font-size: 12px" >已有属性</span>
<span style="font-size: 12px">已有属性</span>
<el-table <el-table
height="400px" height="400px"
:data="itemList2" :data="itemList2"
@ -392,11 +413,30 @@
</el-footer> </el-footer>
</el-dialog> </el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
<el-dialog title="BU授权" v-drag :visible.sync="BUDialog" width="518px">
<el-form :inline="true" label-position="top" :model="modalData">
<el-form-item :label="'模板编码'">
<el-input v-model="modalData.codeNo" readonly style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'模板名称'">
<el-input v-model="modalData.codeDesc" readonly style="width: 120px"></el-input>
</el-form-item>
</el-form>
<el-transfer class="rq" :props="{key: 'buNo',label: 'buDesc' }"
filterable v-model="selectionBU"
:data="BUList">
</el-transfer>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="savePropertiesBU">保存</el-button>
<el-button type="primary" @click="BUDialog = false">关闭</el-button>
</el-footer>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import {
import {
propertiesModelSearch, propertiesModelSearch,
propertiesModelSave, propertiesModelSave,
propertiesModelEdit, propertiesModelEdit,
@ -409,12 +449,19 @@
deleteModalDetail, // deleteModalDetail, //
goUpItem, goUpItem,
goDownItem, goDownItem,
} from "@/api/base/properties.js"
import Chooselist from '@/views/modules/common/Chooselist'
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
import DictDataSelect from "../../sys/dict-data-select.vue";
import {searchBUList, searchMenuAllListId, searchPropertiesGroup} from "../../../../api/base/properties";
export default {
} from "@/api/base/properties.js"
import Chooselist from '@/views/modules/common/Chooselist'
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
import DictDataSelect from "../../sys/dict-data-select.vue";
import {
saveBUPropertiesList,
searchBUList,
searchBUPropertiesList,
searchMenuAllListId,
searchPropertiesGroup
} from "../../../../api/base/properties";
export default {
components: { components: {
DictDataSelect, DictDataSelect,
Chooselist Chooselist
@ -447,10 +494,12 @@
} }
} }
}, },
data () {
data() {
return { return {
BUList:[],
menuList:[],
selectionBU: [],
BUDialog: false,
BUList: [],
menuList: [],
// //
favorite: false, favorite: false,
// start // start
@ -458,17 +507,18 @@
exportName: "属性模板" + this.dayjs().format('YYYYMMDDHHmmss'), exportName: "属性模板" + this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ["属性模板"], exportHeader: ["属性模板"],
exportFooter: [], exportFooter: [],
exportList:[],
exportList: [],
// end // end
tagNo:'',
tagNo: '',
searchData: { searchData: {
site: this.$store.state.user.site, site: this.$store.state.user.site,
group:'',
bu:'',
group: '',
buNo: '',
codeNo: '', codeNo: '',
codeDesc: '', codeDesc: '',
active:'Y',
functionType:'',
active: 'Y',
functionType: '',
menuList:[],
page: 1, page: 1,
limit: 10, limit: 10,
}, },
@ -477,28 +527,28 @@
pageSize: 50, pageSize: 50,
totalPage: 0, totalPage: 0,
// addDetailModalFlag:false, // addDetailModalFlag:false,
modalFlag:false,
modalDisableFlag:false,
modalData:{
flag:'',
codeNo:'',
codeDesc:'',
active:'',
functionType:'',
menuList:[],
userId:this.$store.state.user.name,
modalFlag: false,
modalDisableFlag: false,
modalData: {
flag: '',
codeNo: '',
codeDesc: '',
active: '',
functionType: '',
group: '',
userId: this.$store.state.user.name,
createdBy: this.$store.state.user.name, createdBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name, updateBy: this.$store.state.user.name,
}, },
detailData:{
detailData: {
site: this.$store.state.user.site, site: this.$store.state.user.site,
codeNo:'',
codeDesc:'',
functionType:'',
itemNo:'',
itemDesc:'',
itemType:'',
userId:this.$store.state.user.name
codeNo: '',
codeDesc: '',
functionType: '',
itemNo: '',
itemDesc: '',
itemType: '',
userId: this.$store.state.user.name
}, },
columnList: [ columnList: [
{ {
@ -507,7 +557,7 @@
serialNumber: '100002001TableFunctionType', serialNumber: '100002001TableFunctionType',
tableId: "100002001Table", tableId: "100002001Table",
tableName: "属性项目表", tableName: "属性项目表",
columnProp: 'functionType',
columnProp: 'functionTypeDesc',
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
columnLabel: '模板分类', columnLabel: '模板分类',
@ -638,23 +688,23 @@
fixed: '', fixed: '',
}, },
], ],
detailModelFlag:false,
detailModelFlag: false,
detailList: [], detailList: [],
chooseTableData:[],
chooseTableData: [],
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
// modalDisableFlag:false, // modalDisableFlag:false,
chooseModalFlag:false,
itemFlag:'text',
itemData:{
itemNo:'',
valueNo:'',
availableValue:'',
itemType:'',
chooseModalFlag: false,
itemFlag: 'text',
itemData: {
itemNo: '',
valueNo: '',
availableValue: '',
itemType: '',
createdBy: this.$store.state.user.name createdBy: this.$store.state.user.name
}, },
dataList:[],
departmentList:[],
dataList: [],
departmentList: [],
// //
columnDetailList: [ columnDetailList: [
{ {
@ -777,38 +827,45 @@
fixed: '', fixed: '',
}, },
], ],
levelList:[],
chooseModalData:{
levelList: [],
chooseModalData: {
site: '', site: '',
itemNo: '', itemNo: '',
itemDesc: '', itemDesc: '',
itemType:'',
valueTypeDb:'',
itemType: '',
valueTypeDb: '',
}, },
//------------------- //-------------------
fastAddFlag:false,
itemList1:[],
itemList2:[],
itemListRow1:{},
itemListRow2:{},
fastAddFlag: false,
itemList1: [],
itemList2: [],
itemListRow1: {},
itemListRow2: {},
itemSelections1: [], itemSelections1: [],
itemSelections2: [], itemSelections2: [],
rules:{
codeNo:[
rules: {
codeNo: [
{
required: true,
message: ' ',
trigger: 'change'
}
],
codeDesc: [
{ {
required: true, required: true,
message: ' ', message: ' ',
trigger: 'change' trigger: 'change'
} }
], ],
codeDesc:[
active: [
{ {
required: true, required: true,
message: ' ', message: ' ',
trigger: 'change' trigger: 'change'
} }
], ],
active:[
functionType: [
{ {
required: true, required: true,
message: ' ', message: ' ',
@ -818,53 +875,63 @@
} }
} }
}, },
mounted () {
mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.height = window.innerHeight - 210 this.height = window.innerHeight - 210
}) })
}, },
async created () {
async created() {
await this.searchBUList(); await this.searchBUList();
await this.searchMenuList(); await this.searchMenuList();
}, },
methods: { methods: {
searchMenuList(){
changeMenu(ref){
this.getDataList();
this.$nextTick(()=>{
this.$refs[ref].initOption();
})
},
searchMenuList() {
let params = { let params = {
site:this.$store.state.user.site
site: this.$store.state.user.site
} }
searchMenuAllListId(params).then(({data})=>{
if (data && data.code === 0){
searchMenuAllListId(params).then(({data}) => {
if (data && data.code === 0) {
this.menuList = data.rows; this.menuList = data.rows;
if (this.menuList.length > 0){
if (this.menuList.length > 0) {
this.searchData.group = this.menuList[0].menuId this.searchData.group = this.menuList[0].menuId
// this.searchData.menuList.push(this.menuList[0].menuId)
} }
this.getDataList(); this.getDataList();
}else {
this.$nextTick(()=>{
this.$refs.dictDataSelect.initOption();
})
} else {
this.$message.warning(data.msg) this.$message.warning(data.msg)
} }
}).catch((error)=>{
}).catch((error) => {
this.$message.error(error) this.$message.error(error)
}) })
}, },
searchBUList(){
searchBUList() {
let params = { let params = {
site:this.$store.state.user.site
site: this.$store.state.user.site
} }
searchBUList(params).then(({data})=>{
if (data && data.code === 0){
searchBUList(params).then(({data}) => {
if (data && data.code === 0) {
this.BUList = data.rows; this.BUList = data.rows;
if (this.BUList.length > 0){
this.searchData.bu = this.BUList[0].buNo
if (this.BUList.length > 0) {
this.searchData.buNo = this.BUList[0].buNo
} }
}else {
} else {
this.$message.warning(data.msg) this.$message.warning(data.msg)
} }
}).catch((error)=>{
}).catch((error) => {
this.$message.error(error) this.$message.error(error)
}) })
}, },
// S // S
getBaseList (val,type) {
getBaseList(val, type) {
this.tagNo = val this.tagNo = val
this.$nextTick(() => { this.$nextTick(() => {
let strVal = '' let strVal = ''
@ -875,7 +942,7 @@
}) })
}, },
/* 列表方法的回调 */ /* 列表方法的回调 */
getBaseData (val) {
getBaseData(val) {
if (this.tagNo === 1024) { if (this.tagNo === 1024) {
this.detailData.itemNo = val.ItemNo this.detailData.itemNo = val.ItemNo
this.detailData.itemDesc = val.ItemDesc this.detailData.itemDesc = val.ItemDesc
@ -886,7 +953,7 @@
this.searchData.limit = -1 this.searchData.limit = -1
this.searchData.page = 1 this.searchData.page = 1
await propertiesModelSearch(this.searchData).then(({data}) => { await propertiesModelSearch(this.searchData).then(({data}) => {
this.exportList= data.page.list;
this.exportList = data.page.list;
}) })
return this.exportList; return this.exportList;
}, },
@ -911,7 +978,7 @@
}, },
// end // end
// //
getDataList () {
getDataList() {
this.searchData.limit = this.pageSize this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex this.searchData.page = this.pageIndex
propertiesModelSearch(this.searchData).then(({data}) => { propertiesModelSearch(this.searchData).then(({data}) => {
@ -925,31 +992,27 @@
}) })
}, },
// //
sizeChangeHandle (val) {
sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) {
currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
addModal(){
let menuList = []
if (this.menuList.length>0){
menuList.push(this.menuList[0].menuId)
}
addModal() {
this.modalData = { this.modalData = {
site: this.$store.state.user.site, site: this.$store.state.user.site,
flag:'1',
codeNo:'',
codeDesc:'',
active:'Y',
functionType:'A',
menuList: menuList,
userId:this.$store.state.user.name,
flag: '1',
codeNo: '',
codeDesc: '',
active: 'Y',
functionType: '',
group: '',
userId: this.$store.state.user.name,
createdBy: this.$store.state.user.name, createdBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name, updateBy: this.$store.state.user.name,
}; };
@ -957,32 +1020,22 @@
this.modalFlag = true; this.modalFlag = true;
}, },
updateModal(row){
updateModal(row) {
this.modalData = { this.modalData = {
site: this.$store.state.user.site, site: this.$store.state.user.site,
flag:'2',
codeNo:row.codeNo,
codeDesc:row.codeDesc,
active:row.active,
menuList:[],
functionType:row.functionType,
userId:this.$store.state.user.name,
flag: '2',
codeNo: row.codeNo,
codeDesc: row.codeDesc,
active: row.active,
group: row.group,
functionType: row.functionType,
userId: this.$store.state.user.name,
updateBy: this.$store.state.user.name, updateBy: this.$store.state.user.name,
}; };
searchPropertiesGroup(row).then(({data})=>{
if (data && data.code === 0){
this.modalData.menuList = data.rows;
}
this.modalDisableFlag=true;
this.modalFlag=true;
}).catch((error)=>{
this.modalDisableFlag=true;
this.modalFlag=true;
})
this.modalFlag = true;
}, },
// //
deletePropertiesModel (row) {
deletePropertiesModel(row) {
this.$confirm(`是否删除这个属性模板?`, '提示', { this.$confirm(`是否删除这个属性模板?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -1008,7 +1061,7 @@
}) })
}, },
saveData(){
saveData() {
if (this.modalData.codeNo == '' || this.modalData.codeNo == null) { if (this.modalData.codeNo == '' || this.modalData.codeNo == null) {
this.$alert('请输入属性模板编码!', '错误', { this.$alert('请输入属性模板编码!', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
@ -1027,13 +1080,13 @@
}) })
return false return false
} }
if (this.modalData.menuList.length <= 0){
this.$alert('选择模板分组!', '错误', {
if (this.modalData.functionType === '' && this.modalData.flag === '1') {
this.$alert('选择模板类型!', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
return false return false
} }
if(this.modalData.flag == '1'){
if (this.modalData.flag === '1') {
propertiesModelSave(this.modalData).then(({data}) => { propertiesModelSave(this.modalData).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.getDataList() this.getDataList()
@ -1051,11 +1104,11 @@
}) })
} }
}) })
}else {
} else {
propertiesModelEdit(this.modalData).then(({data}) => { propertiesModelEdit(this.modalData).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.getDataList() this.getDataList()
this.modalFlag=false
this.modalFlag = false
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
@ -1072,7 +1125,7 @@
} }
}, },
// //
detailModal(row){
detailModal(row) {
this.detailData.codeNo = row.codeNo this.detailData.codeNo = row.codeNo
this.detailData.codeDesc = row.codeDesc this.detailData.codeDesc = row.codeDesc
this.detailData.functionType = row.functionType this.detailData.functionType = row.functionType
@ -1081,7 +1134,7 @@
}) })
this.detailModelFlag = true; this.detailModelFlag = true;
}, },
deleteModalDetails(row){
deleteModalDetails(row) {
this.$confirm(`是否删除这个属性项目?`, '提示', { this.$confirm(`是否删除这个属性项目?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -1108,12 +1161,12 @@
}).catch(() => { }).catch(() => {
}) })
}, },
chooseModal(row){
chooseModal(row) {
this.chooseModalData.site = row.site; this.chooseModalData.site = row.site;
this.chooseModalData.itemNo = row.itemNo; this.chooseModalData.itemNo = row.itemNo;
this.chooseModalData.itemDesc = row.itemDesc; this.chooseModalData.itemDesc = row.itemDesc;
this.chooseModalData.valueTypeDb = row.valueTypeDb; this.chooseModalData.valueTypeDb = row.valueTypeDb;
this.chooseModalData.itemType=row.functionType;
this.chooseModalData.itemType = row.functionType;
searchItemAvailable(this.chooseModalData).then(({data}) => { searchItemAvailable(this.chooseModalData).then(({data}) => {
this.chooseTableData = data.rows this.chooseTableData = data.rows
}) })
@ -1121,14 +1174,14 @@
}, },
//------------------- //-------------------
queryTemplateItem(){
queryTemplateItem() {
getItemLists(this.detailData).then(({data}) => { getItemLists(this.detailData).then(({data}) => {
this.itemList1 = data.row1; this.itemList1 = data.row1;
this.itemList2 = data.row2; this.itemList2 = data.row2;
}) })
}, },
addFastModal(){
addFastModal() {
this.itemSelections1 = null this.itemSelections1 = null
this.itemSelections2 = null this.itemSelections2 = null
getItemLists(this.detailData).then(({data}) => { getItemLists(this.detailData).then(({data}) => {
@ -1138,24 +1191,24 @@
this.fastAddFlag = true; this.fastAddFlag = true;
}, },
// //
itemClickRow1(row){
itemClickRow1(row) {
this.$refs.itemTable1.toggleRowSelection(row); this.$refs.itemTable1.toggleRowSelection(row);
}, },
// //
itemClickRow2(row){
itemClickRow2(row) {
this.$refs.itemTable2.toggleRowSelection(row); this.$refs.itemTable2.toggleRowSelection(row);
}, },
selectFlag(){
selectFlag() {
return true; return true;
}, },
selectionItem1(val){
selectionItem1(val) {
this.itemSelections1 = val this.itemSelections1 = val
}, },
selectionItem2(val){
selectionItem2(val) {
this.itemSelections2 = val this.itemSelections2 = val
}, },
addItem(){
if(this.itemSelections1 == null || this.itemSelections1.length == 0){
addItem() {
if (this.itemSelections1 == null || this.itemSelections1.length == 0) {
this.$alert("请选择可选属性!", '提示', { this.$alert("请选择可选属性!", '提示', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
@ -1186,8 +1239,8 @@
} }
}) })
}, },
deleteItem(){
if(this.itemSelections2 == null || this.itemSelections2.length == 0){
deleteItem() {
if (this.itemSelections2 == null || this.itemSelections2.length == 0) {
this.$alert("请选择已有属性!", '提示', { this.$alert("请选择已有属性!", '提示', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
@ -1195,14 +1248,14 @@
} }
let inData = { let inData = {
site: this.$store.state.user.site, site: this.$store.state.user.site,
codeNo:this.detailData.codeNo,
codeDesc:this.detailData.codeDesc,
functionType:this.detailData.functionType,
codeNo: this.detailData.codeNo,
codeDesc: this.detailData.codeDesc,
functionType: this.detailData.functionType,
// itemNo: this.itemListRow2.itemNo, // itemNo: this.itemListRow2.itemNo,
// itemDesc:this.itemListRow2.itemDesc, // itemDesc:this.itemListRow2.itemDesc,
itemList: this.itemSelections2, itemList: this.itemSelections2,
itemType:this.detailData.itemType,
userId:this.$store.state.user.name
itemType: this.detailData.itemType,
userId: this.$store.state.user.name
} }
deleteModalDetails(inData).then(({data}) => { deleteModalDetails(inData).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
@ -1218,7 +1271,7 @@
} }
}) })
}, },
refreshDetailList(){
refreshDetailList() {
searchModalDetails(this.detailData).then(({data}) => { searchModalDetails(this.detailData).then(({data}) => {
this.detailList = data.rows this.detailList = data.rows
}) })
@ -1244,6 +1297,78 @@
}) })
}, },
BUBtnDialog(row) {
this.modalData = row
searchBUPropertiesList(row).then(({data}) => {
if (data && data.code === 0) {
this.selectionBU = data.row.map(item => item.buNo);
this.BUDialog = true
} else {
this.$message.warning(data.msg)
}
}).catch((error) => {
this.$message.error(error)
})
},
savePropertiesBU() {
// if (this.selectionBU.length === 0) {
// this.$message.warning("BU")
// return
// }
let arr = this.selectionBU.map(item => {
return {
site: this.$store.state.user.site,
buNo: item,
functionType: this.modalData.functionType,
codeNo: this.modalData.codeNo
}
});
if (arr.length === 0){
arr[0] = {
site: this.$store.state.user.site,
functionType: this.modalData.functionType,
codeNo: this.modalData.codeNo
}
}
saveBUPropertiesList(arr).then(({data}) => {
if (data && data.code === 0) {
this.$message.success(data.msg)
this.getDataList()
this.BUDialog = false
} else {
this.$message.warning(data.msg)
} }
}).catch((error) => {
this.$message.error(error)
})
},
} }
}
</script> </script>
<style scoped>
.rq /deep/ .el-transfer-panel {
}
.rq /deep/ .el-transfer-panel .el-transfer-panel__header {
height: 35px;
line-height: 35px;
}
.rq /deep/ .el-transfer-panel .el-transfer-panel__header .el-checkbox {
line-height: 35px;
}
.rq /deep/ .el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label {
color: #fff
}
.rq /deep/ .el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label span {
color: #3c3c3e;
}
.rq /deep/ .el-transfer-panel .el-checkbox__inner::after {
height: 8px;
width: 4px;
}
</style>

5
src/views/modules/common/uploadFileList.vue

@ -27,6 +27,10 @@ export default {
fileList:{ fileList:{
type: Array, type: Array,
default:()=>[], default:()=>[],
},
folder:{
type:String,
default:''
} }
}, },
data(){ data(){
@ -66,6 +70,7 @@ export default {
data.append("orderRef2",this.no) data.append("orderRef2",this.no)
data.append("createBy",this.$store.state.user.name) data.append("createBy",this.$store.state.user.name)
data.append("fileRemark",this.fileRemark) data.append("fileRemark",this.fileRemark)
data.append("folder", this.folder)
uploadFileList(this.path,data).then(({data})=>{ uploadFileList(this.path,data).then(({data})=>{
if (data && data.code === 0){ if (data && data.code === 0){
this.$emit('update:uploadDialog',false) this.$emit('update:uploadDialog',false)

11
src/views/modules/sys/dict-data-select.vue

@ -21,7 +21,10 @@ export default {
props:{ props:{
dictType: { dictType: {
type: String, type: String,
required: true
},
dictTypeList:{
type:Array,
default:()=>[],
}, },
value:{ value:{
required: true, required: true,
@ -62,7 +65,8 @@ export default {
// //
let params = { let params = {
site:this.useSite?this.$store.state.user.site:"*", site:this.useSite?this.$store.state.user.site:"*",
dictType:this.dictType
dictType:this.dictType,
dictTypeList: this.dictTypeList
} }
try { try {
// //
@ -70,6 +74,9 @@ export default {
// //
if (data && data.code === 0){ if (data && data.code === 0){
this.options = data.rows; this.options = data.rows;
if (this.options.length === 0){
this.$emit("change",'')
}
} }
if (this.useDefaultValue){ if (this.useDefaultValue){
this.dictDefaultValue(); this.dictDefaultValue();

2
src/views/modules/test/file/testFile.vue

@ -135,7 +135,7 @@ export default {
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<upload-file-list :label="'测试单号:'" :file-list.sync="fileList" :no="testNo" :upload-dialog.sync="uploadDialog" path="/upload/test"></upload-file-list>
<upload-file-list folder="testFile" :label="'测试单号:'" :file-list.sync="fileList" :no="testNo" :upload-dialog.sync="uploadDialog" path="/upload/test"></upload-file-list>
</div> </div>
</template> </template>

91
src/views/modules/test/requestForTest.vue

@ -262,30 +262,27 @@
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col>
<el-col :span="4">
<el-form-item label=" ">
<el-checkbox v-model="modalData.doesNeedArtwork" true-label="Y">是否需要Artwork</el-checkbox>
<el-col :span="4" :offset="8">
<el-form-item label="设计师">
<span slot="label"><a herf="#" @click="getBaseList(2003)">设计师</a></span>
<el-input v-model="modalData.artworkName"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label=" ">
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label=" ">
<el-checkbox v-model="modalData.doesNeedPlanner" true-label="Y">是否需要计划</el-checkbox>
<el-form-item label="计划员">
<span slot="label"><a herf="#" @click="getBaseList(2004)">计划员</a></span>
<el-input v-model="modalData.plannerName"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="15"> <el-row :gutter="15">
<el-col :span="12">
<el-col :span="12" v-if="false">
<el-form-item style="height: 90px"> <el-form-item style="height: 90px">
<span slot="label" @click="getCustomerAddressList"><a>送样地址</a></span> <span slot="label" @click="getCustomerAddressList"><a>送样地址</a></span>
<el-input type="textarea" v-model="modalData.sendSamplesAddress" :rows="3" resize='none'></el-input> <el-input type="textarea" v-model="modalData.sendSamplesAddress" :rows="3" resize='none'></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-col :span="12" v-if="false">
<el-form-item label="备注" style="height: 90px"> <el-form-item label="备注" style="height: 90px">
<el-input type="textarea" v-model="modalData.remark" :rows="3" resize='none'></el-input> <el-input type="textarea" v-model="modalData.remark" :rows="3" resize='none'></el-input>
</el-form-item> </el-form-item>
@ -299,6 +296,12 @@
</el-form> </el-form>
<div class="rq"> <div class="rq">
<el-tabs v-model="activeTab" @tab-click="dialogTabClick"> <el-tabs v-model="activeTab" @tab-click="dialogTabClick">
<el-tab-pane label="基本信息" :disabled="!activeTabList.includes('attribute')" name="attribute" v-if="modalData.flag !== '1'">
<test-properties v-if="modalFlag" v-model:data-list="testPropertiesList" ref="dialogTestAttribute" :test-no="modalData.testNo"></test-properties>
</el-tab-pane>
<el-tab-pane label="基本信息" :disabled="!activeTabList.includes('attribute')" name="attribute" v-else>
<test-properties v-if="modalFlag" :show-save-button="modalData.flag !== '1'" v-model:data-list="copyTestPropertiesList" ref="dialogTestAttribute" :test-no="modalData.testNo"></test-properties>
</el-tab-pane>
<el-tab-pane label="物料属性" :disabled="!activeTabList.includes('partAttribute')" name="partAttribute"> <el-tab-pane label="物料属性" :disabled="!activeTabList.includes('partAttribute')" name="partAttribute">
<test-attribute v-if="modalFlag" :attribute-list="dialogProperties" ref="dialogAttribute" :test-no="modalData.testNo"></test-attribute> <test-attribute v-if="modalFlag" :attribute-list="dialogProperties" ref="dialogAttribute" :test-no="modalData.testNo"></test-attribute>
</el-tab-pane> </el-tab-pane>
@ -371,9 +374,6 @@
<el-tab-pane label="制程信息" :disabled="!activeTabList.includes('process')" name="process"> <el-tab-pane label="制程信息" :disabled="!activeTabList.includes('process')" name="process">
<test-routing-table v-if="clickTestRow" ref="dialogSoRouting" v-model:data-list="testSoRoutingList" :test-no="modalData.testNo"></test-routing-table> <test-routing-table v-if="clickTestRow" ref="dialogSoRouting" v-model:data-list="testSoRoutingList" :test-no="modalData.testNo"></test-routing-table>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="基本信息" :disabled="!activeTabList.includes('attribute')" name="attribute">
<test-properties v-if="modalFlag" v-model:data-list="testPropertiesList" ref="dialogTestAttribute" :test-no="modalData.testNo"></test-properties>
</el-tab-pane>
<el-tab-pane label="附件" :disabled="!activeTabList.includes('file')" name="file"> <el-tab-pane label="附件" :disabled="!activeTabList.includes('file')" name="file">
<test-file v-if="modalFlag" :column-list="fileColumnList" v-model:data-list="testFileList" ref="dialogTestFile" :test-no="modalData.testNo"></test-file> <test-file v-if="modalFlag" :column-list="fileColumnList" v-model:data-list="testFileList" ref="dialogTestFile" :test-no="modalData.testNo"></test-file>
</el-tab-pane> </el-tab-pane>
@ -696,6 +696,9 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="基本信息" name="attribute">
<test-properties ref="tabProperties" v-model:data-list="testPropertiesList" :test-no="testCurrentRow.testNo" :height="500"></test-properties>
</el-tab-pane>
<el-tab-pane label="物料属性" name="test_attribute" style="padding: 5px"> <el-tab-pane label="物料属性" name="test_attribute" style="padding: 5px">
<test-attribute ref="tabAttribute" :attribute-list="attributeList" :test-no="testCurrentRow.testNo" :height="500"></test-attribute> <test-attribute ref="tabAttribute" :attribute-list="attributeList" :test-no="testCurrentRow.testNo" :height="500"></test-attribute>
</el-tab-pane> </el-tab-pane>
@ -705,9 +708,6 @@
<el-tab-pane label="制程信息" name="test_so_routing" style="padding: 5px"> <el-tab-pane label="制程信息" name="test_so_routing" style="padding: 5px">
<test-routing-table ref="tabSoBom" :test-no="testCurrentRow.testNo" v-model:data-list="testSoRoutingList" :height="500" ></test-routing-table> <test-routing-table ref="tabSoBom" :test-no="testCurrentRow.testNo" v-model:data-list="testSoRoutingList" :height="500" ></test-routing-table>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="基本信息" name="attribute">
<test-properties ref="tabProperties" v-model:data-list="testPropertiesList" :test-no="testCurrentRow.testNo" :height="500"></test-properties>
</el-tab-pane>
<el-tab-pane label="附件" name="file"> <el-tab-pane label="附件" name="file">
<test-file ref="tabFile" :column-list="fileColumnList" v-model:data-list="testFileList" :test-no="testCurrentRow.testNo" :height="500"></test-file> <test-file ref="tabFile" :column-list="fileColumnList" v-model:data-list="testFileList" :test-no="testCurrentRow.testNo" :height="500"></test-file>
</el-tab-pane> </el-tab-pane>
@ -1048,7 +1048,7 @@
</el-dialog> </el-dialog>
<!-- 上传文件的modal --> <!-- 上传文件的modal -->
<testUploadFile ref="testUploadFile" @refreshPageTables="getFileContentData()" v-drag></testUploadFile>
<test-upload-file ref="testUploadFile" @refreshPageTables="getFileContentData()" v-drag></test-upload-file>
</div> </div>
</template> </template>
@ -1079,14 +1079,9 @@
customerContactSearch, // customerContactSearch, //
} from '@/api/customer/customerContact.js' } from '@/api/customer/customerContact.js'
import ChooseList from '@/views/modules/common/Chooselist' import ChooseList from '@/views/modules/common/Chooselist'
import testUploadFile from "./test_upload_file"
import TestUploadFile from "./test_upload_file"
import DictDataSelect from "../sys/dict-data-select.vue"; import DictDataSelect from "../sys/dict-data-select.vue";
import {
selectTestSoBom,
saveTestSoBom,
removeTestSoBom,
updateTestSoBom
} from "../../../api/test/testSoBom";
import {selectTestSoBom,} from "../../../api/test/testSoBom";
import TestTable from "./testSoBom/testTable.vue"; import TestTable from "./testSoBom/testTable.vue";
import TestRoutingTable from "./testSoRouting/testRoutingTable.vue"; import TestRoutingTable from "./testSoRouting/testRoutingTable.vue";
import {selectTestSoRoutingList} from "../../../api/test/testSoRouting"; import {selectTestSoRoutingList} from "../../../api/test/testSoRouting";
@ -1105,7 +1100,7 @@
TestTable, TestTable,
DictDataSelect, DictDataSelect,
ChooseList, ChooseList,
testUploadFile
TestUploadFile
}, },
watch: { watch: {
searchData: { searchData: {
@ -1159,8 +1154,9 @@
testSoRoutingList:[], testSoRoutingList:[],
testSoBomList:[], testSoBomList:[],
testPropertiesList:[], testPropertiesList:[],
activeTab:'partAttribute',
activeTabList:['partAttribute'],
copyTestPropertiesList:[],
activeTab:'attribute',
activeTabList:['attribute'],
clickTestRow:false, clickTestRow:false,
// //
exportData: [], exportData: [],
@ -1197,7 +1193,7 @@
// //
dataListLoading: false, dataListLoading: false,
// //
activeTable: 'test_attribute',
activeTable: 'attribute',
// ======== ======== // ======== ========
modalData: { modalData: {
flag: '1', flag: '1',
@ -1217,7 +1213,11 @@
priorityLevel: '一般', priorityLevel: '一般',
testNumber: 1, testNumber: 1,
doesNeedArtwork:'', doesNeedArtwork:'',
artwork:'',
artworkName:'',
doesNeedPlanner:'', doesNeedPlanner:'',
planner:'',
plannerName:'',
requiredDeliveryDate: '', requiredDeliveryDate: '',
remark: '', remark: '',
technicalConsiderations: '', technicalConsiderations: '',
@ -2327,7 +2327,11 @@
projectName: row.projectName, projectName: row.projectName,
tracker: row.tracker, tracker: row.tracker,
doesNeedArtwork:row.doesNeedArtwork, doesNeedArtwork:row.doesNeedArtwork,
artwork:row.artwork,
artworkName:row.artworkName,
doesNeedPlanner:row.doesNeedPlanner, doesNeedPlanner:row.doesNeedPlanner,
planner: row.planner,
plannerName: row.plannerName,
trackerName: row.trackerName, trackerName: row.trackerName,
testPartNo: row.testPartNo, testPartNo: row.testPartNo,
partName: row.partName, partName: row.partName,
@ -2495,7 +2499,7 @@
if (data && data.code === 0) { if (data && data.code === 0) {
this.getDataList(); this.getDataList();
this.activeTabList = ['product','process','attribute','partAttribute','file'] this.activeTabList = ['product','process','attribute','partAttribute','file']
this.activeTab = 'product'
this.activeTab = 'attribute'
this.modalData.testNo = data.row this.modalData.testNo = data.row
// this.modalFlag = false // this.modalFlag = false
this.$message.success("操作成功") this.$message.success("操作成功")
@ -2930,6 +2934,14 @@
strVal = this.modalData.engineerName strVal = this.modalData.engineerName
conSql = " and b.site = '" + this.$store.state.user.site + "'" conSql = " and b.site = '" + this.$store.state.user.site + "'"
} }
if (val === 2003) {
strVal = this.modalData.artworkName
conSql = " and b.site = '" + this.$store.state.user.site + "'"
}
if (val === 2004) {
strVal = this.modalData.plannerName
conSql = " and b.site = '" + this.$store.state.user.site + "'"
}
this.$refs.baseList.init(val, strVal, conSql) this.$refs.baseList.init(val, strVal, conSql)
}) })
}, },
@ -2975,6 +2987,14 @@
this.modalData.engineer = val.username this.modalData.engineer = val.username
this.modalData.engineerName = val.user_display this.modalData.engineerName = val.user_display
} }
if (this.tagNo === 2003){
this.modalData.artwork = val.username;
this.modalData.artworkName = val.user_display;
}
if (this.tagNo === 2004){
this.modalData.planner = val.username;
this.modalData.plannerName = val.user_display;
}
}, },
// ======== ======== // ======== ========
@ -3017,7 +3037,11 @@
customerDesc: '', customerDesc: '',
projectId: '', projectId: '',
doesNeedArtwork:'', doesNeedArtwork:'',
artwork:'',
artworkName:'',
doesNeedPlanner:'', doesNeedPlanner:'',
planner: '',
plannerName: '',
projectName: '', projectName: '',
tracker: '', tracker: '',
trackerName: '', trackerName: '',
@ -3052,9 +3076,10 @@
updateDate: '', updateDate: '',
updateBy: '' updateBy: ''
} }
this.activeTab = 'partAttribute';
this.activeTabList = ['partAttribute']
this.activeTab = 'attribute';
this.activeTabList = ['attribute']
this.dialogProperties = []; this.dialogProperties = [];
this.copyTestPropertiesList = [];
}, },
checkSelectable(row,index){ checkSelectable(row,index){
if (this.modalData.flag === '1' && this.activeTabList.length === 1){ if (this.modalData.flag === '1' && this.activeTabList.length === 1){

106
src/views/modules/test/testAttribute/testProperties.vue

@ -26,6 +26,10 @@ export default {
type:Number, type:Number,
default:300 default:300
}, },
showSaveButton:{
type:Boolean,
default:true
}
}, },
model:{ model:{
prop:"dataList", prop:"dataList",
@ -34,7 +38,7 @@ export default {
data(){ data(){
return{ return{
loading:false, loading:false,
attributeDialog:false,
attributeDialog:true,
copyAttributeList:[], copyAttributeList:[],
productColumnList: [ productColumnList: [
{ {
@ -131,25 +135,7 @@ export default {
columnProp: 'textValue', columnProp: 'textValue',
headerAlign: "center", headerAlign: "center",
align: "left", align: "left",
columnLabel: '文本值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth:120,
},
{
userId: this.$store.state.user.name,
functionId: 100002001,
serialNumber: '100002001TableMinValue',
tableId: "100002001Table",
tableName: "属性表",
columnProp: 'numValue',
headerAlign: "center",
align: "right",
columnLabel: '数字值',
columnLabel: '实测值',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
@ -158,6 +144,24 @@ export default {
fixed: '', fixed: '',
columnWidth:120, columnWidth:120,
}, },
// {
// userId: this.$store.state.user.name,
// functionId: 100002001,
// serialNumber: '100002001TableMinValue',
// tableId: "100002001Table",
// tableName: "",
// columnProp: 'numValue',
// headerAlign: "center",
// align: "right",
// columnLabel: '',
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: '',
// columnWidth:120,
// },
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 100002001, functionId: 100002001,
@ -179,9 +183,6 @@ export default {
} }
}, },
methods:{ methods:{
openTestProperties(){
this.copyAttributeList = JSON.parse(JSON.stringify(this.dataList))
},
getTestProperties(){ getTestProperties(){
let params = { let params = {
site:this.$store.state.user.site, site:this.$store.state.user.site,
@ -198,35 +199,32 @@ export default {
}) })
}, },
updateTestPropertiesList(){ updateTestPropertiesList(){
this.loading = true
updateTestPropertiesList(this.copyAttributeList).then(({data})=>{ updateTestPropertiesList(this.copyAttributeList).then(({data})=>{
if (data && data.code === 0){ if (data && data.code === 0){
this.$message.success(data.msg); this.$message.success(data.msg);
this.getTestProperties(); this.getTestProperties();
this.attributeDialog = false;
this.attributeDialog = true;
}else { }else {
this.$message.warning(data.msg); this.$message.warning(data.msg);
} }
this.loading = false
}).catch((error)=>{ }).catch((error)=>{
this.$message.error(error) this.$message.error(error)
this.loading = false
}) })
}, },
searchTestPropertiesList(){
let params = {
site:this.$store.state.user.site,
testNo: this.testNo
}
this.loading = true
searchTestPropertiesList(params).then(({data})=>{
if (data && data.code === 0){
this.getTestProperties();
clickSave(){
if (!this.attributeDialog){
this.updateTestPropertiesList();
}else { }else {
this.$message.warning(data.msg)
this.copyAttributeList = JSON.parse(JSON.stringify(this.dataList))
} }
this.loading = false
}).catch((error)=>{
this.loading = false
this.$message.error(error)
})
this.attributeDialog = false;
},
clickSaveBtn(){
//
} }
}, },
} }
@ -235,9 +233,10 @@ export default {
<template> <template>
<div> <div>
<div style="margin-top: 5px"> <div style="margin-top: 5px">
<el-button type="primary" :loading="loading" @click="searchTestPropertiesList">刷新属性</el-button>
<el-button type="primary" @click="attributeDialog = true">编辑</el-button>
<el-button type="primary" @click="clickSaveBtn">新增</el-button>
<el-button type="primary" :loading="loading" v-if="showSaveButton" @click="clickSave">{{ attributeDialog?'编辑':'保存' }}</el-button>
</div> </div>
<div class="rq " v-if="attributeDialog">
<el-table <el-table
:height="height" :height="height"
:data="dataList" :data="dataList"
@ -254,13 +253,18 @@ export default {
:min-width="item.columnWidth" :min-width="item.columnWidth"
:label="item.columnLabel"> :label="item.columnLabel">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span> <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</div>
<div v-else>
{{scope.row.textValue?scope.row.textValue:scope.row.numValue}}
</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-dialog title="测试单属性" :visible.sync="attributeDialog" @open="openTestProperties" append-to-body v-drag>
<div class="rq ">
</div>
<div class="rq " v-else>
<el-table <el-table
:height="height" :height="height"
:data="copyAttributeList" :data="copyAttributeList"
@ -283,19 +287,14 @@ export default {
</div> </div>
<div v-else> <div v-else>
<div v-if="scope.row.valueChooseFlag !== 'Y'"> <div v-if="scope.row.valueChooseFlag !== 'Y'">
<div v-if="item.columnProp !== 'textValue'">
<el-input-number v-model="scope.row.numValue" style="margin-top: -6px;padding: 0;width: 100%" v-if="scope.row.valueType === '数字'" :controls="false"></el-input-number> <el-input-number v-model="scope.row.numValue" style="margin-top: -6px;padding: 0;width: 100%" v-if="scope.row.valueType === '数字'" :controls="false"></el-input-number>
<el-input v-model="scope.row.numValue" :disabled="scope.row.valueType !== '数字'" v-else></el-input>
</div>
<div>
<el-input v-model="scope.row.textValue" :disabled="scope.row.valueType === '数字'" v-if="item.columnProp !== 'numValue'"></el-input>
</div>
<el-input v-model="scope.row.numValue" v-else></el-input>
</div> </div>
<div v-else> <div v-else>
<el-select style="width: 100%;" :disabled="scope.row.valueType !== '文本'" v-if="item.columnProp === 'textValue'" v-model="scope.row.textValue">
<el-select style="width: 100%;" v-if="scope.row.valueType === '文本'" v-model="scope.row.textValue">
<el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.list" :key="key"></el-option> <el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.list" :key="key"></el-option>
</el-select> </el-select>
<el-select style="width: 100%;" :disabled="scope.row.valueType === '文本'" v-else v-model="scope.row.numValue">
<el-select style="width: 100%;" v-else v-model="scope.row.numValue">
<el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.list" :key="key"></el-option> <el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.list" :key="key"></el-option>
</el-select> </el-select>
</div> </div>
@ -304,11 +303,6 @@ export default {
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<el-footer style="height:30px;text-align:center;margin-top: 8px">
<el-button type="primary" @click="updateTestPropertiesList">保存</el-button>
<el-button type="primary" @click="attributeDialog = false">关闭</el-button>
</el-footer>
</el-dialog>
</div> </div>
</template> </template>

Loading…
Cancel
Save