|
|
@@ -28,6 +28,7 @@
|
|
|
<Icon type="ios-camera" size="32"/>
|
|
|
</div>
|
|
|
<input
|
|
|
+ accept=".jpg, .jpeg, .png"
|
|
|
id="upload"
|
|
|
type="file"
|
|
|
@change="uploadError"
|
|
|
@@ -47,7 +48,7 @@
|
|
|
|
|
|
<!--画布-->
|
|
|
<DkPanel prop="productGraph">
|
|
|
- <DkRow slot="content" style=" height: 400px;overflow: auto">
|
|
|
+ <DkRow slot="content" style=" height: 500px;overflow: auto">
|
|
|
<Layout>
|
|
|
<!-- 左侧工具栏 -->
|
|
|
<Sider :width="180">
|
|
|
@@ -84,6 +85,7 @@
|
|
|
:operateFlag="false"
|
|
|
:newRowFlag="false"
|
|
|
:freeze="false"
|
|
|
+ @chooseData="chooseData"
|
|
|
:columns="imageColumn" :height="200" @addRow="addGraphRow" @delRow="delGraphRow"
|
|
|
></EditTable>
|
|
|
</DkPanel>
|
|
|
@@ -120,6 +122,7 @@
|
|
|
viewName: null,
|
|
|
remarks: null,
|
|
|
fileList: [],
|
|
|
+ ftyId:self.$store.state.user.ftyId
|
|
|
},
|
|
|
//图片总单
|
|
|
picFormData: {
|
|
|
@@ -133,26 +136,25 @@
|
|
|
imageUrl: null,//当前图片地址
|
|
|
imageColumn: [
|
|
|
// {field: 'imageName', type: 'text', width: 150},//图片名称
|
|
|
- { field: 'displayNo', type: 'number', width: 100 },//显示顺序
|
|
|
+ { field: 'displayNo', type: 'number', width: 'auto' },//显示顺序
|
|
|
// {field: 'imageRemarks', type: 'text', width: 200},//图片备注
|
|
|
{
|
|
|
- field: 'placeName',
|
|
|
- width: 200,
|
|
|
- type: 'tableSelect',
|
|
|
- param: () => {
|
|
|
- return {}
|
|
|
- },
|
|
|
- sortBoolean: false,
|
|
|
- dataType: self.$config.tableSelectType.productPlace,
|
|
|
- fieldUpdate: self.$updateColumns.productPlaceChooseMould,
|
|
|
- searchDetailFlag: false,
|
|
|
+ field: 'placeId',
|
|
|
+ title: self.$t('placeCode'),
|
|
|
+ width:'auto',
|
|
|
+ type: 'select',
|
|
|
+ options: () => self.placeList,
|
|
|
+ labelKey: 'placeCode',
|
|
|
+ valueKey: 'placeId',
|
|
|
},//产品位置
|
|
|
+ { field: 'placeName', type: 'disabled', width:'auto'},//位置名称
|
|
|
{ field: 'remarks', type: 'text', width: 'auto' },//位置备注
|
|
|
],
|
|
|
imageColumnList: [],
|
|
|
nowPicIndex: 0,//当前图片下标
|
|
|
nowImage: null,// 当前图片
|
|
|
graphNodeList: [],//画布节点
|
|
|
+ placeList:[],//位置集合
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -257,6 +259,7 @@
|
|
|
// console.log('34343',this.imageList)
|
|
|
// 图片列表有数据
|
|
|
//文件集合赋值 图片名称,显示顺序,备注, 产品位置集合
|
|
|
+ console.log('this.picFormData',this.picFormData)
|
|
|
if (this.picFormData.imageName) {
|
|
|
this.$set(this.fileList[this.nowPicIndex], 'imageName', this.picFormData.imageName)
|
|
|
}
|
|
|
@@ -302,11 +305,11 @@
|
|
|
this.getNodeClick(val)
|
|
|
})
|
|
|
this.graph.fromJSON(this.fileList[index].placeRange)
|
|
|
- this.picFormData = {
|
|
|
- imageName: this.fileList[index].imageName,
|
|
|
- displayNo: this.fileList[index].displayNo,
|
|
|
- remarks: this.fileList[index].remarks,
|
|
|
- }
|
|
|
+ }
|
|
|
+ this.picFormData = {
|
|
|
+ imageName: this.fileList[index].imageName,
|
|
|
+ displayNo: this.fileList[index].displayNo,
|
|
|
+ remarks: this.fileList[index].remarks,
|
|
|
}
|
|
|
this.nowPicIndex = index
|
|
|
if (!this.fileList[index].imageId) {
|
|
|
@@ -334,6 +337,7 @@
|
|
|
)
|
|
|
//清除画布
|
|
|
this.graph.removeCells(this.graphNodeList)
|
|
|
+ this.graph.clearCells()
|
|
|
} else {
|
|
|
// 如果删除的不是当前行,要处理图形
|
|
|
if (this.graph.toJSON()?.cells.length > 0 && this.fileList[this.nowPicIndex]) {//如果切换的产品图片有图形的话
|
|
|
@@ -369,6 +373,7 @@
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
+ document.getElementById('upload').value=null
|
|
|
},
|
|
|
/**
|
|
|
* @desc : 图片转换base64
|
|
|
@@ -411,6 +416,20 @@
|
|
|
|
|
|
|
|
|
},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 选择改变
|
|
|
+ * @date : 2023/3/3 16:30
|
|
|
+ * @author : 寇珊珊
|
|
|
+ */
|
|
|
+ chooseData (row, rowIndex, colItem) {
|
|
|
+ if(colItem.field == 'placeId'){
|
|
|
+ let list = this.placeList.filter(it=>it.placeId ==row.placeId )
|
|
|
+ if(list.length>0){
|
|
|
+ this.$set(this.imageColumnList[rowIndex],'placeName',list[0].placeName)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
/**
|
|
|
* @desc : 添加图片列表行
|
|
|
* @date : 2023/2/8 16:30
|
|
|
@@ -423,7 +442,7 @@
|
|
|
// this.$set(this.imageColumnList[rowIndex], 'placeRangeId', value.id)
|
|
|
if (rowIndex || rowIndex === 0) {
|
|
|
this.$set(this.imageColumnList[rowIndex], 'displayNo', rowIndex + 1)
|
|
|
- this.$set(this.imageColumnList[rowIndex], 'placeName', null)
|
|
|
+ this.$set(this.imageColumnList[rowIndex], 'placeCode', null)
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
|
@@ -465,7 +484,7 @@
|
|
|
//校验图片列表中位置名称重复
|
|
|
for (let it of this.fileList) {
|
|
|
if (it.productViewPlaceVOList) {
|
|
|
- noList = noList.concat(it.productViewPlaceVOList.copy().filter(f => f.placeName).map(m => m.placeName))
|
|
|
+ noList = noList.concat(it.productViewPlaceVOList.copy().filter(f => f.placeCode).map(m => m.placeCode))
|
|
|
}
|
|
|
if (noList.length != noList.unique().length) {
|
|
|
this.$Message.error(this.$t('W_102'))
|
|
|
@@ -484,14 +503,14 @@
|
|
|
for (let item of this.fileList) {
|
|
|
for (let index = 0; index < item.productViewPlaceVOList.length; index++) {
|
|
|
let it = item.productViewPlaceVOList[index]
|
|
|
- if (it.placeName == null) {
|
|
|
+ if (it.placeCode == null) {
|
|
|
let rows = 1 + parseInt(index)
|
|
|
this.$message.error(this.$t('W_089', {
|
|
|
'param1': rows + this.$t('rowNo'),
|
|
|
- 'param2': this.$t('placeName')
|
|
|
+ 'param2': this.$t('placeCode')
|
|
|
}))
|
|
|
this.setErrToRow(it, this.$t('W_093', {
|
|
|
- 'param': this.$t('placeName')
|
|
|
+ 'param': this.$t('placeCode')
|
|
|
}))// 给行增加错误提示信息
|
|
|
return false
|
|
|
}
|
|
|
@@ -669,7 +688,23 @@
|
|
|
// }
|
|
|
// })
|
|
|
},
|
|
|
+ getPlace(){
|
|
|
+ let params = {
|
|
|
+ ftyId: this.formData.ftyId,
|
|
|
+ }
|
|
|
+ this.excute(this.$service.commonService, this.$service.commonService.getProductPlace, params).then(res => {
|
|
|
+ if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
+ this.placeList = res.data
|
|
|
+ } else {
|
|
|
+ this.$Message.error(res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ //获取位置
|
|
|
+ this.getPlace()
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
@@ -686,6 +721,9 @@
|
|
|
border-right: 1px solid #dfe3e8;
|
|
|
}
|
|
|
|
|
|
+ /deep/ .dk-collapse-content{
|
|
|
+ padding: 3px 0 50px 16px;
|
|
|
+ }
|
|
|
#graph-container {
|
|
|
width: calc(100% - 180px);
|
|
|
height: 100%;
|