|
|
@@ -0,0 +1,582 @@
|
|
|
+<template>
|
|
|
+ <ele-modal
|
|
|
+ custom-class="ele-dialog-form long-dialog-form"
|
|
|
+ :centered="true"
|
|
|
+ v-if="visible"
|
|
|
+ :visible.sync="visible"
|
|
|
+ :title="title"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ width="80%"
|
|
|
+ @close="cancel"
|
|
|
+ >
|
|
|
+
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
+
|
|
|
+ <headerTitle title="发货信息"></headerTitle>
|
|
|
+ <el-row>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item
|
|
|
+ label="选择订单"
|
|
|
+ prop="orderNo"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.orderNo"
|
|
|
+ @click.native="handleOrderBtn"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="客户名称"
|
|
|
+ prop="contactName"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ <span>{{form.contactName}}</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="客户联系人"
|
|
|
+ prop="linkName"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.linkName"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item prop="sendFiles" label="发货附件">
|
|
|
+ <fileUpload
|
|
|
+ v-model="form.sendFiles"
|
|
|
+ module="main"
|
|
|
+ :showLib="false"
|
|
|
+ :limit="10"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+
|
|
|
+ <el-form-item
|
|
|
+ label="车辆号"
|
|
|
+ prop="carNo"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.carNo"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <!-- <el-form-item
|
|
|
+ label="订单编码"
|
|
|
+ prop="orderNo"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ <span>{{form.orderNo}}</span>
|
|
|
+
|
|
|
+ </el-form-item> -->
|
|
|
+
|
|
|
+
|
|
|
+ <el-form-item
|
|
|
+ label="客户电话"
|
|
|
+ prop="linkPhone"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.linkPhone"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="客户收货地址"
|
|
|
+ prop="receiveAddress"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.receiveAddress"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <headerTitle title="产品清单" style="margin-top:30px;"></headerTitle>
|
|
|
+ <ele-pro-table ref="table" :needPage="false" :columns="competAnalysisListcolumns" :toolkit="[]" :datasource="form.productList" row-key="id">
|
|
|
+ <!-- <template v-slot:toolbar>
|
|
|
+ <div class="headbox">
|
|
|
+ <span class="amount">总计:{{form.totalAmount}}元</span>
|
|
|
+ <span class="amount">应付金额:{{form.payAmount}}元</span>
|
|
|
+ </div>
|
|
|
+ </template> -->
|
|
|
+ <template v-slot:technicalDrawings="{ row }">
|
|
|
+ <div v-if="row.technicalDrawings && row.technicalDrawings?.length">
|
|
|
+ <el-link
|
|
|
+ v-for="link in row.technicalDrawings" :key="link.id"
|
|
|
+ type="primary" :underline="false"
|
|
|
+ @click="downloadFile(link)"> {{ link.name }}</el-link>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-slot:remark="{ row }">
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="row.remark"
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <!-- 操作列 -->
|
|
|
+ <template v-slot:action="{ row }">
|
|
|
+ <el-popconfirm class="ele-action" title="确定要删除吗?" @confirm="remove(row)">
|
|
|
+ <template v-slot:reference>
|
|
|
+ <el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
+ 删除
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ </el-popconfirm>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ </ele-pro-table>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <div slot="footer" class="footer">
|
|
|
+ <el-button type="primary" @click="save">保存</el-button>
|
|
|
+ <el-button @click="cancel">返回</el-button>
|
|
|
+ </div>
|
|
|
+ <orderListDialog ref="orderListDialogRef" @changeParent="changeOrder"></orderListDialog>
|
|
|
+ </ele-modal>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { emailReg, phoneReg,numberReg } from 'ele-admin';
|
|
|
+import {acceptUnpackoptions} from '@/enum/dict';
|
|
|
+import fileUpload from '@/components/upload/fileUpload';
|
|
|
+import dictMixins from '@/mixins/dictMixins';
|
|
|
+import deptSelect from '@/components/CommomSelect/dept-select.vue';
|
|
|
+import personSelect from '@/components/CommomSelect/person-select.vue';
|
|
|
+import parentList from '@/views/saleManage/contact/components/parentList.vue'
|
|
|
+import { getDetail} from '@/api/contractManage/contractBook';
|
|
|
+import { getSaleOrderDetail, UpdateInformation, addInformation,deleteInformation,updateStatus} from '@/api/saleManage/saleorder';
|
|
|
+import { addSendInformation,UpdateSendInformation,getSendSaleOrderrecordDetail} from '@/api/saleManage/saleordersendrecord';
|
|
|
+import {getcontactlink} from '@/api/saleManage/businessFollow';
|
|
|
+import {listOrganizations} from '@/api/system/organization';
|
|
|
+import orderListDialog from './orderListDialog.vue';
|
|
|
+import {copyObj} from '@/utils/util';
|
|
|
+
|
|
|
+
|
|
|
+export default {
|
|
|
+ mixins: [dictMixins],
|
|
|
+ components: {
|
|
|
+ fileUpload,
|
|
|
+ deptSelect,
|
|
|
+ orderListDialog,
|
|
|
+ parentList,
|
|
|
+ personSelect
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ let formDef = {
|
|
|
+ id:'',
|
|
|
+ contractId: '',
|
|
|
+ sendFiles:[],
|
|
|
+ contractName: '',
|
|
|
+ receiveAddress:'',
|
|
|
+ carNo:'',
|
|
|
+ carId:'',
|
|
|
+ linkName:'',
|
|
|
+ linkPhone:'',
|
|
|
+ orderNo:'',
|
|
|
+ orderId:''
|
|
|
+ };
|
|
|
+
|
|
|
+ return {
|
|
|
+ detailData:{},
|
|
|
+ payWayOptions:[],
|
|
|
+ delDetailIds:[],
|
|
|
+ linkNameOptions:[],
|
|
|
+ acceptUnpackoptions,
|
|
|
+ visible: false,
|
|
|
+ title: '',
|
|
|
+ row: {},
|
|
|
+ activeName: 'base',
|
|
|
+ formDef,
|
|
|
+ form: copyObj(formDef),
|
|
|
+ tableBankData: [],
|
|
|
+ tableLinkData: [],
|
|
|
+ // 组织机构树形结构数据
|
|
|
+ groupTreeData: [],
|
|
|
+ groupData:[],
|
|
|
+ rules: {
|
|
|
+ partaName: [
|
|
|
+ { required: true, message: '请选择客户名称', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ competAnalysisListcolumns: [
|
|
|
+
|
|
|
+ {
|
|
|
+ width: 45,
|
|
|
+ type: 'index',
|
|
|
+ columnKey: 'index',
|
|
|
+ align: 'center',
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 200,
|
|
|
+ prop: 'productName',
|
|
|
+ label: '名称',
|
|
|
+ slot: 'productName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'productCode',
|
|
|
+ label: '编码',
|
|
|
+ slot: 'productCode'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 200,
|
|
|
+ prop: 'productCategoryName',
|
|
|
+ label: '类型',
|
|
|
+ slot: 'productCategoryName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 160,
|
|
|
+ prop: 'productBrand',
|
|
|
+ label: '牌号',
|
|
|
+ slot: 'productBrand'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'modelType',
|
|
|
+ label: '型号',
|
|
|
+ slot: 'modelType'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'specification',
|
|
|
+ label: '规格',
|
|
|
+ slot: 'specification'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ width: 160,
|
|
|
+ prop: 'singlePrice',
|
|
|
+ label: '单价',
|
|
|
+ slot: 'singlePrice'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'totalCount',
|
|
|
+ label: '数量',
|
|
|
+ slot: 'totalCount'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'totalPrice',
|
|
|
+ label: '销售总金额',
|
|
|
+ slot: 'totalPrice',
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return _row.totalPrice+'元'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'measuringUnit',
|
|
|
+ label: '计量单位',
|
|
|
+ slot: 'measuringUnit'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'deliveryDays',
|
|
|
+ label: '交期(天)',
|
|
|
+ slot: 'deliveryDays'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 200,
|
|
|
+ prop: 'guaranteePeriod',
|
|
|
+ label: '质保期',
|
|
|
+ slot: 'guaranteePeriod',
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return _row.guaranteePeriod+_row.guaranteePeriodUnitName
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // width: 120,
|
|
|
+ // prop: 'guaranteePeriodUnitCode',
|
|
|
+ // label: '',
|
|
|
+ // slot: 'guaranteePeriodUnitCode'
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'technicalAnswerName',
|
|
|
+ label: '技术答疑人',
|
|
|
+ slot: 'technicalAnswerName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 220,
|
|
|
+ prop: 'technicalParams',
|
|
|
+ label: '技术参数',
|
|
|
+ slot: 'technicalParams'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width:240,
|
|
|
+ prop: 'technicalDrawings',
|
|
|
+ label: '技术图纸',
|
|
|
+ slot: 'technicalDrawings',
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return _row.guaranteePeriod+_row.guaranteePeriodUnitName
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 220,
|
|
|
+ prop: 'remark',
|
|
|
+ label: '备注',
|
|
|
+ slot: 'remark'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 120,
|
|
|
+ align: 'center',
|
|
|
+ resizable: false,
|
|
|
+ slot: 'action',
|
|
|
+ fixed:'right',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ // 提交状态
|
|
|
+ loading: false,
|
|
|
+ // 是否是修改
|
|
|
+ isUpdate: false,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+
|
|
|
+ allcountAmount(){
|
|
|
+ return this.$store.state.order.allcountAmount
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ //删除产品
|
|
|
+ remove(row) {
|
|
|
+ if( this.form.productList.length===1) return this.$message.error('必须要留一个产品')
|
|
|
+ let index = this.form.productList.findIndex((n) => n.key == row.key);
|
|
|
+ if (index !== -1) {
|
|
|
+ this.form.productList.splice(index, 1);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ //选择订单回调
|
|
|
+ changeOrder(obj){
|
|
|
+ this.form = Object.assign({},this.form,{
|
|
|
+ orderId: obj.id,
|
|
|
+ orderNo: obj.orderNo,
|
|
|
+ })
|
|
|
+ this.getSaleOrderDetail(obj.id)
|
|
|
+
|
|
|
+ },
|
|
|
+ //获取订单详情
|
|
|
+ async getSaleOrderDetail(id){
|
|
|
+ this.loading = true;
|
|
|
+ const data = await getSaleOrderDetail(id);
|
|
|
+ this.loading = false;
|
|
|
+ console.log(this.form,'9999999')
|
|
|
+ if (data) {
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ let {partaId,partaName,partaTel,orderNo,id,partaLinkName,receiveAddress,productList,totalAmount,payAmount}=data
|
|
|
+ this.form =Object.assign({}, this.form,{contactId:partaId,contactName:partaName,linkName:partaLinkName,linkPhone:partaTel,orderNo,orderId:id,receiveAddress,productList,totalAmount,payAmount}) ;
|
|
|
+ console.log(this.form,'7777777777777777')
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ //发货单详情
|
|
|
+ async getSendSaleOrderDetail(id){
|
|
|
+ this.loading = true;
|
|
|
+ const data = await getSendSaleOrderrecordDetail(id);
|
|
|
+ this.loading = false;
|
|
|
+ if (data) {
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.form = data;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ //更新联系人数据
|
|
|
+ async getLinkInfo(contactId) {
|
|
|
+ const data = await getcontactlink({contactId});
|
|
|
+ if(data&&data?.length){
|
|
|
+ this.linkNameOptions=data
|
|
|
+ }
|
|
|
+ },
|
|
|
+ selectFocus(){
|
|
|
+ if(this.linkNameOptions.length===0){
|
|
|
+ return this.$message.error('请先选择名称')
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ handHead(){
|
|
|
+
|
|
|
+ let item={
|
|
|
+ id:this.form.partbLinkId
|
|
|
+ }
|
|
|
+ this.$refs.headRef.open(item)
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //选择订单弹框
|
|
|
+ handleOrderBtn(){
|
|
|
+ let item = {
|
|
|
+ id: this.form.orderId
|
|
|
+ }
|
|
|
+ this.$refs.orderListDialogRef.open(item)
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ //打开新增编辑弹框
|
|
|
+ async open(type, row,orderId) {
|
|
|
+ this.title = type==='add'?'新增':'修改';
|
|
|
+ this.row = row;
|
|
|
+ this.visible = true;
|
|
|
+ if(orderId){
|
|
|
+ this.getSaleOrderDetail(orderId)
|
|
|
+ }
|
|
|
+ if(row&&row?.id){
|
|
|
+ this.getSendSaleOrderDetail(row?.id)
|
|
|
+ }
|
|
|
+
|
|
|
+ if (type == 'add') {
|
|
|
+ this.isUpdate = false;
|
|
|
+ } else {
|
|
|
+ this.isUpdate = true;
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ salesmanChange(val, info){
|
|
|
+ this.otherForm.salesmanName = info.name;
|
|
|
+ },
|
|
|
+ settlementModeChange(info){
|
|
|
+ this.form.settlementModeName = info.dictValue;
|
|
|
+ },
|
|
|
+ ifChiefChange(value, idx){
|
|
|
+ if(value === 1){
|
|
|
+ this.tableLinkData.forEach(e => e.ifChief = 0);
|
|
|
+ this.tableLinkData[idx].ifChief = 1;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ getValidate() {
|
|
|
+ return Promise.all([
|
|
|
+ new Promise((resolve, reject) => {
|
|
|
+ this.$refs.form.validate((valid) => {
|
|
|
+ if (!valid) {
|
|
|
+ reject(false);
|
|
|
+ } else {
|
|
|
+ resolve(true);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+
|
|
|
+ ]);
|
|
|
+ },
|
|
|
+ async save() {
|
|
|
+ try {
|
|
|
+ await this.getValidate();
|
|
|
+ // 表单验证通过,执行保存操作
|
|
|
+ this.loading = true;
|
|
|
+
|
|
|
+ if (!this.isUpdate) {
|
|
|
+ delete this.form.id;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (this.isUpdate) {
|
|
|
+ UpdateSendInformation(this.form)
|
|
|
+ .then((res) => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.success("修改成功");
|
|
|
+ this.cancel();
|
|
|
+ this.$emit('done');
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ //this.loading = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ addSendInformation(this.form)
|
|
|
+ .then((res) => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.success("新增成功");
|
|
|
+ this.cancel();
|
|
|
+ this.$emit('done');
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ //this.loading = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error)
|
|
|
+ // 表单验证未通过,不执行保存操作
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ cancel() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.activeName = 'base';
|
|
|
+ // 关闭后,销毁所有的表单数据
|
|
|
+ this.$refs['otherForm'] && this.$refs['otherForm'].resetFields();
|
|
|
+ this.$refs['formRef'] && this.$refs['formRef'].resetFields();
|
|
|
+ this.$store.commit('order/clearUserData');
|
|
|
+ this.form = copyObj(this.formDef)
|
|
|
+ this.visible = false;
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ };
|
|
|
+</script>
|
|
|
+<style scoped lang="scss">
|
|
|
+.TotalAmount{
|
|
|
+ font-size: 16px;
|
|
|
+ padding-right: 30px;
|
|
|
+}
|
|
|
+
|
|
|
+.headbox{
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: center;
|
|
|
+ .amount{
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-right: 20px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|