|
@@ -82,32 +82,20 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</template>
|
|
|
- <el-col :span="6" v-if="id">
|
|
|
- <el-form-item label="单据金额">
|
|
|
- <el-input type="text" :value="formData.totalAmount" disabled></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6" v-if="id">
|
|
|
- <el-form-item label="制单人">
|
|
|
- <el-input type="text" :value="formData.createBy" disabled></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6" v-if="id">
|
|
|
- <el-form-item label="制单时间">
|
|
|
- <el-input type="text" :value="formData.createTime" disabled></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6" v-if="id">
|
|
|
- <el-form-item label="审核人">
|
|
|
- <el-input type="text" :value="formData.confirmBy" disabled></el-input>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="销售类型" :required="true" style="padding-bottom: 1px;">
|
|
|
+ <el-radio-group v-model="formData.salesType" @change="changeSale">
|
|
|
+ <el-radio :disabled="formData.flag != 'SAVE' && formType!=0" label="零售">零售</el-radio>
|
|
|
+ <el-radio :disabled="formData.flag != 'SAVE' && formType!=0" label="工程">工程</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6" v-if="id">
|
|
|
- <el-form-item label="审核时间">
|
|
|
- <el-input type="text" :value="formData.confirmTime" disabled></el-input>
|
|
|
+ <el-form-item label="单据金额">
|
|
|
+ <el-input type="text" :value="formData.totalAmount" disabled></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
+ <el-col :span="8">
|
|
|
<el-form-item label="订单来源" prop="source" :required="true">
|
|
|
<el-select v-model="formData.source" :disabled="true" placeholder="请选择" style="width: 100%;">
|
|
|
<el-option
|
|
@@ -119,17 +107,122 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="9">
|
|
|
+ <el-col :span="6">
|
|
|
<el-form-item label="支付方式" prop="payType" :required="true">
|
|
|
<el-radio-group v-model="formData.payType">
|
|
|
<el-radio :disabled="formType == 2" label="CASH">现金</el-radio>
|
|
|
<el-radio :disabled="formType == 2" label="WECHAT">微信</el-radio>
|
|
|
+ <el-radio v-if="formData.salesType == '工程'" :disabled="formData.flag != 'SAVE' && formType!=0" label="ENGIN">工程支付</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="3" v-if="formData.flag == 'SUBMIT' && formData.payType == 'WECHAT'">
|
|
|
+ <el-col :span="2" v-if="formData.flag == 'SUBMIT' && formData.payType == 'WECHAT'">
|
|
|
<div style="height: 32px;display: flex;align-items: center;cursor: pointer;" @click="wxPay()">微信支付<i class="el-icon-full-screen"></i></div>
|
|
|
</el-col>
|
|
|
+ <el-col :span="2" v-else>
|
|
|
+ <div style="opacity: 0;">隐藏</div>
|
|
|
+ </el-col>
|
|
|
+ <template v-if="formData.salesType == '工程'">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="工程名称" prop="project" :required="true">
|
|
|
+ <el-select v-model="formData.project" value-key="id" @change="(e)=>{
|
|
|
+ formData.orderEnginBaseId = e.id
|
|
|
+ }" :disabled="formData.flag != 'SAVE' && formType!=0" placeholder="请选择" style="width: 100%;">
|
|
|
+ <el-option
|
|
|
+ v-for="(item,index) in projectList"
|
|
|
+ :key="index"
|
|
|
+ :label="item.projectName"
|
|
|
+ :value="item">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="工程编号" :required="true">
|
|
|
+ <el-input type="text" :disabled="true" v-model="formData.project.projectNo" placeholder="请输入"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="负责人" :required="true">
|
|
|
+ <el-input type="text" :disabled="true" v-model="formData.project.projectNo" placeholder="请输入"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="联系电话" :required="true">
|
|
|
+ <el-input type="text" :disabled="true" v-model="formData.project.projectNo" placeholder="请输入"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="项目时间" :required="true">
|
|
|
+ <el-date-picker
|
|
|
+ style="width:50%"
|
|
|
+ v-model="formData.project.startTime"
|
|
|
+ type="date"
|
|
|
+ :disabled="true"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="开始日期">
|
|
|
+ </el-date-picker>
|
|
|
+ <el-date-picker
|
|
|
+ style="width:50%"
|
|
|
+ v-model="formData.project.endTime"
|
|
|
+ type="date"
|
|
|
+ :disabled="true"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="结束日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="项目地址" prop="province" :required="true">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="5" style="margin-right: 12px;">
|
|
|
+ <el-input type="text" v-model="formData.project.province" disabled placeholder="请选择省"></el-input>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5" style="margin-right: 12px;">
|
|
|
+ <el-input type="text" v-model="formData.project.city" disabled placeholder="请选择市"></el-input>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5" style="margin-right: 12px;">
|
|
|
+ <el-input type="text" v-model="formData.project.area" disabled placeholder="请选择区"></el-input>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-input type="text" v-model="formData.project.street" disabled placeholder="请选择街道"></el-input>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="" prop="address">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-input type="text" v-model="formData.project.address" :disabled="true" placeholder="详细地址"></el-input>
|
|
|
+ </el-col>
|
|
|
+ <!-- <el-col :span="2">
|
|
|
+ <geographicalPosi :disabled="formType==2" :formData="this.formData" @selectPosi="selectAddress"/>
|
|
|
+ </el-col> -->
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </template>
|
|
|
+ <el-col :span="6" v-if="id">
|
|
|
+ <el-form-item label="制单人">
|
|
|
+ <el-input type="text" :value="formData.createBy" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" v-if="id">
|
|
|
+ <el-form-item label="制单时间">
|
|
|
+ <el-input type="text" :value="formData.createTime" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" v-if="id">
|
|
|
+ <el-form-item label="审核人">
|
|
|
+ <el-input type="text" :value="formData.confirmBy" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" v-if="id">
|
|
|
+ <el-form-item label="审核时间">
|
|
|
+ <el-input type="text" :value="formData.confirmTime" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="备注">
|
|
|
<el-input type="textarea" :rows="4" v-model="formData.remark" :disabled="formType == 2" placeholder="请输入"></el-input>
|
|
@@ -183,6 +276,56 @@
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
+ <el-card class="box-card" v-if="formData.salesType == '工程' && formType != 0 && formData.flag == 'SAVE'">
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <span>收款信息</span>
|
|
|
+ </div>
|
|
|
+ <div class="mymain-container">
|
|
|
+ <el-form ref="formData1" :rules="rules1" :model="formData1" label-width="110px" size="small" label-position="left">
|
|
|
+ <el-row :gutter="20" justify="start">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="收款金额">
|
|
|
+ <el-input type="text" style="width: 30%" v-model="formData1.price" placeholder="请输入"></el-input>
|
|
|
+ <span style="color: #FF8F47;margin-left: 10px">注:操作【提交】时,系统方可记录收款信息</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="收款凭证">
|
|
|
+ <ImageUpload :fileList="formData1.fileUrl" :limit="1" :isEdit="formType !== 2" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="备注">
|
|
|
+ <el-input type="textarea" :rows="4" v-model="formData1.remark" placeholder="请输入"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ <el-card class="box-card" v-if="formData.salesType == '工程' && formType != 0">
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <span>收款记录</span>
|
|
|
+ </div>
|
|
|
+ <div class="table">
|
|
|
+ <el-table :data="collectionList" element-loading-text="Loading" border fit highlight-current-row stripe>
|
|
|
+ <el-table-column prop="status" label="收款结果" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.status == 'NO'?'未付款':scope.row.status == 'WAIT'?'部分付款':scope.row.status == 'OK'?'已完成':''}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="price" label="收款金额" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="" align="center" label="收款凭证" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-image :src="scope.row.urlPrc" fit="scale-down"></el-image>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="remark" label="备注" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="updateBy" align="center" label="收款人" ></el-table-column>
|
|
|
+ <el-table-column prop="updateTime" align="center" label="收款时间" ></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
<div class="page-footer">
|
|
|
<div class="footer">
|
|
|
<el-button v-if="formType == 0 || (formType == 1 && formData.flag == 'SAVE')" size="small" type="primary" @click="save()">保存</el-button>
|
|
@@ -211,14 +354,20 @@
|
|
|
<script>
|
|
|
import { getWebsit } from "@/api/customerManagement";
|
|
|
import QRCode from "qrcodejs2";
|
|
|
- import { getWorker, getCategory, getGoods, getDetail, add, edit, confirm, submit, getCode } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
|
|
|
+ import { lbsAmapRegion } from '@/api/common.js'
|
|
|
+ import geographicalPosi from '@/components/geographicalPosi/index.vue'
|
|
|
+ import ImageUpload from '@/components/file-upload'
|
|
|
+ import { getWorker, getCategory, getGoods, getDetail, add, edit, confirm, submit, getCode, getProject, getProjectCollectionList } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
|
|
|
export default {
|
|
|
+ components: {geographicalPosi,ImageUpload},
|
|
|
props: ['id','title','formType'],
|
|
|
data() {
|
|
|
return {
|
|
|
dataList: [],
|
|
|
websitList: [],
|
|
|
workerList: [],
|
|
|
+ projectList: [],
|
|
|
+ collectionList: [],
|
|
|
isPay: false,
|
|
|
is_submit: true,
|
|
|
payCodeUrl: '',
|
|
@@ -242,8 +391,31 @@
|
|
|
payType: '',
|
|
|
totalAmount: '',
|
|
|
remark: '',
|
|
|
- buyPeople: 'WORKER'
|
|
|
+ buyPeople: 'WORKER',
|
|
|
+ salesType: '零售',
|
|
|
+ province: '',
|
|
|
+ provinceId: '',
|
|
|
+ city: '',
|
|
|
+ cityId: '',
|
|
|
+ area: '',
|
|
|
+ areaId: '',
|
|
|
+ street: '',
|
|
|
+ streetId: '',
|
|
|
+ address: '',
|
|
|
+ lat: '',
|
|
|
+ lng: '',
|
|
|
+ project: {},
|
|
|
+ orderEnginBaseId: '',
|
|
|
+ },
|
|
|
+ formData1: {
|
|
|
+ price: '',
|
|
|
+ remark: '',
|
|
|
+ fileUrl: []
|
|
|
},
|
|
|
+ provinceList: [],
|
|
|
+ cityList: [],
|
|
|
+ areaList: [],
|
|
|
+ streetList: [],
|
|
|
isEdit: 0,
|
|
|
timer: '',
|
|
|
companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
|
|
@@ -280,7 +452,9 @@
|
|
|
if(this.id){
|
|
|
this.getDetail()
|
|
|
}
|
|
|
+ this.getinitlbslist()
|
|
|
this.getWebsit()
|
|
|
+ this.getProject()
|
|
|
},
|
|
|
methods: {
|
|
|
// 返回
|
|
@@ -292,9 +466,13 @@
|
|
|
getDetail({salesId: this.id}).then(async res => {
|
|
|
Object.assign(this.formData, res.data, {
|
|
|
websit: {websitId: res.data.websitId,name: res.data.websitName},
|
|
|
- worker: {nickName: res.data.workerName,userId: res.data.workerId}
|
|
|
+ worker: {nickName: res.data.workerName,userId: res.data.workerId},
|
|
|
+ project: {id: res.data.orderEnginBaseId,projectName: res.data.projectName,projectNo: res.data.projectNo,manger: res.data.manger,mobile: res.data.mobile,startTime: res.data.startTime,endTime: res.data.endTime,province: res.data.province,provinceId: res.data.provinceId,city: res.data.city,cityId: res.data.cityId,area: res.data.area,areaId: res.data.areaId,street: res.data.street,streetId: res.data.streetId,address: res.data.address,lat: res.data.lat,lng: res.data.lng}
|
|
|
})
|
|
|
this.getWorker()
|
|
|
+ if(res.data.salesType == '工程'){
|
|
|
+ this.getProjectCollectionList(res.data.orderEnginBaseId)
|
|
|
+ }
|
|
|
for(var item of res.data.items){
|
|
|
var ress = await that.getGoods(item.goodsName, 1)
|
|
|
item.goods = {...ress.data,oldPrice:ress.data.price}
|
|
@@ -313,6 +491,20 @@
|
|
|
this.formData.websitName = e.name
|
|
|
this.getWorker()
|
|
|
},
|
|
|
+ getProject(){
|
|
|
+ getProject({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: -1,
|
|
|
+ params:[]
|
|
|
+ }).then(res => {
|
|
|
+ this.projectList = res.data.records
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getProjectCollectionList(orderEnginBaseId){
|
|
|
+ getProjectCollectionList({orderEnginBaseId}).then(res => {
|
|
|
+ this.collectionList = res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
async getGoods(goodsName,type){
|
|
|
const that = this
|
|
|
if(type == 1){
|
|
@@ -386,7 +578,10 @@
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
submit({
|
|
|
- salesId: this.formData.salesId
|
|
|
+ salesId: this.formData.salesId,
|
|
|
+ price: this.formData1.price,
|
|
|
+ urlPrc: this.formData1.fileUrl[0].url,
|
|
|
+ remark: this.formData1.remark
|
|
|
}).then(res => {
|
|
|
if(res.code == 200){
|
|
|
this.$message.success('提交成功!')
|
|
@@ -476,7 +671,9 @@
|
|
|
identity: this.formData.identity,
|
|
|
workerMobile: this.formData.workerMobile,
|
|
|
buyPeople: this.formData.buyPeople,
|
|
|
- items: this.dataList
|
|
|
+ items: this.dataList,
|
|
|
+ orderEnginBaseId: this.formData.orderEnginBaseId,
|
|
|
+ salesType: this.formData.salesType
|
|
|
}).then(res => {
|
|
|
if(res.code == 200){
|
|
|
this.$message.success('提交成功!')
|
|
@@ -497,7 +694,9 @@
|
|
|
identity: this.formData.identity,
|
|
|
workerMobile: this.formData.workerMobile,
|
|
|
buyPeople: this.formData.buyPeople,
|
|
|
- items: this.dataList
|
|
|
+ items: this.dataList,
|
|
|
+ orderEnginBaseId: this.formData.orderEnginBaseId,
|
|
|
+ salesType: this.formData.salesType
|
|
|
}).then(res => {
|
|
|
if(res.code == 200){
|
|
|
this.dataList = []
|
|
@@ -508,7 +707,86 @@
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
- }
|
|
|
+ },
|
|
|
+ changeSale(){
|
|
|
+
|
|
|
+ },
|
|
|
+ getinitlbslist() {
|
|
|
+ // 初始化请求省市区街道下拉选项数据
|
|
|
+ lbsAmapRegion({ pid: 0 }).then(res => {
|
|
|
+ this.provinceList = res.data
|
|
|
+ // 创建工单时获取ip地址定位赋值
|
|
|
+ if (!this.id && this.$IpAdd.province) {
|
|
|
+ var item = this.provinceList.find(item => item.name === this.$IpAdd.province)
|
|
|
+ if (item) {
|
|
|
+ this.formData.provinceId = item.id
|
|
|
+ this.formData.province = item.name
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.formData.provinceId) {
|
|
|
+ lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
|
|
|
+ this.cityList = res.data
|
|
|
+ // 创建工单时获取ip地址定位赋值
|
|
|
+ if (!this.id && this.$IpAdd.city) {
|
|
|
+ var item2 = this.cityList.find(item => item.name === this.$IpAdd.city)
|
|
|
+ if (item2) {
|
|
|
+ this.formData.cityId = item2.id
|
|
|
+ this.formData.city = item2.name
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.formData.cityId) {
|
|
|
+ lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
|
|
|
+ this.areaList = res.data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (this.formData.areaId) {
|
|
|
+ lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
|
|
|
+ this.streetList = res.data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ selectAddress(data){
|
|
|
+ this.formData.lng = data.center[0]
|
|
|
+ this.formData.lat = data.center[1]
|
|
|
+ // 获取定位的省市区街道
|
|
|
+ var { province, city, district, township } = data.data.addressComponent
|
|
|
+ // 获取选中省名称id
|
|
|
+ var { id, name } = this.provinceList.find(item => item.name === province)
|
|
|
+ this.formData.provinceId = id
|
|
|
+ this.formData.province = name
|
|
|
+ // 请求市选项
|
|
|
+ lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
|
|
|
+ // 赋值市选项
|
|
|
+ this.cityList = res.data
|
|
|
+ // 获取选中市名称id
|
|
|
+ var { id, name } = res.data.find(item => item.name === city)
|
|
|
+ this.formData.cityId = id
|
|
|
+ this.formData.city = name
|
|
|
+ // 请求区选项
|
|
|
+ lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
|
|
|
+ // 赋值区选项
|
|
|
+ this.areaList = res.data
|
|
|
+ // 获取选中区名称id
|
|
|
+ var { id, name } = res.data.find(item => item.name === district)
|
|
|
+ this.formData.areaId = id
|
|
|
+ this.formData.area = name
|
|
|
+ // 请求街道选项
|
|
|
+ lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
|
|
|
+ // 赋值街道选项
|
|
|
+ this.streetList = res.data
|
|
|
+ // 获取选中街道名称id
|
|
|
+ var { id, name } = res.data.find(item => item.name === township)
|
|
|
+ this.formData.streetId = id
|
|
|
+ this.formData.street = name
|
|
|
+ // 赋值GPS详细地址
|
|
|
+ this.formData.address = data.name
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|