|
@@ -14,33 +14,32 @@
|
|
|
>
|
|
>
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
|
- <el-form-item prop="idPaperType" label="纸张类型">
|
|
|
|
|
- <el-select v-model="formData.idPaperType" filterable placeholder="请选择"
|
|
|
|
|
- :disabled="formData.id!=''">
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in typeOptions"
|
|
|
|
|
- :key="item.id"
|
|
|
|
|
- :label="item.paperTypeName"
|
|
|
|
|
- :value="item.id">
|
|
|
|
|
- </el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
+ <el-form-item prop="platformName" label="平台名称">
|
|
|
|
|
+ <el-input v-model="formData.platformName"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
|
- <el-form-item prop="priceType" label="计价方式">
|
|
|
|
|
- <el-select v-model="formData.priceType" filterable placeholder="请选择">
|
|
|
|
|
|
|
+ <el-form-item label="平台类别">
|
|
|
|
|
+ <el-select v-model="formData.platformType" filterable placeholder="请选择" style="width: 320px">
|
|
|
<el-option
|
|
<el-option
|
|
|
- v-for="item in priceOptions"
|
|
|
|
|
- :key="item.value"
|
|
|
|
|
- :label="item.label"
|
|
|
|
|
- :value="item.value">
|
|
|
|
|
|
|
+ v-for="item in optionsList"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ :label="item.tagName"
|
|
|
|
|
+ :value="item.value">
|
|
|
</el-option>
|
|
</el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
|
- <el-form-item prop="mtSuttle" label="克重">
|
|
|
|
|
- <el-input :disabled="formData.id!=''" v-model="formData.mtSuttle"/>
|
|
|
|
|
|
|
+ <el-form-item prop="requireList" label="平台接入需求">
|
|
|
|
|
+ <el-select v-model="formData.requireId" placeholder="请选择" style="width: 320px">
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="type in typeOptions"
|
|
|
|
|
+ :key="type.id"
|
|
|
|
|
+ :label="type.requireName"
|
|
|
|
|
+ :value="type.id">
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
@@ -57,47 +56,50 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
-import {addPaperBaseInfo, getPaperBaseInfo, updatePaperBaseInfo,getPaperTypeList} from "@/api/baseInfo";
|
|
|
|
|
|
|
+import {getPlatformInfo,addPlatformInfo,updatePlatformInfo,queryPlatformRequireList} from "@/api/baseInfo";
|
|
|
import type {FormInstance} from 'element-plus'
|
|
import type {FormInstance} from 'element-plus'
|
|
|
-const typeOptions = ref <any> ()
|
|
|
|
|
|
|
+
|
|
|
let dialogVisible = ref(false)
|
|
let dialogVisible = ref(false)
|
|
|
let dialogTitle = ref("")
|
|
let dialogTitle = ref("")
|
|
|
const formRef = ref<FormInstance>()
|
|
const formRef = ref<FormInstance>()
|
|
|
const emit = defineEmits(['dialogChange'])
|
|
const emit = defineEmits(['dialogChange'])
|
|
|
const formData = reactive({
|
|
const formData = reactive({
|
|
|
- paperName: '',
|
|
|
|
|
- idPaperType: '',
|
|
|
|
|
- paperTypeName: '',
|
|
|
|
|
- priceType: 0,
|
|
|
|
|
- paperPrice: '',
|
|
|
|
|
- mtSuttle: '',
|
|
|
|
|
|
|
+ platformName: '',
|
|
|
|
|
+ platformType: '',//平台类别 0订单平台/1配送平台,
|
|
|
|
|
+ requireList:null,
|
|
|
|
|
+ requireId:"",
|
|
|
id: ""
|
|
id: ""
|
|
|
})
|
|
})
|
|
|
-const priceOptions = [
|
|
|
|
|
- {
|
|
|
|
|
- label: '吨价',
|
|
|
|
|
- value: 0
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '平方单价',
|
|
|
|
|
- value: 1
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
const rules = reactive({
|
|
const rules = reactive({
|
|
|
- paperName: [{required: true, message: "请输入基础纸张名称", trigger: "blur"}],
|
|
|
|
|
|
|
+ platformName: [{required: true, message: "请输入平台名称", trigger: "blur"}],
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+const typeOptions = ref<any>()
|
|
|
|
|
+const optionsList = [
|
|
|
|
|
+ {
|
|
|
|
|
+ id: 1,
|
|
|
|
|
+ tagName: '订单平台',
|
|
|
|
|
+ value: 0
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ id: 2,
|
|
|
|
|
+ tagName: '配送平台',
|
|
|
|
|
+ value: 1
|
|
|
|
|
+ }
|
|
|
|
|
+]
|
|
|
function handleSubmit() {
|
|
function handleSubmit() {
|
|
|
formRef.value.validate((valid: any) => {
|
|
formRef.value.validate((valid: any) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
|
|
+ console.log(formData.requireId);
|
|
|
|
|
+ formData.requireList =typeOptions.value.find(x=> x.id === formData.requireId)
|
|
|
|
|
+ console.log(formData.requireList);
|
|
|
const itemId = formData.id;
|
|
const itemId = formData.id;
|
|
|
if (itemId) {
|
|
if (itemId) {
|
|
|
//修改
|
|
//修改
|
|
|
const postData = JSON.stringify(formData)
|
|
const postData = JSON.stringify(formData)
|
|
|
const params = {
|
|
const params = {
|
|
|
- "info": postData,
|
|
|
|
|
|
|
+ "platformInfo": postData,
|
|
|
}
|
|
}
|
|
|
- updatePaperBaseInfo(params).then((response) => {
|
|
|
|
|
|
|
+ updatePlatformInfo(params).then((response) => {
|
|
|
dialogVisible.value = false
|
|
dialogVisible.value = false
|
|
|
if (response.httpCode == 200) {
|
|
if (response.httpCode == 200) {
|
|
|
emit('dialogChange');
|
|
emit('dialogChange');
|
|
@@ -108,9 +110,9 @@ function handleSubmit() {
|
|
|
//增加
|
|
//增加
|
|
|
const postData = JSON.stringify(formData)
|
|
const postData = JSON.stringify(formData)
|
|
|
const params = {
|
|
const params = {
|
|
|
- "info": postData,
|
|
|
|
|
|
|
+ "platformInfo": postData,
|
|
|
}
|
|
}
|
|
|
- addPaperBaseInfo(params).then((response) => {
|
|
|
|
|
|
|
+ addPlatformInfo(params).then((response) => {
|
|
|
dialogVisible.value = false
|
|
dialogVisible.value = false
|
|
|
if (response.httpCode == 200) {
|
|
if (response.httpCode == 200) {
|
|
|
emit('dialogChange');
|
|
emit('dialogChange');
|
|
@@ -121,40 +123,37 @@ function handleSubmit() {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
-function getPaperTypeInfo() {
|
|
|
|
|
- const page = {
|
|
|
|
|
- pageIndex: 1,
|
|
|
|
|
- pageSize: 10000
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
+function getItemData(item) {
|
|
|
const data = {
|
|
const data = {
|
|
|
- 'params': JSON.stringify({
|
|
|
|
|
- 'voidFlag': 0
|
|
|
|
|
- }),
|
|
|
|
|
- 'page': JSON.stringify(page)
|
|
|
|
|
|
|
+ idPlatform: item
|
|
|
}
|
|
}
|
|
|
- getPaperTypeList(data).then((response) => {
|
|
|
|
|
|
|
+ getPlatformInfo(data).then(response => {
|
|
|
if (response.httpCode == 200) {
|
|
if (response.httpCode == 200) {
|
|
|
- const { data } = response
|
|
|
|
|
- typeOptions.value = data
|
|
|
|
|
|
|
+ const data = response.data
|
|
|
|
|
+ Object.assign(formData, {...data});
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
-onMounted(() => {
|
|
|
|
|
- getPaperTypeInfo()
|
|
|
|
|
-})
|
|
|
|
|
-function getItemData(item) {
|
|
|
|
|
|
|
+
|
|
|
|
|
+function getRequireList() {
|
|
|
|
|
+ const page = {
|
|
|
|
|
+ pageIndex: 1,
|
|
|
|
|
+ pageSize: 100,
|
|
|
|
|
+ };
|
|
|
const data = {
|
|
const data = {
|
|
|
- id: item
|
|
|
|
|
|
|
+ 'params': JSON.stringify({
|
|
|
|
|
+ 'voidFlag': 0
|
|
|
|
|
+ }),
|
|
|
|
|
+ "page": JSON.stringify(page)
|
|
|
}
|
|
}
|
|
|
- getPaperBaseInfo(data).then(response => {
|
|
|
|
|
|
|
+ queryPlatformRequireList(data).then((response) => {
|
|
|
if (response.httpCode == 200) {
|
|
if (response.httpCode == 200) {
|
|
|
- const data = response.data
|
|
|
|
|
- Object.assign(formData, {...data});
|
|
|
|
|
|
|
+ const {data} = response
|
|
|
|
|
+ typeOptions.value = data
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
/** 重置表单 */
|
|
/** 重置表单 */
|
|
|
function resetForm() {
|
|
function resetForm() {
|
|
|
formRef.value.resetFields();
|
|
formRef.value.resetFields();
|
|
@@ -167,7 +166,9 @@ function closeDialog() {
|
|
|
formRef.value.resetFields();
|
|
formRef.value.resetFields();
|
|
|
formData.id = undefined;
|
|
formData.id = undefined;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+onMounted(() => {
|
|
|
|
|
+ getRequireList()
|
|
|
|
|
+})
|
|
|
defineExpose({
|
|
defineExpose({
|
|
|
dialogVisible,
|
|
dialogVisible,
|
|
|
dialogTitle,
|
|
dialogTitle,
|