Browse Source

修改客户信息

dev-warehouse
caoyizhong 2 years ago
parent
commit
eb05df91e1
  1. 7
      src/api/basicdata/basicStoreContact.js
  2. 132
      src/option/basicdata/basicClientFrom.js
  3. 5
      src/option/basicdata/basicStoreContact.js
  4. 20
      src/views/basicdata/brand/basicClient.vue
  5. 31
      src/views/basicdata/brand/basicClientFrom.vue
  6. 90
      src/views/basicdata/brand/basicStoreContact.vue
  7. 2
      src/views/distribution/delivery/distributionDelivery.vue

7
src/api/basicdata/basicStoreContact.js

@ -22,6 +22,13 @@ export const getListStore = (current, size, params) => {
}
})
}
export const updateCargoControl = (row) => {
return request({
url: '/api/logpm-basicdata/basicdataStoreContact/update',
method: 'post',
data: row
})
}
export const getDetail = (id) => {
return request({

132
src/option/basicdata/basicClientFrom.js

@ -0,0 +1,132 @@
export default {
expand: false,
index: true,
border: true,
selection: true,
column: [
{
label: "租户号",
prop: "tenantId",
display: false,
hide: true,
},
{
label: "创建人",
prop: "createUser",
display: true,
hide: true,
},
{
label: "创建时间",
prop: "createTime",
display: false,
hide: true,
},
{
label: "更新人",
prop: "updateUser",
display: false,
hide: true,
},
{
label: "更新时间",
prop: "updateTime",
display: false,
hide: true,
},
{
label: "状态",
prop: "status",
display: false,
hide: true,
},
{
label: "是否已删除",
prop: "isDeleted",
display: false,
hide: true,
},
{
label: "创建部门",
prop: "createDept",
display: false,
hide: true,
},
{
label: "主键",
prop: "id",
display: false,
hide: true,
},
{
label: "预留1",
prop: "reserve1",
display: false,
hide: true,
},
{
label: "预留2",
prop: "reserve2",
display: false,
hide: true,
},
{
label: "预留3",
prop: "reserve3",
display: false,
hide: true,
},
{
label: "预留4",
prop: "reserve4",
display: false,
hide: true,
},
{
label: "预留5",
prop: "reserve5",
display: false,
hide: true,
},
{
label: "客户名称",
prop: "clientName",
search: true,
},
{
label: "客户类型",
prop: "clientType",
search: true,
hide: true,
},
{
label: "客户类型",
prop: "typeService",
search: true,
},
{
label: "地址",
prop: "bladeRegionProvinceId",
search: true,
},
{
label: "合同附件",
prop: "fileName",
},
{
label: "控货",
prop: "cargoControl",
hide: true,
},
{
label: "合同开始时间",
prop: "contractStartTime",
search: true,
},
{
label: "合同结束时间",
prop: "contractEntTime",
search: true,
},
]
}

5
src/option/basicdata/basicStoreContact.js

@ -98,6 +98,11 @@ export default {
prop: "phone",
search: true,
},
{
label: "默认联系人",
prop: "defaultType",
search: true,
},
{
label: "创建时间",
prop: "createTime",

20
src/views/basicdata/brand/basicClient.vue

@ -108,6 +108,8 @@
<span target="_blank" v-if="row.clientType == '2'">商场</span>
<span target="_blank" v-if="row.clientType == '3'">装饰</span>
<span target="_blank" v-if="row.clientType == '4'">个人</span>
<span target="_blank" v-if="row.clientType == '5'">待调整</span>
<span target="_blank" v-if="row.clientType == '6'">待调整</span>
<!-- <span target="_blank" v-else>收货方</span>-->
</template>
<!-- <el-link href="https://element.eleme.io" target="_blank" v-if="item.prop === 'fileName'">{{scope}}</el-link>-->
@ -150,6 +152,9 @@
<el-dropdown-item>
<el-button type="primary" text icon="el-icon-setting" @click="handleLinkman(row)">联系人</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-button type="primary" text icon="el-icon-setting" @click="handleBrand(row)">品牌</el-button>
</el-dropdown-item>
<!-- <el-dropdown-item v-if="!!row.clientType">-->
<!-- <el-button type="primary" text icon="el-icon-setting" @click="handleBase(row)" v-if=" row.clientType == '1'">基地</el-button>-->
<!-- <el-button type="primary" text icon="el-icon-setting" @click="handleStore(row)" v-if=" row.clientType == '2'">门店</el-button>-->
@ -361,7 +366,7 @@
</template>
<script>
import { getList, getDetail, add, update, updateCargoControl } from '@/api/basicdata/basicClient';
import { getList, getDetail, add, update, updateCargoControl,remove } from '@/api/basicdata/basicClient';
import option from '@/option/basicdata/basicClient';
import { mapGetters } from 'vuex';
import BasicShopSub from '@/views/basicdata/brand/basicShopSub.vue';
@ -461,7 +466,7 @@ export default {
rules: {
clientName: [
{ required: true, message: '请输入客户名称', trigger: 'blur' },
{ min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
// { min: 3, max: 5, message: ' 3 5 ', trigger: 'blur' }
],
typeService: [
{ required: true, message: '请选择客户端类型', trigger: 'change' }
@ -851,6 +856,16 @@ export default {
this.basicClientId = row.id;
this.drawer = true;
},
handleBrand(row) { //
this.$router.push({
path:'/basicdata/brand/basicdataStoreBrand',
query:{
id: row.id,
name: "品牌 - "+row.clientName
}
});
},
//
handleHistory(row) {
// this.basicClientId = row.id;
@ -889,7 +904,6 @@ export default {
query: {
id: row.id,
name: '联系人 - ' + row.clientName,
type: 2
}
});
},

31
src/views/basicdata/brand/basicClientFrom.vue

@ -137,6 +137,9 @@
<el-dropdown-item>
<el-button type="primary" text icon="el-icon-setting" @click="handleLinkman(row)">联系人</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-button type="primary" text icon="el-icon-setting" @click="handleBrand(row)">品牌</el-button>
</el-dropdown-item>
<!-- <el-dropdown-item v-if="!!row.clientType">-->
<!-- <el-button type="primary" text icon="el-icon-setting" @click="handleBase(row)" v-if=" row.clientType == '1'">基地</el-button>-->
<!-- <el-button type="primary" text icon="el-icon-setting" @click="handleStore(row)" v-if=" row.clientType == '2'">门店</el-button>-->
@ -349,13 +352,12 @@
<script>
import { getList, getDetail, add, update, updateCargoControl } from '@/api/basicdata/basicClient';
import option from '@/option/basicdata/basicClient';
import option from '@/option/basicdata/basicClientFrom';
import { mapGetters } from 'vuex';
import BasicShopSub from '@/views/basicdata/brand/basicShopSub.vue';
import { getDictionaryBiz } from '@/api/system/dict';
import { getSelect, getLazyTree, getLazyList, getLazyTreeAll } from '@/api/base/region';
import { getToken } from '@/utils/auth';
import globalc from '@/api/basicdata/globalc';
import { Base64 } from 'js-base64';
@ -480,6 +482,16 @@ export default {
},
created() {
},
watch: {
'$route.query.id': {
handler(newVal, oldVal) {
console.log(newVal, oldVal);
this.onLoad(this.page);
},
deep: true,
immediate: true
}
},
mounted() {
this.init();
@ -622,7 +634,7 @@ export default {
},
async init() {
//
getDictionaryBiz('client_type_add').then(res => {
getDictionaryBiz('client_type').then(res => {
// console.log("",res);
this.clientType = res.data.data;
});
@ -752,7 +764,7 @@ export default {
},
handleAddSon(row) {
this.$router.push({
path: '/basicdata/brand/basicClient',
path: '/basicdata/brand/basicClientFrom',
query: {
id: row.id,
name: '新增 - ' + row.clientName
@ -839,6 +851,15 @@ export default {
this.basicClientId = row.id;
this.drawer = true;
},
handleBrand(row) { //
this.$router.push({
path:'/basicdata/brand/basicdataStoreBrand',
query:{
id: row.id,
name: "品牌 - "+row.clientName
}
});
},
//
handleHistory(row) {
// this.basicClientId = row.id;
@ -954,7 +975,7 @@ export default {
},
selectionClear() {
this.selectionList = [];
this.$refs.table.clearSelection();
// this.$refs.table.clearSelection();
},
currentChange(currentPage) {
this.page.currentPage = currentPage;

90
src/views/basicdata/brand/basicStoreContact.vue

@ -53,6 +53,15 @@
:label="item.label"
:width="item.width"
:key="index">
<template #default="{row,$index}" v-if="item.prop === 'defaultType'">
<el-switch
v-model="row.defaultType"
active-text="开"
inactive-text="关"
@click="makeCargo(row)"
>
</el-switch>
</template>
</el-table-column>
</template>
<!-- 操作栏模块 -->
@ -111,16 +120,16 @@
</template>
<script>
import { getList, getDetail, add, update, remove } from "@/api/basicdata/basicStoreContact";
import { getList, getDetail, add, update, remove,updateCargoControl } from "@/api/basicdata/basicStoreContact";
import option from "@/option/basicdata/basicStoreContact";
import { mapGetters } from "vuex";
export default {
props: {
mainId: {
type: String
},
},
// props: {
// mainId: {
// type: String
// },
// },
data () {
return {
height: 0,
@ -176,17 +185,72 @@ export default {
}
},
watch:{
mainId: {
// mainId: {
// handler(newVal, oldVal) {
// // console.log("");
// this.onLoad(this.page);
// }
// },
'$route.query.id': {
handler(newVal, oldVal) {
// console.log("");
// console.log(newVal, oldVal);
this.onLoad(this.page);
},
deep: true,
immediate: true
}
}
},
methods: {
init () {
this.height = this.setPx(document.body.clientHeight - 340);
},
//
makeCargo(row) {
console.log('设置默认联系人!!', row);
let r = {
id: row.id,
shopId: row.shopId,
defaultType: row.defaultType
};
console.log("this.page.total",this.page.total);
if(this.page.total < 2){
this.$message.warning("只有一个联系人,暂不支持关闭");
row.defaultType = true;
return
}
this.$confirm(`确定要修改默认联系人吗?`, {
type: 'warning',
//beforeClose
beforeClose: async (action, instance, done) => {
//
if (action === 'confirm') {
//
updateCargoControl(r).then(res => {
console.log(res);
if (res.statusText == 'OK') {
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!'
});
done();
} else {
this.$message({
type: 'warning',
message: '操作失败!'
});
}
});
} else {
//false
//done
done();
}
}
});
},
searchHide () {
this.search = !this.search;
@ -297,7 +361,7 @@ export default {
},
selectionClear () {
this.selectionList = [];
this.$refs.table.clearSelection();
// this.$refs.table.clearSelection();
},
currentChange (currentPage) {
this.page.currentPage = currentPage;
@ -310,8 +374,8 @@ export default {
onLoad (page, params = {}) {
this.loading = true;
this.query.shopId = this.$route.query.id; //ID
this.query.partitionType = this.$route.query.type; //ID
console.log('this.$route.query.id',this.$route.query.id);
// this.query.partitionType = this.$route.query.type; //ID
// console.log('this.$route.query.id',this.$route.query.id);
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data;
this.page.total = data.total;

2
src/views/distribution/delivery/distributionDelivery.vue

@ -144,7 +144,7 @@
</template>
<script>
import { addDelivery, getDetailDelivery, addDelivery, updateDelivery, removeDelivery } from "@/api/distribution/distributionDelivery";
import { getDetailDelivery, addDelivery, updateDelivery, removeDelivery } from "@/api/distribution/distributionDelivery";
import option from "@/option/distribution/distributionDelivery";
import { mapGetters } from "vuex";

Loading…
Cancel
Save