feat:修复bug

dev
kongyeqing 2023-09-14 15:24:34 +08:00
parent f573d9a3ae
commit 453c33e629
7 changed files with 87 additions and 29 deletions

View File

@ -491,6 +491,12 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
return
}
}
if (item && item.key === 'violateNumber') {
this.updateParams.violateNumber = null
setTimeout(()=>{
this.updateParams.violateNumber = +data.toFixed(0)
},0)
}
//
}

View File

@ -183,7 +183,7 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
require: true,
showError: false,
datas: this.areaList,
clearable:true,
clearable: true,
}, {
name: "适用单元",
key: "units",
@ -193,7 +193,7 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
require: true,
showError: false,
datas: this.unitList,
clearable:true,
clearable: true,
}, {
name: "适用对象",
key: "targets",
@ -203,7 +203,7 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
require: true,
showError: false,
datas: this.$store.state.analControlList,
clearable:true,
clearable: true,
}, {
name: "适用部门",
key: "depts",
@ -213,7 +213,7 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
require: true,
showError: false,
datas: this.$store.state.deptList,
clearable:true,
clearable: true,
}, {
name: "适用类型",
key: "types",
@ -223,7 +223,7 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
multiple: true,
showError: false,
datas: this.$store.state.prevention_dangrous_type,
clearable:true,
clearable: true,
}]
this.updateActions = [{
name: "取消",
@ -291,6 +291,12 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
}
//
public loadUnitData(ids?) {
if (!ids || ids.length === 0) {
this.unitList = []
const option = this.updateOptions.find(item => item.key === "units") as any;
option.datas = this.unitList
return
}
this.unitService.getListByIds({ areaIds: ids }, false).then((res: any) => {
this.unitList = res.data.map(item => {
return {
@ -348,19 +354,22 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
}
public change(data, item) {
console.log('item', item);
console.log('data', data);
//
if (item && item.key === "areas") {
if (this.updateParams.units.length) {
this.updateParams.units = [];
}
this.loadUnitData(data)
}
}
public callback(data, type?) {
if (type) {
if (type === 'pageSize' || type === 'pageNum') {
if (type === 'pageSize' || type === 'pageNum') {
this.params[type] = data;
}
this.getTableData();

View File

@ -161,6 +161,10 @@ export default class IntegralCenter extends BaseRecordComponent<any> {
this.getTableData()
}
public change(data, item) {
//
}
public handleClose() {
this.showUpdate = false;
}

View File

@ -49,7 +49,7 @@
<el-dialog :close-on-click-modal="false" :title="isReadonly ?'详情':updateParams.id ?'编辑': '新增'"
:visible.sync="showUpdate" width="952px" :before-close="handleClose" destroy-on-close>
<FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
:isReadonly="isReadonly" @actionCallback="subCallback" :actions="updateActions" :full-btn="true"
:isReadonly="isReadonly" @actionCallback="subCallback" :actions="updateActions" :full-btn="true" @change="change"
btnPosition="center">
</FormComponent>
</el-dialog>

View File

@ -171,6 +171,10 @@ export default class IntegralEvent extends BaseRecordComponent<any> {
pageNum: 1,
pageSize: 20,
} as any;
this.getTableData()
}
public change(data, item) {
//
}
public handleClose() {

View File

@ -105,6 +105,7 @@ export default class IntegralMall extends BaseRecordComponent<any> {
key: "number",
require: true,
width: "calc(50% - 20px)",
showError:false,
},
{
name: " 商品名称",
@ -112,6 +113,7 @@ export default class IntegralMall extends BaseRecordComponent<any> {
key: "name",
require: true,
width: "calc(50% - 20px)",
showError:false,
},
{
name: "库存数量",
@ -119,10 +121,11 @@ export default class IntegralMall extends BaseRecordComponent<any> {
key: "stockNumber",
require: true,
width: "calc(50% - 20px)",
// rules: [
// { pattern: /^1[3|5|7|8|9]\d{9}$/, message: '', }
// ],
max: 99999,
showError:false,
rules: [
{ pattern: /^\d{1,5}$/, message: '在1~99999范围内', }
],
// max: 99999,
min: 1
},
{
@ -162,10 +165,10 @@ export default class IntegralMall extends BaseRecordComponent<any> {
},
{
name: "商品照片",
key: "resourceId",
key: "photo",
ref: "photo",
type: "upload",
width: "calc(50% - 20px)",
width: "100%",
require: true,
onSucess: this.onSuccess,
onMove: this.onRemove,
@ -252,6 +255,8 @@ export default class IntegralMall extends BaseRecordComponent<any> {
this.isReadonly = false;
this.photoList = [] as any;
this.buildUpdateForm()
//
this.clearFileListMethod()
this.showUpdate = true
}
}
@ -269,10 +274,13 @@ export default class IntegralMall extends BaseRecordComponent<any> {
pageNum: 1,
pageSize: 20,
} as any;
this.getTableData()
}
public handleClose() {
this.showUpdate = false;
//
this.clearFileListMethod()
}
@ -301,7 +309,9 @@ export default class IntegralMall extends BaseRecordComponent<any> {
public subCallback(data) {
if (data.value === "cancel") {
this.showUpdate = false
this.showUpdate = false;
//
this.clearFileListMethod()
} else if (data && data.value.indexOf("save") >= 0) {
this.doSave(data.value !== "save")
}
@ -309,20 +319,21 @@ export default class IntegralMall extends BaseRecordComponent<any> {
public onSuccess(res, file, fileList) {
if (res.code === 200) {
this.photoList = []
this.photoList = [{
name: res.data.originalName,
url: res.data.url,
type: res.data.type,
id: res.data.id
}]
this.updateParams.resourceId = this.photoList.length || null;
this.updateParams.photo = this.photoList.length || null;
this.buildUpdateForm()
}
}
public onRemove(file, fileList) {
this.photoList.splice(this.photoList.findIndex(item => item.id === file.id), 1)
this.updateParams.resourceId = this.photoList.length || null;
this.updateParams.photo = this.photoList.length || null;
}
public onPreview(file) {
@ -343,6 +354,7 @@ export default class IntegralMall extends BaseRecordComponent<any> {
let resourceName = this.photoList.map((item) => {
return item.name
})
this.updateParams.resourceId = resourceId.join(",")
this.updateParams.resourceName = resourceName.join(",")
} else {
@ -359,14 +371,11 @@ export default class IntegralMall extends BaseRecordComponent<any> {
})
}
public showModal(row, isReadonly) {
if (isReadonly) {
this.isReadonly = true
} else {
this.isReadonly = false
}
public change(data, item) {
//
}
public showModal(row, isReadonly = false) {
this.isReadonly = isReadonly
this.tableService.getListDetail({ id: row.id }).then((res: any) => {
if (res.code === 200) {
this.updateParams = Object.assign({
@ -382,7 +391,7 @@ export default class IntegralMall extends BaseRecordComponent<any> {
id: item.id
}
})
this.updateParams.resourceId = ''
this.updateParams.photo = isReadonly ? null : this.photoList.length
this.buildUpdateForm()
})
}
@ -399,6 +408,15 @@ export default class IntegralMall extends BaseRecordComponent<any> {
this.currentUrl = data
this.showFile = true;
}
/**
* 清除附件数据
*/
public clearFileListMethod() {
this.photoList = [];
const option = this.updateOptions.find(item => item.key === "photo") as any;
option.fileList = [];
}
}
</script>
<style lang="scss" scoped src="../common.component.scss"></style>

View File

@ -79,8 +79,8 @@ export default class IntegralRule extends BaseRecordComponent<any> {
}];
public formOptions: FormOption<BtnOption>[] = [{
name: "规则名称",
key: "controlName",
name: "规则编号",
key: "number",
type: "text",
}];
@ -104,12 +104,14 @@ export default class IntegralRule extends BaseRecordComponent<any> {
require: true,
width: "calc(50% - 20px)",
disable: true,
showError: false,
},
{
name: "规则类型",
type: "select",
key: "type",
format: "typeName",
showError: false,
require: true,
width: "calc(50% - 20px)",
datas: this.$store.state.prevention_integral_type
@ -120,6 +122,7 @@ export default class IntegralRule extends BaseRecordComponent<any> {
key: "description",
require: true,
width: "100%",
showError: false,
},
{
name: "事件",
@ -135,9 +138,10 @@ export default class IntegralRule extends BaseRecordComponent<any> {
name: "分值",
type: "number",
key: "point",
require: true,
require: !(this.updateParams.type === 3),
width: "calc(50% - 20px)",
showError: false,
disable: (this.updateParams.type === 3)
},
{
name: "状态",
@ -209,7 +213,7 @@ export default class IntegralRule extends BaseRecordComponent<any> {
public callback(data, type) {
if (type) {
if (type === 'pageSize' || type === 'pageNum') {
if (type === 'pageSize' || type === 'pageNum') {
this.params[type] = data;
}
this.getTableData();
@ -265,6 +269,7 @@ export default class IntegralRule extends BaseRecordComponent<any> {
pageNum: 1,
pageSize: 20,
} as any;
this.getTableData()
}
public handleClose() {
@ -291,6 +296,18 @@ export default class IntegralRule extends BaseRecordComponent<any> {
}
}
public change(data, item) {
if (item && item.key === 'type') {
const option = this.updateOptions.find(item => item.key === "point") as any;
option.disable = data === 3 ? true : false;
option.require = data === 3 ? false : true;
if (data === 3) {
this.updateParams.point = null;
option.showError = false
}
}
}
public handleSelectionChange(data) {
this.selectData = data;
}