|
@@ -26,6 +26,7 @@ import { required, mobileRequired, mobile, httpUrl, email } from '@/components/t
|
|
|
import { getClassifyList } from '@/api/goods'
|
|
|
import { getDataDictionary } from '@/api/dataDictionary.js'
|
|
|
import operation_mixin from '@/components/template/operation_mixin.js'
|
|
|
+import { getWebsit } from "@/api/customerManagement.js"
|
|
|
export default {
|
|
|
props: {
|
|
|
storageType: {
|
|
@@ -57,7 +58,8 @@ export default {
|
|
|
"status": true,
|
|
|
"type": "",
|
|
|
"usedType": "",
|
|
|
- pgIncreItems: []
|
|
|
+ pgIncreItems: [],
|
|
|
+ pgIncreWebsits: []
|
|
|
},
|
|
|
formDialog: false,
|
|
|
isEditIndex: -1,
|
|
@@ -65,6 +67,8 @@ export default {
|
|
|
classifyList: [],
|
|
|
classifyListLv2: [],
|
|
|
clickLook: true,
|
|
|
+ websitList: [],
|
|
|
+ websitIndex: -1
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -454,6 +458,109 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
+ md: 24,
|
|
|
+ name: 'slot-component',
|
|
|
+ formItemAttributes: {
|
|
|
+ label: '服务网点',
|
|
|
+ prop: 'pgIncreWebsits',
|
|
|
+ rules: [...required]
|
|
|
+ },
|
|
|
+ render: (h, { props, onInput }) => {
|
|
|
+ var { value } = props
|
|
|
+ return (
|
|
|
+ <div>
|
|
|
+ <div style="margin-bottom:8px">
|
|
|
+ <el-button onClick={() => {
|
|
|
+ this.formData.pgIncreWebsits.push({
|
|
|
+ websitId: "",
|
|
|
+ linkName: "",
|
|
|
+ websitPhone: "",
|
|
|
+ address: "",
|
|
|
+ });
|
|
|
+ this.websitIndex = this.formData.pgIncreWebsits.length - 1
|
|
|
+ }}>添加</el-button>
|
|
|
+ </div>
|
|
|
+ <zj-table
|
|
|
+ columns={[{
|
|
|
+ columnAttributes: {
|
|
|
+ label: '网点名称',
|
|
|
+ prop: 'websitId'
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return <div>
|
|
|
+ <el-form-item label="" label-width="0px" prop={`pgIncreWebsits.${index}.${column.columnAttributes.prop}`} rules={required}>
|
|
|
+ <el-select
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
+ onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
+ disabled={!(this.websitIndex == index)}
|
|
|
+ onChange={(val) => {
|
|
|
+ if (val) {
|
|
|
+ var data = this.websitList.find(item => item.value == val)
|
|
|
+ row.linkName = data.data.linkName
|
|
|
+ row.websitPhone = data.data.websitPhone
|
|
|
+ row.address = data.data.address
|
|
|
+ } else {
|
|
|
+ row.linkName = ""
|
|
|
+ row.websitPhone = ""
|
|
|
+ row.address = ""
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ placeholder="请选择">
|
|
|
+ {this.websitList.filter(item => (row.websitId == item.value || !this.formData.pgIncreWebsits.find(val => (val.websitId == item.value)))).map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '联系人',
|
|
|
+ prop: 'linkName'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '联系电话',
|
|
|
+ prop: 'websitPhone'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '地址',
|
|
|
+ prop: 'address'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '操作',
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return <div style="padding-left:10px">
|
|
|
+ {this.websitIndex == index ? <el-button type="text" onClick={() => {
|
|
|
+ this.websitIndex = -1
|
|
|
+ }}>确定</el-button> : null}
|
|
|
+ {this.websitIndex != index ? <el-button type="text" onClick={() => {
|
|
|
+ this.websitIndex = index
|
|
|
+ }}>编辑</el-button> : null}
|
|
|
+ <el-button type="text" onClick={() => {
|
|
|
+ if (this.websitIndex == index) {
|
|
|
+ this.websitIndex = -1
|
|
|
+ }
|
|
|
+ this.formData.pgIncreWebsits.splice(index, 1)
|
|
|
+ }}>删除</el-button>
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ }]}
|
|
|
+ tableData={this.formData.pgIncreWebsits}
|
|
|
+ tableAttributes={{
|
|
|
+ size: 'mini',
|
|
|
+ border: true,
|
|
|
+ }} />
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
name: 'el-input',
|
|
|
md: 24,
|
|
|
attributes: { disabled: false, placeholder: '请输入', type: "textarea" },
|
|
@@ -510,7 +617,9 @@ export default {
|
|
|
},
|
|
|
getDetail(id) {
|
|
|
increConfigDetail({ id }).then(res => {
|
|
|
- Object.assign(this.formData, res.data)
|
|
|
+ Object.assign(this.formData, res.data, {
|
|
|
+ pgIncreWebsits: res.data.pgIncreWebsits || []
|
|
|
+ })
|
|
|
this.openForm()
|
|
|
})
|
|
|
},
|
|
@@ -543,8 +652,9 @@ export default {
|
|
|
openForm() {
|
|
|
Promise.all([
|
|
|
getDataDictionary({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "ON" }, { "param": "a.dict_type", "compare": "=", "value": "BRAND" }] }),
|
|
|
- getClassifyList({ type: 2, status: true })
|
|
|
- ]).then(([res1, res2]) => {
|
|
|
+ getClassifyList({ type: 2, status: true }),
|
|
|
+ getWebsit({ isIncre: true })
|
|
|
+ ]).then(([res1, res2, res3]) => {
|
|
|
// 获取品牌
|
|
|
this.orderBrands = res1.data.records.map(item => ({
|
|
|
value: item.dictCode,
|
|
@@ -560,6 +670,13 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
this.classifyListLv2 = classifyListLv2
|
|
|
+
|
|
|
+ this.websitList = res3.data.map(item => ({
|
|
|
+ label: item.name,
|
|
|
+ value: item.websitId,
|
|
|
+ data: item
|
|
|
+ }))
|
|
|
+
|
|
|
var { companyWechatId, companyName } = JSON.parse(localStorage.getItem('greemall_user'))
|
|
|
this.formData.companyWechatId = companyWechatId
|
|
|
this.formData.companyWechatName = companyName
|