|
|
@@ -54,6 +54,70 @@
|
|
|
<uni-datetime-picker :disabled="!isDisable" type="date" slot="value" v-model="form.expectedTime">
|
|
|
</uni-datetime-picker>
|
|
|
</u-cell>
|
|
|
+ <u-cell title="售后类型" arrow-direction="down">
|
|
|
+ <uni-data-picker :readonly="!isDisable" v-model="form.afterSalesType" slot="value" placeholder="请选择"
|
|
|
+ :localdata="after_sales_type">
|
|
|
+ </uni-data-picker>
|
|
|
+ </u-cell>
|
|
|
+ <u-cell title="是否收费" arrow-direction="down">
|
|
|
+ <uni-data-picker v-if="isDisable" v-model="form.isFee" slot="value" placeholder="请选择"
|
|
|
+ :localdata="chargeList">
|
|
|
+ </uni-data-picker>
|
|
|
+ <u--input v-else slot="value" style="flex:1" placeholder="请输入" disabled border="surround"
|
|
|
+ :value="form.isFee==1?'是':'否'">
|
|
|
+
|
|
|
+ </u--input>
|
|
|
+
|
|
|
+ </u-cell>
|
|
|
+ <u-cell title="是否带配件" arrow-direction="down">
|
|
|
+ <uni-data-picker v-if="isDisable" v-model="form.isWithAccessories" slot="value" placeholder="请选择"
|
|
|
+ :localdata="chargeList">
|
|
|
+ </uni-data-picker>
|
|
|
+ <u--input v-else slot="value" style="flex:1" placeholder="请输入" disabled border="surround"
|
|
|
+ :value="form.isWithAccessories==1?'是':'否'">
|
|
|
+
|
|
|
+ </u--input>
|
|
|
+ </u-cell>
|
|
|
+ <u-cell title="是否派车" arrow-direction="down">
|
|
|
+ <uni-data-picker v-if="isDisable" v-model="form.isPieCar" slot="value" placeholder="请选择"
|
|
|
+ :localdata="chargeList">
|
|
|
+ </uni-data-picker>
|
|
|
+ <u--input v-else slot="value" style="flex:1" placeholder="请输入" disabled border="surround"
|
|
|
+ :value="form.isPieCar==1?'是':'否'">
|
|
|
+
|
|
|
+ </u--input>
|
|
|
+ </u-cell>
|
|
|
+ <u-cell title="派车类型" arrow-direction="down" v-if="form.isPieCar==1">
|
|
|
+ <uni-data-picker v-if="isDisable" v-model="form.pieCarType" slot="value" placeholder="请选择"
|
|
|
+ :localdata="pie_car_type">
|
|
|
+ </uni-data-picker>
|
|
|
+ <u--input v-else slot="value" style="flex:1" placeholder="请输入" disabled border="surround"
|
|
|
+ :value="form.pieCarType==1?'是':'否'">
|
|
|
+
|
|
|
+ </u--input>
|
|
|
+ </u-cell>
|
|
|
+ <u-cell title="是否外包" arrow-direction="down">
|
|
|
+ <uni-data-picker v-if="isDisable" v-model="form.isOutsource" slot="value" placeholder="请选择"
|
|
|
+ :localdata="chargeList">
|
|
|
+ </uni-data-picker>
|
|
|
+ <u--input v-else slot="value" style="flex:1" placeholder="请输入" disabled border="surround"
|
|
|
+ :value="form.isOutsource==1?'是':'否'">
|
|
|
+
|
|
|
+ </u--input>
|
|
|
+ </u-cell>
|
|
|
+ <u-cell title="是否生成采购订单" arrow-direction="down">
|
|
|
+ <uni-data-picker v-if="isDisable" v-model="form.isCreatePurchaseOrder" slot="value"
|
|
|
+ placeholder="请选择" :localdata="chargeList">
|
|
|
+ </uni-data-picker>
|
|
|
+ <u--input v-else slot="value" style="flex:1" placeholder="请输入" disabled border="surround"
|
|
|
+ :value="form.isCreatePurchaseOrder==1?'是':'否'">
|
|
|
+
|
|
|
+ </u--input>
|
|
|
+ </u-cell>
|
|
|
+ <u-cell title="涉及事业部门" arrow-direction="down">
|
|
|
+ <u--input slot="value" :disabled="!isDisable" placeholder="请选择" border="surround" v-model="form.involveDeptName"
|
|
|
+ @click.native="salesDeptShow"></u--input>
|
|
|
+ </u-cell>
|
|
|
<u-cell title="报修人" arrow-direction="down">
|
|
|
<view slot="value" style="display: flex;align-items: center;width: 100%;">
|
|
|
<u--input style="flex:1" placeholder="请输入" disabled border="surround" v-model="createUserName">
|
|
|
@@ -61,7 +125,8 @@
|
|
|
</view>
|
|
|
</u-cell>
|
|
|
</u-cell-group>
|
|
|
- <AfterSales ref="salesRef" :type="type" v-show="current == 1" :itemList="form.productDetail" />
|
|
|
+ <AfterSales ref="salesRef" :type="type" v-show="current == 1" :afterSalesType="form.afterSalesType"
|
|
|
+ :itemList="form.productDetail" />
|
|
|
<!-- 联系人 -->
|
|
|
<ContactList ref="contactRef" :type="type" v-show="current == 2" :itemList="form.contactInfoVOS" />
|
|
|
<view class="footerButton" v-if="isDisable">
|
|
|
@@ -69,6 +134,8 @@
|
|
|
<u-button type="primary" @click="save" text="保存"></u-button>
|
|
|
</view>
|
|
|
<u-toast ref="uToast"></u-toast>
|
|
|
+ <ba-tree-picker ref="treePicker" :multiple="false" @select-change="confirm" :localdata="listData" valueKey="id"
|
|
|
+ textKey="name" childrenKey="children" />
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -86,6 +153,10 @@
|
|
|
} from '@/api/salesServiceManagement/demandList/index.js'
|
|
|
import AfterSales from './components/AfterSales.vue'
|
|
|
import ContactList from './components/contactList.vue'
|
|
|
+ import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
|
|
|
+ import {
|
|
|
+ listOrganizations,
|
|
|
+ } from '@/api/myTicket/index.js'
|
|
|
export default {
|
|
|
components: {
|
|
|
AfterSales,
|
|
|
@@ -98,7 +169,7 @@
|
|
|
},
|
|
|
orderCodeName() {
|
|
|
let name = this.associationTypeList.find(item => item.value === this.form.associationType)?.text || ''
|
|
|
- if(name === '客户') {
|
|
|
+ if (name === '客户') {
|
|
|
return '产品'
|
|
|
}
|
|
|
return name
|
|
|
@@ -107,19 +178,28 @@
|
|
|
data() {
|
|
|
return {
|
|
|
form: {
|
|
|
- code: '',
|
|
|
- name: '',
|
|
|
- contactName: '',
|
|
|
- expectedTime: '',
|
|
|
- faultLevel: '',
|
|
|
- contactAddress: '',
|
|
|
- orderCode: '',
|
|
|
- productDetail: [],
|
|
|
+ tableList: [],
|
|
|
contactInfoVOS: [],
|
|
|
- contactCode: '',
|
|
|
+ faultDetailList: [],
|
|
|
+ associationType: '1',
|
|
|
+ aftertype: '',
|
|
|
+ salespersonName: '',
|
|
|
+ salespersonId: '',
|
|
|
+ isWithAccessories: 0,
|
|
|
+ isFee: 0,
|
|
|
+ isPieCar: 0,
|
|
|
+ pieCarType: '',
|
|
|
+ isOutsource: 0,
|
|
|
+ isCreatePurchaseOrder: 0,
|
|
|
+ supplierName: '',
|
|
|
+ supplierId: '',
|
|
|
+ supplierCode: '',
|
|
|
+ involveDeptId: '',
|
|
|
+ involveDeptName: '',
|
|
|
+ remark: '',
|
|
|
+ processInstanceId: '' // 新增流程实例ID字段
|
|
|
},
|
|
|
- associationTypeList: [
|
|
|
- {
|
|
|
+ associationTypeList: [{
|
|
|
value: '1',
|
|
|
text: '发货单'
|
|
|
},
|
|
|
@@ -136,8 +216,38 @@
|
|
|
list: ['基本信息', '售后对象', '联系人'],
|
|
|
current: 0,
|
|
|
fault_level: [],
|
|
|
+ after_sales_type: [],
|
|
|
+ chargeList: [{
|
|
|
+ text: '是',
|
|
|
+ value: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '否',
|
|
|
+ value: 0
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ partList: [{
|
|
|
+ text: '是',
|
|
|
+ value: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '否',
|
|
|
+ value: 0
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ carList: [{
|
|
|
+ text: '是',
|
|
|
+ value: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '否',
|
|
|
+ value: 0
|
|
|
+ }
|
|
|
+ ],
|
|
|
title: '新增需求',
|
|
|
- type: 'add'
|
|
|
+ type: 'add',
|
|
|
+ listData: [],
|
|
|
+ pie_car_type: []
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -178,7 +288,9 @@
|
|
|
);
|
|
|
this.$set(this.form, 'productDetail', list);
|
|
|
})
|
|
|
-
|
|
|
+ listOrganizations(1).then(data => {
|
|
|
+ this.listData = data
|
|
|
+ })
|
|
|
uni.$off('setProduceList')
|
|
|
uni.$on('setProduceList', (data) => {
|
|
|
console.log('data', data)
|
|
|
@@ -216,6 +328,10 @@
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ //选择部门
|
|
|
+ salesDeptShow() {
|
|
|
+ this.$refs.treePicker._show()
|
|
|
+ },
|
|
|
// 查询详情
|
|
|
async getDetails(id) {
|
|
|
this.getByCode();
|
|
|
@@ -224,12 +340,22 @@
|
|
|
let data = JSON.parse(JSON.stringify(res));
|
|
|
console.log('data111', data.orderCode)
|
|
|
this.form = data;
|
|
|
- // this.$set(this.form, 'orderCode', data.orderCode);
|
|
|
+ ['afterSalesType'].forEach(key => {
|
|
|
+ this.$set(
|
|
|
+ this.form,
|
|
|
+ key,
|
|
|
+ res[key].toString()
|
|
|
+ );
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
this.createUserName = data.createUserName;
|
|
|
+ console.log(this.form, 'this.form')
|
|
|
let obj = this.fault_level.find(el => el.value == res.faultLevel)
|
|
|
let associationTypeObj = this.associationTypeList.find(el => el.value == res.associationType)
|
|
|
this.form.associationType = associationTypeObj.value;
|
|
|
- if(res.faultLevel) {
|
|
|
+ if (res.faultLevel) {
|
|
|
this.sourceCodeOnchange({
|
|
|
"detail": {
|
|
|
"value": [obj]
|
|
|
@@ -298,7 +424,7 @@
|
|
|
return;
|
|
|
}
|
|
|
console.log(this.form.associationType)
|
|
|
- if(this.form.associationType === '3') {
|
|
|
+ if (this.form.associationType === '3') {
|
|
|
// uni.navigateTo({
|
|
|
// url: '/pages/salesServiceManagement/demandList/components/product?contactId=' + this.form
|
|
|
// .contactId + '&associationType=' + this.form.associationType
|
|
|
@@ -312,18 +438,26 @@
|
|
|
.contactId + '&associationType=' + this.form.associationType
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
- async getByCode() {
|
|
|
- const codeValue = await getByCode('fault_level');
|
|
|
- let list = codeValue.map(item => {
|
|
|
- const key = Object.keys(item)[0]
|
|
|
- return {
|
|
|
- value: key,
|
|
|
- text: item[key]
|
|
|
- }
|
|
|
+ //部门回调
|
|
|
+ confirm(data, name) {
|
|
|
+ this.form.involveDeptName = name || ''
|
|
|
+ this.form.involveDeptId = data[0] || ''
|
|
|
+ },
|
|
|
+ getByCode() {
|
|
|
+ const codeS = ['fault_level', 'after_sales_type', 'pie_car_type']
|
|
|
+ codeS.forEach(async (code) => {
|
|
|
+ const codeValue = await getByCode(code);
|
|
|
+ this[code] = codeValue.map(item => {
|
|
|
+ const key = Object.keys(item)[0]
|
|
|
+ return {
|
|
|
+ value: key,
|
|
|
+ text: item[key]
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
- this.fault_level = list;
|
|
|
+
|
|
|
},
|
|
|
save() {
|
|
|
let data = JSON.parse(JSON.stringify(this.form));
|
|
|
@@ -365,6 +499,14 @@
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
+ if (!data.afterSalesType) {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: "warning",
|
|
|
+ message: "请选择售后类型",
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
// 联系人数据
|
|
|
let contactInfoVOS = this.$refs.contactRef.getTabData();
|
|
|
if (contactInfoVOS.length == 0) {
|
|
|
@@ -424,6 +566,7 @@
|
|
|
position: fixed;
|
|
|
bottom: 0;
|
|
|
z-index: 10;
|
|
|
+ background: #fff;
|
|
|
|
|
|
/deep/.u-button {
|
|
|
height: 100%;
|