Commit 4e25ebe4 by wusiyi

fix: 操作费相关页面修改

parent 5b7d99c8
......@@ -57,3 +57,10 @@ export function getOperationFeeSelect(name) {
params: { name }
})
}
// 获取仓库列表
export function listErpWarehouse(namespace) {
return axios.get('/sys/domain/listErpWarehouse', {
params: { namespace }
})
}
......@@ -16,6 +16,10 @@ export default {
type: Boolean,
default: true
},
size: {
type: String,
default: 'mini'
},
formLabelWidth: {
type: String,
default: 'auto'
......@@ -107,7 +111,7 @@ export default {
props={{
model: this.formData
}}
size="mini"
size={this.size || 'mini'}
inline
onSubmit={this.handleSubmit}
onKeyupenterCapture={this.search}
......
......@@ -270,7 +270,7 @@
:title="editId ? '编辑' : '新增'"
:visible.sync="addVisible"
:close-on-click-modal="false"
width="700px">
width="1000px">
<el-form
:model="editForm"
size="small"
......@@ -283,7 +283,7 @@
prop="domain"
:rules="[{ required: true, message: '请输入域名' }]">
<el-input
style="width: 200px"
style="width: 350px"
v-model.trim="editForm.domain"
size="small"
:disabled="!!editId"
......@@ -299,7 +299,7 @@
prop="companyName"
:rules="[{ required: true, message: '请输入公司名称' }]">
<el-input
style="width: 200px"
style="width: 350px"
v-model="editForm.companyName"
size="small"
placeholder="请输入公司名称" />
......@@ -309,7 +309,7 @@
prop="packages"
:rules="[{ required: true, message: '请选择套餐' }]">
<el-select
style="width: 200px"
style="width: 350px"
v-model="editForm.packages"
size="small"
@change="changeCharges"
......@@ -326,7 +326,7 @@
prop="headName"
:rules="[{ required: true, message: '请输入负责人' }]">
<el-input
style="width: 200px"
style="width: 350px"
v-model="editForm.headName"
size="small"
placeholder="负责人" />
......@@ -343,7 +343,7 @@
}
]">
<el-input
style="width: 200px"
style="width: 350px"
v-model="editForm.contactPhone"
size="small"
placeholder="请输入联系电话" />
......@@ -354,7 +354,7 @@
:rules="[{ required: true, message: '请输入资费' }]">
<el-input
disabled
style="width: 200px"
style="width: 350px"
v-model="editForm.charges"
size="small"
placeholder="请输入资费" />
......@@ -364,7 +364,7 @@
prop="expireTime"
:rules="[{ required: true, message: '请选择过期时间' }]">
<el-date-picker
style="width: 200px"
style="width: 350px"
v-model="editForm.expireTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
......@@ -385,7 +385,7 @@
{ required: true, message: '请选择操作费', trigger: 'blur' }
]">
<el-select
style="width: 200px"
style="width: 350px"
v-model="editForm.operationFeeId"
size="small"
@change="changeCharges"
......@@ -398,6 +398,29 @@
:label="item.name"></el-option>
</el-select>
</el-form-item>
<el-form-item
v-if="editForm.operated === true"
label="扣费仓库"
prop="operationFeeWarehouseIds">
<div>
<el-select
style="width: 350px"
v-model="editForm.operationFeeWarehouseIds"
size="small"
multiple
placeholder="请选择扣费仓库"
filterable>
<el-option
v-for="item in warehouseList"
:key="item.id"
:value="item.id"
:label="item.name"></el-option>
</el-select>
<div style="color: #f56c6c; font-size: 12px; margin-top: 0px">
如果不选,则视为对所有仓库都进行扣费
</div>
</div>
</el-form-item>
</el-form>
<span slot="footer">
<el-button @click="addVisible = false" size="small">取消</el-button>
......@@ -464,6 +487,7 @@
import {
getManageData,
getStatusSelect,
listErpWarehouse,
addManageData,
updateManageData,
getDataById,
......@@ -578,7 +602,8 @@ export default {
remark: ''
},
currentRow: {},
operationList: []
operationList: [],
warehouseList: []
}
},
async created() {
......@@ -609,6 +634,10 @@ export default {
const { data } = await getStatusSelect()
this.statusList = data
},
async getWarehouseList(namespace) {
const { data } = await listErpWarehouse(namespace)
this.warehouseList = data
},
async getOperationFee() {
const { data } = await getOperationFeeSelect()
this.operationList = data
......@@ -620,6 +649,15 @@ export default {
this.$set(this.editForm, 'charges', charges.oName)
}
},
changeWarehouse(v) {
console.log(v)
// if (!v) return
// const charges = this.warehouseList.find((item) => item.id === v)
// if (charges) {
// this.$set(this.editForm, 'operationFeeWarehouseIds', charges.name)
// }
},
onChange(e) {
this.$set(this.editForm, 'apiName', e)
this.$set(this.editForm, 'databaseName', e)
......@@ -652,6 +690,7 @@ export default {
this.editId = undefined
this.editForm = JSON.parse(JSON.stringify(this.cloneEditForm))
this.baseDomain = '.jomalls.com'
this.warehouseList = []
this.$nextTick(() => {
this.$refs.form.clearValidate()
})
......@@ -714,11 +753,16 @@ export default {
},
async handleEdit(row) {
this.editId = row.id
this.warehouseList = []
const l = this.$loading({
background: 'rgba(0, 0, 0, 0.3)'
})
try {
await this.getStatusList()
await Promise.all([
this.getStatusList(),
this.getWarehouseList(row.apiName)
])
const res = await getDataById(row.id)
const parts = /^(.*)(\.(([^.]+)\.([^.]+)))$/.exec(res.data.domain)
if (parts) {
......@@ -727,7 +771,14 @@ export default {
res.data.domain = name
this.baseDomain = tld
}
this.editForm = res.data
if (this.editForm.operationFeeWarehouseIds) {
this.editForm.operationFeeWarehouseIds =
this.editForm.operationFeeWarehouseIds
.split(',')
.map((id) => Number(id))
}
} catch (e) {
this.$message.error(e)
} finally {
......@@ -748,6 +799,11 @@ export default {
if (!this.editId) {
databaseName = 'saas_' + this.editForm.databaseName
}
if (this.editForm.operationFeeWarehouseIds) {
this.editForm.operationFeeWarehouseIds =
this.editForm.operationFeeWarehouseIds.join(',')
}
const domain = this.editForm.domain + this.baseDomain
try {
if (this.editId) {
......
......@@ -31,14 +31,16 @@
:title="is_title == 1 ? '新增' : '编辑'"
:visible.sync="dialogVisible"
@closed="closedFn"
width="590px">
width="800px">
<CustomForm
class="editForm"
formItemWidth="50%"
ref="formRefs"
v-model="formData"
:formConfig="editformConfig"
:isCustomButton="false"
formLabelWidth="100px"></CustomForm>
size="small"
formLabelWidth="120px"></CustomForm>
<span slot="footer" class="dialog-footer">
<el-button
@click="dialogVisible = false"
......@@ -95,14 +97,12 @@ export default {
{
prop: 'name',
type: 'input',
name: '名称',
options: []
name: '名称'
},
{
prop: 'type',
name: '费用类型',
type: 'select',
labelWidth: '20',
options: [
{ label: '固定', value: 1 },
{ label: '浮动', value: 2 }
......@@ -114,7 +114,6 @@ export default {
prop: 'name',
type: 'input',
name: '名称',
options: [],
renderRules: (item) => [
{
required: true,
......@@ -143,7 +142,7 @@ export default {
{
prop: 'fixedFee',
type: 'inputNumber',
name: '固定费用',
name: '固定费用(¥)',
step: 0.01,
min: 0,
precision: 2,
......@@ -182,7 +181,7 @@ export default {
{
prop: 'startFee',
type: 'inputNumber',
name: '起收费用',
name: '起收费用(¥)',
step: 0.01,
min: 0,
precision: 2,
......@@ -198,7 +197,7 @@ export default {
{
prop: 'incrementalFee',
type: 'inputNumber',
name: '每件加收',
name: '每件加收(¥)',
step: 0.01,
min: 0,
precision: 2,
......@@ -214,7 +213,7 @@ export default {
{
prop: 'endFee',
type: 'inputNumber',
name: '上限费用 ',
name: '上限费用(¥)',
step: 0.01,
min: 0,
precision: 2,
......@@ -273,7 +272,7 @@ export default {
)
},
{
label: '固定费用',
label: '固定费用(¥)',
key: 'fixedFee',
width: '150'
},
......@@ -292,17 +291,17 @@ export default {
)
},
{
label: '起收费用',
label: '起收费用(¥)',
key: 'startFee',
width: '150'
},
{
label: '每件加收',
label: '每件加收(¥)',
key: 'incrementalFee',
width: '150'
},
{
label: '上限费用',
label: '上限费用(¥)',
key: 'endFee',
width: '150'
},
......@@ -532,7 +531,7 @@ export default {
}
}
</script>
<style scoped>
<style scoped lang="scss">
.wraper {
display: flex;
flex-direction: column;
......@@ -542,4 +541,10 @@ export default {
.table_wrap {
flex: 1;
}
.editForm {
::v-deep .el-input--suffix .el-input__inner {
width: 235px;
}
}
</style>
......@@ -59,7 +59,7 @@ export default {
{
prop: 'timeRange',
type: 'dateRange',
name: '时间范围'
name: '称重时间'
},
{
prop: 'namespace',
......@@ -95,7 +95,7 @@ export default {
key: 'orderNum'
},
{
label: '扣费金额',
label: '扣费金额(¥)',
key: 'fee'
},
{
......@@ -104,7 +104,7 @@ export default {
},
{
label: '扣费时间',
label: '称重时间',
key: 'createTime'
}
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment