|
@@ -81,11 +81,14 @@
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
+ <el-col :span="7">
|
|
|
<el-form-item label="销售订单号" :required="true">
|
|
|
- <el-input type="text" v-model="formData.salesId" :disabled="formType == 2" @change="getDetail" placeholder="请输入销售订单号"></el-input>
|
|
|
+ <el-input type="text" v-model="formData.salesId" @change="getDetail" disabled placeholder="请输入销售订单号"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="1">
|
|
|
+ <el-button v-if="formType != 2" size="small" type="primary" @click="isShowNo = true;getOrderList();">选择</el-button>
|
|
|
+ </el-col>
|
|
|
<el-col :span="5">
|
|
|
<el-form-item label="销售金额">
|
|
|
<el-input type="text" :value="formData.totalAmount" disabled></el-input>
|
|
@@ -283,10 +286,22 @@
|
|
|
<el-input type="number" v-model="scope.row.phone" :disabled="formType == 2" placeholder="请输入"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="配件名称" align="center">
|
|
|
+ <!-- <el-table-column label="配件名称" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input type="text" v-model="scope.row.partsName" :disabled="formType == 2" placeholder="请输入"></el-input>
|
|
|
</template>
|
|
|
+ </el-table-column> -->
|
|
|
+ <el-table-column label="配件名称" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-select v-model="scope.row.goods" @change="changeGoods1" value-key="goodsId" :disabled="isEdit != scope.$index || formType == 2" placeholder="请选择" style="width: 100%;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in scope.row.goodsList"
|
|
|
+ :key="item.goodsId"
|
|
|
+ :label="item.goodsName"
|
|
|
+ :value="item">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="配件编码" align="center">
|
|
|
<template slot-scope="scope">
|
|
@@ -323,14 +338,143 @@
|
|
|
<h3>扫二维码支付</h3>
|
|
|
<el-image :src="payCodeUrl" fit="fit"></el-image>
|
|
|
</el-dialog>
|
|
|
+ <!-- 选择销售订单号 -->
|
|
|
+ <el-dialog title="选择销售订单" :visible.sync="isShowNo" width="80%" :close-on-click-modal="false" :modal-append-to-body="false" @close="close">
|
|
|
+ <el-form ref="formData1" :model="formData1" label-width="110px" size="small" label-position="left">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="网点名称" prop="websit_id">
|
|
|
+ <el-select v-model="formData1.websit_id" @change="changeWebsit" placeholder="请选择" style="width: 100%;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in websitList"
|
|
|
+ :key="item.websitId"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.websitId">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="师傅姓名" prop="worker_name">
|
|
|
+ <el-select v-model="formData1.worker_name" @focus="()=>{
|
|
|
+ if(!this.formData1.websit_id){return this.$message.warning('请先选择网点名称!');}
|
|
|
+ }" filterable placeholder="请选择" style="width: 100%;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in workerList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.nickName + '-' + item.mobile"
|
|
|
+ :value="item.nickName">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="师傅联系电话" prop="worker_mobile">
|
|
|
+ <el-input type="text" v-model="formData1.worker_mobile" placeholder="请输入"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="物料名称" prop="goods" align="center">
|
|
|
+ <el-select v-model="formData1.goods" @focus="()=>{
|
|
|
+ if(!this.formData1.websit_id){return this.$message.warning('请先选择网点名称!');}
|
|
|
+ }" value-key="goodsId" placeholder="请选择" style="width: 100%;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in goodsList"
|
|
|
+ :key="item.goodsId"
|
|
|
+ :label="item.goodsName"
|
|
|
+ :value="item">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <!-- <el-col :span="8">
|
|
|
+ <el-form-item label="规格型号" align="center">
|
|
|
+ <el-select v-model="formData1.goods" @focus="()=>{
|
|
|
+ if(!this.formData1.websit_id){return this.$message.warning('请先选择网点名称!');}
|
|
|
+ }" value-key="goodsId" placeholder="请选择" style="width: 100%;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in goodsList"
|
|
|
+ :key="item.goodsId"
|
|
|
+ :label="item.goodsSpecification"
|
|
|
+ :value="item">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col> -->
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-row type="flex" justify="end">
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-button size="small" @click="resetScreenForm()">清空</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="submitScreenForm()">搜索</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div class="clearfix">
|
|
|
+ <span>订单信息</span>
|
|
|
+ </div>
|
|
|
+ <div class="table">
|
|
|
+ <el-table ref="treeTable" :data="orderList" element-loading-text="Loading" @select="handleSelectionChange" @row-click="handleSelectionChange('',$event)" border fit highlight-current-row stripe style="max-height: 380px;overflow-y: auto;">
|
|
|
+ <el-table-column type="selection" width="40"></el-table-column>
|
|
|
+ <el-table-column prop="salesId" align="center" label="销售单号" width="140"></el-table-column>
|
|
|
+ <el-table-column prop="" align="center" label="单据状态" width="120">已支付,已提货</el-table-column>
|
|
|
+ <el-table-column prop="websitName" align="center" label="网点名称" width="140"></el-table-column>
|
|
|
+ <el-table-column prop="" align="center" label="购买方">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.buyPeople == 'WORKER'?'内部师傅':'客户'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="workerName" align="center" label="师傅姓名"></el-table-column>
|
|
|
+ <el-table-column prop="workerMobile" align="center" label="师傅联系电话" width="120"></el-table-column>
|
|
|
+ <el-table-column prop="salesType" align="center" label="销售类型"></el-table-column>
|
|
|
+ <el-table-column prop="salesTime" align="center" label="销售日期" width="160"></el-table-column>
|
|
|
+ <el-table-column prop="totalAmount" align="center" label="订单金额"></el-table-column>
|
|
|
+ <el-table-column prop="" align="center" label="订单来源">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.source == 'ONLINE'?'在线订单':'自建订单'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="payType" align="center" label="支付方式">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.payType == 'CASH'?'现金':scope.row.payType == 'WECHAT'?'微信':'工程支付'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="payTime" align="center" label="支付时间" width="160"></el-table-column>
|
|
|
+ <el-table-column prop="payNo" align="center" label="支付单号" width="160"></el-table-column>
|
|
|
+ <el-table-column prop="createBy" align="center" label="创建人" width="160"></el-table-column>
|
|
|
+ <el-table-column prop="createTime" align="center" label="创建时间" width="160"></el-table-column>
|
|
|
+ <el-table-column prop="updateBy" align="center" label="审核人" width="160"></el-table-column>
|
|
|
+ <el-table-column prop="updateTime" align="center" label="审核时间" width="160"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="pagination clearfix">
|
|
|
+ <div class="fr">
|
|
|
+ <el-pagination
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="pageNum"
|
|
|
+ :page-sizes="[10, 20, 30, 50]"
|
|
|
+ :page-size="pageSize"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="listTotal"
|
|
|
+ ></el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div slot="footer" class="dialog-footer" style="margin-top: 10px;">
|
|
|
+ <el-button size="small" @click="isShowNo = false">取 消</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="confirmOrder()">确定</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { getWebsit } from "@/api/customerManagement";
|
|
|
import ImageUpload from '@/components/file-upload'
|
|
|
- import { getWorker, getCategory, getGoods, getDetail } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
|
|
|
- import { add, edit, getNewDetail } from "@/api/auxiliaryFittings/attachmentNewReturn";
|
|
|
+ import { listPageV2, getWorker, getCategory, getGoods, getDetail } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
|
|
|
+ import { add, edit, getNewDetail, getAttachmentList } from "@/api/auxiliaryFittings/attachmentNewReturn";
|
|
|
+ import { getGoodsList } from "@/api/auxiliaryFittings/auxiliarySalesReturnOrder";
|
|
|
export default {
|
|
|
components: { ImageUpload },
|
|
|
props: ['id','title','formType'],
|
|
@@ -340,6 +484,9 @@
|
|
|
oldList: [],
|
|
|
websitList: [],
|
|
|
workerList: [],
|
|
|
+ orderList: [],
|
|
|
+ goodsList: [],
|
|
|
+ attachmentList: [],
|
|
|
mainList: [],
|
|
|
isPay: false,
|
|
|
payCodeUrl: '',
|
|
@@ -378,6 +525,14 @@
|
|
|
lng: '',
|
|
|
orderEnginBaseId: '',
|
|
|
},
|
|
|
+ formData1: {
|
|
|
+ websit_id: '',
|
|
|
+ worker_name: '',
|
|
|
+ worker_mobile: '',
|
|
|
+ goods: {},
|
|
|
+ goodsName: '',
|
|
|
+ goodsSpecification: ''
|
|
|
+ },
|
|
|
isEdit: 0,
|
|
|
companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
|
|
|
rules: {
|
|
@@ -395,7 +550,11 @@
|
|
|
{ required: true, message: '请输入师傅联系电话', trigger: 'blur' },
|
|
|
{ pattern:/^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
|
|
|
],
|
|
|
- }
|
|
|
+ },
|
|
|
+ isShowNo: false,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ listTotal: 0
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
@@ -452,11 +611,62 @@
|
|
|
this.websitList = res.data
|
|
|
})
|
|
|
},
|
|
|
+ close(){
|
|
|
+ this.$refs.formData1.resetFields();
|
|
|
+ },
|
|
|
+ confirmOrder(){
|
|
|
+ this.isShowNo = false
|
|
|
+ this.getDetail(this.selectedRow.salesId)
|
|
|
+ },
|
|
|
+ getOrderList(){
|
|
|
+ listPageV2({pageNum: this.pageNum,pageSize: this.pageSize,params: [{param: 'a.flag',compare: '=',value: 'PAY_TAKE'},{param: "a.goods_type", compare: "=", value: "P"},{param: 'a.websit_id',compare: '=',value: this.formData1.websit_id},{param: 'a.worker_name',compare: '=',value: this.formData1.worker_name},{param: 'a.worker_mobile',compare: '=',value: this.formData1.worker_mobile}], goodsName: this.formData1.goods.goodsName, goodsSpecification: this.formData1.goods.goodsSpecification}).then(res => {
|
|
|
+ this.orderList = res.data.records
|
|
|
+ this.listTotal = res.data.total
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getGoodsList(){
|
|
|
+ getGoodsList({
|
|
|
+ type: 'P',
|
|
|
+ websitId: this.formData1.websit_id
|
|
|
+ }).then(res => {
|
|
|
+ this.goodsList = res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleSelectionChange (selection, row) {
|
|
|
+ this.$refs.treeTable.clearSelection()
|
|
|
+ // 这里因为需求做的是必选一个,如有其他需求可做调整
|
|
|
+ this.$refs.treeTable.toggleRowSelection(row, true)
|
|
|
+ this.selectedRow = row
|
|
|
+ },
|
|
|
+ // 更改每页数量
|
|
|
+ handleSizeChange(val) {
|
|
|
+ this.pageSize = val;
|
|
|
+ this.pageNum = 1;
|
|
|
+ this.getOrderList();
|
|
|
+ },
|
|
|
+ // 更改当前页
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.pageNum = val;
|
|
|
+ this.getOrderList();
|
|
|
+ },
|
|
|
+ // 提交筛选表单
|
|
|
+ submitScreenForm() {
|
|
|
+ this.pageNum = 1;
|
|
|
+ this.getOrderList();
|
|
|
+ },
|
|
|
+
|
|
|
+ // 重置筛选表单
|
|
|
+ resetScreenForm() {
|
|
|
+ this.$refs.formData1.resetFields();
|
|
|
+ this.pageNum = 1;
|
|
|
+ this.getOrderList();
|
|
|
+ },
|
|
|
changeWebsit(e){
|
|
|
- this.formData.websitId = e.websitId
|
|
|
- this.formData.websitName = e.name
|
|
|
+ // this.formData.websitId = e.websitId
|
|
|
+ // this.formData.websitName = e.name
|
|
|
this.getWorker()
|
|
|
- this.getCategory(e.websitId)
|
|
|
+ this.getGoodsList()
|
|
|
+ // this.getCategory(e.websitId)
|
|
|
},
|
|
|
async getGoods(goodsName,type){
|
|
|
const that = this
|
|
@@ -501,6 +711,15 @@
|
|
|
this.dataList[this.isEdit].goodsCode = e. goodsCode
|
|
|
this.dataList[this.isEdit].qty = e.qty
|
|
|
},
|
|
|
+ changeGoods1(e){
|
|
|
+ this.oldList[this.isEdit].goodsId = e.goodsId
|
|
|
+ this.oldList[this.isEdit].goodsName = e.goodsName
|
|
|
+ this.oldList[this.isEdit].unit = e.goodsStockUnit
|
|
|
+ this.oldList[this.isEdit].orderBrand = e.brandRelaName
|
|
|
+ this.oldList[this.isEdit].partsName = e.productRelaName
|
|
|
+ this.oldList[this.isEdit].partsCode = e.goodsCode
|
|
|
+ this.oldList[this.isEdit].qty = e.oldQty
|
|
|
+ },
|
|
|
add(){
|
|
|
this.oldList.push({
|
|
|
orderId: '',
|
|
@@ -510,7 +729,17 @@
|
|
|
partsName: '',
|
|
|
unit: '',
|
|
|
qty: '',
|
|
|
- partsCode: ''
|
|
|
+ partsCode: '',
|
|
|
+ goodsList: [],
|
|
|
+ goods: {},
|
|
|
+ goodsId: '',
|
|
|
+ goodsName: '',
|
|
|
+ })
|
|
|
+ this.getAttachmentList()
|
|
|
+ },
|
|
|
+ getAttachmentList(){
|
|
|
+ getAttachmentList({pageNum: 1,pageSize: -1,params: [{param: 'a.websit_id',compare: '=',value: this.formData.websitId}]}).then(res => {
|
|
|
+ this.oldList[this.isEdit].goodsList = res.data.records
|
|
|
})
|
|
|
},
|
|
|
async checkForm(){
|