|  | @@ -4,7 +4,7 @@
 | 
	
		
			
				|  |  |        <avue-crud :key="key" ref="crud" :option="option" :data="dataList" :page.sync="page" :search.sync="search"
 | 
	
		
			
				|  |  |                   @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
 | 
	
		
			
				|  |  |                   @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading" @saveColumn="saveColumn"
 | 
	
		
			
				|  |  | -                 @resetColumn="resetColumn" :cell-style="cellStyle" @search-criteria-switch="searchCriteriaSwitch">
 | 
	
		
			
				|  |  | +                 @resetColumn="resetColumn" :cell-style="cellStyle" @search-criteria-switch="searchCriteriaSwitch" @expand-change="expandChange">
 | 
	
		
			
				|  |  |          <template slot="menuLeft">
 | 
	
		
			
				|  |  |            <div style="display:flex;padding-top: 10px">
 | 
	
		
			
				|  |  |              <el-badge v-for="item of badgeList" :hidden="item.dictionaryStatus == '全部'?true:false" :value="item.count" :max="99" class="item" type="danger">
 | 
	
	
		
			
				|  | @@ -15,6 +15,9 @@
 | 
	
		
			
				|  |  |              <el-button type="primary" size="mini" @click.stop="newAdd()">新建销售单</el-button>
 | 
	
		
			
				|  |  |            </div>
 | 
	
		
			
				|  |  |          </template>
 | 
	
		
			
				|  |  | +        <template slot="expand" slot-scope="{row}">
 | 
	
		
			
				|  |  | +          <avue-crud ref="expandCrud" :option="optionList" :data="row.orderItemsList"></avue-crud>
 | 
	
		
			
				|  |  | +        </template>
 | 
	
		
			
				|  |  |          <template slot="corpIdSearch">
 | 
	
		
			
				|  |  |            <crop-select v-model="search.corpId" corpType="KH"></crop-select>
 | 
	
		
			
				|  |  |          </template>
 | 
	
	
		
			
				|  | @@ -67,7 +70,15 @@
 | 
	
		
			
				|  |  |          <el-form :model="form" label-position="right">
 | 
	
		
			
				|  |  |            <el-col :span="12">
 | 
	
		
			
				|  |  |              <el-form-item label="快递公司:" label-width="100px">
 | 
	
		
			
				|  |  | -              <el-input v-model="form.courierCorporation" placeholder="请输入快递公司" size="small" style="width: 100%;"></el-input>
 | 
	
		
			
				|  |  | +<!--              <el-input v-model="form.courierCorporation" placeholder="请输入快递公司" size="small" style="width: 100%;"></el-input>-->
 | 
	
		
			
				|  |  | +              <el-select v-model="form.courierCorporation" placeholder="请选择快递公司" clearable filterable size="small" style="width: 100%;">
 | 
	
		
			
				|  |  | +                <el-option
 | 
	
		
			
				|  |  | +                    v-for="item in courierServices"
 | 
	
		
			
				|  |  | +                    :key="item.dictKey"
 | 
	
		
			
				|  |  | +                    :label="item.dictValue"
 | 
	
		
			
				|  |  | +                    :value="item.dictKey">
 | 
	
		
			
				|  |  | +                </el-option>
 | 
	
		
			
				|  |  | +              </el-select>
 | 
	
		
			
				|  |  |              </el-form-item>
 | 
	
		
			
				|  |  |            </el-col>
 | 
	
		
			
				|  |  |            <el-col :span="12">
 | 
	
	
		
			
				|  | @@ -88,6 +99,7 @@
 | 
	
		
			
				|  |  |  <script>
 | 
	
		
			
				|  |  |  import detailsPage from "./detailsPage";
 | 
	
		
			
				|  |  |  import {option} from "./js/optionList";
 | 
	
		
			
				|  |  | +import {optionList} from "./js/optionList";
 | 
	
		
			
				|  |  |  import {
 | 
	
		
			
				|  |  |    getListTwo,
 | 
	
		
			
				|  |  |    getCorpsAll,
 | 
	
	
		
			
				|  | @@ -95,7 +107,7 @@ import {
 | 
	
		
			
				|  |  |    getCorpType,
 | 
	
		
			
				|  |  |    orderRemove,
 | 
	
		
			
				|  |  |    statusStatisticsApi,
 | 
	
		
			
				|  |  | -  delivery
 | 
	
		
			
				|  |  | +  delivery, getDetails, getStoragelist
 | 
	
		
			
				|  |  |  } from "@/api/basicData/salesOrder";
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  export default {
 | 
	
	
		
			
				|  | @@ -104,6 +116,108 @@ export default {
 | 
	
		
			
				|  |  |      return {
 | 
	
		
			
				|  |  |        src: '',
 | 
	
		
			
				|  |  |        form: {},
 | 
	
		
			
				|  |  | +      optionList: {
 | 
	
		
			
				|  |  | +        header:false,
 | 
	
		
			
				|  |  | +        align: "center",
 | 
	
		
			
				|  |  | +        addBtn: false,
 | 
	
		
			
				|  |  | +        refreshBtn: false,
 | 
	
		
			
				|  |  | +        editBtn: false,
 | 
	
		
			
				|  |  | +        delBtn: false,
 | 
	
		
			
				|  |  | +        columnBtn: false,
 | 
	
		
			
				|  |  | +        border: true,
 | 
	
		
			
				|  |  | +        menuWidth: 120,
 | 
	
		
			
				|  |  | +        stripe: true,
 | 
	
		
			
				|  |  | +        index: true,
 | 
	
		
			
				|  |  | +        menu:false,
 | 
	
		
			
				|  |  | +        expandRowKeys:[],
 | 
	
		
			
				|  |  | +        rowKey:'id',
 | 
	
		
			
				|  |  | +        indexSlot: true,
 | 
	
		
			
				|  |  | +        showSummary: true,
 | 
	
		
			
				|  |  | +        summaryText: "合计",
 | 
	
		
			
				|  |  | +        sumColumnList: [
 | 
	
		
			
				|  |  | +          {
 | 
	
		
			
				|  |  | +            name: "amount",
 | 
	
		
			
				|  |  | +            type: "sum"
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  | +          {
 | 
	
		
			
				|  |  | +            name: "storageAmount",
 | 
	
		
			
				|  |  | +            type: "sum"
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  | +          {
 | 
	
		
			
				|  |  | +            name: "storageInQuantity",
 | 
	
		
			
				|  |  | +            type: "sum"
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  | +          {
 | 
	
		
			
				|  |  | +            name: "actualQuantity",
 | 
	
		
			
				|  |  | +            type: "sum"
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        ],
 | 
	
		
			
				|  |  | +        column: [
 | 
	
		
			
				|  |  | +          {
 | 
	
		
			
				|  |  | +            label: "产品",
 | 
	
		
			
				|  |  | +            prop: "cname",
 | 
	
		
			
				|  |  | +            width: '250px',
 | 
	
		
			
				|  |  | +            // overHidden: true
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  | +          {
 | 
	
		
			
				|  |  | +            label: "仓库",
 | 
	
		
			
				|  |  | +            prop: "storageId",
 | 
	
		
			
				|  |  | +            overHidden: true,
 | 
	
		
			
				|  |  | +            type: "select",
 | 
	
		
			
				|  |  | +            props: {
 | 
	
		
			
				|  |  | +              label: "cname",
 | 
	
		
			
				|  |  | +              value: "id"
 | 
	
		
			
				|  |  | +            },
 | 
	
		
			
				|  |  | +            dicData: []
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  | +          {
 | 
	
		
			
				|  |  | +            label: "数量",
 | 
	
		
			
				|  |  | +            prop: "storageInQuantity",
 | 
	
		
			
				|  |  | +            overHidden: true
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  | +          {
 | 
	
		
			
				|  |  | +            label: "单位",
 | 
	
		
			
				|  |  | +            prop: "unit",
 | 
	
		
			
				|  |  | +            type: "select",
 | 
	
		
			
				|  |  | +            props: {
 | 
	
		
			
				|  |  | +              label: "dictValue",
 | 
	
		
			
				|  |  | +              value: "dictValue"
 | 
	
		
			
				|  |  | +            },
 | 
	
		
			
				|  |  | +            dicData: [],
 | 
	
		
			
				|  |  | +            cell: true,
 | 
	
		
			
				|  |  | +            overHidden: true
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  | +          {
 | 
	
		
			
				|  |  | +            label: "单价",
 | 
	
		
			
				|  |  | +            prop: "price",
 | 
	
		
			
				|  |  | +            overHidden: true
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  | +          {
 | 
	
		
			
				|  |  | +            label: "金额",
 | 
	
		
			
				|  |  | +            prop: "amount",
 | 
	
		
			
				|  |  | +            overHidden: true
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  | +          {
 | 
	
		
			
				|  |  | +            label: "送货数量",
 | 
	
		
			
				|  |  | +            prop: "actualQuantity",
 | 
	
		
			
				|  |  | +            type: 'number',
 | 
	
		
			
				|  |  | +            controls: false,
 | 
	
		
			
				|  |  | +            cell: true,
 | 
	
		
			
				|  |  | +            overHidden: true
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  | +          {
 | 
	
		
			
				|  |  | +            label: "备注",
 | 
	
		
			
				|  |  | +            prop: "remarks",
 | 
	
		
			
				|  |  | +            cell: true,
 | 
	
		
			
				|  |  | +            overHidden: true
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  | +          {
 | 
	
		
			
				|  |  | +            label: "进价",
 | 
	
		
			
				|  |  | +            prop: "purchasePrice",
 | 
	
		
			
				|  |  | +            overHidden: true
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        ]
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  |        dialogVisible: false,
 | 
	
		
			
				|  |  |        badgeList: [],
 | 
	
		
			
				|  |  |        show: true,
 | 
	
	
		
			
				|  | @@ -191,6 +305,7 @@ export default {
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |            }]
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  | +      courierServices:[]
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    components: {
 | 
	
	
		
			
				|  | @@ -205,6 +320,9 @@ export default {
 | 
	
		
			
				|  |  |        this.findObject(this.option.column, "actualPaymentStatus").dicData = res.data.data;
 | 
	
		
			
				|  |  |        this.key++
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  | +    this.getWorkDicts("courier_services").then(res => {
 | 
	
		
			
				|  |  | +      this.courierServices = res.data.data
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    activated() {
 | 
	
		
			
				|  |  |      this.$refs.crud.refreshTable();
 | 
	
	
		
			
				|  | @@ -229,15 +347,32 @@ export default {
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    methods: {
 | 
	
		
			
				|  |  |      confirmShipment(){
 | 
	
		
			
				|  |  | -      delivery({
 | 
	
		
			
				|  |  | -        id:this.form.id,
 | 
	
		
			
				|  |  | -        courierNumber:this.form.courierNumber,
 | 
	
		
			
				|  |  | -        courierCorporation:this.form.courierCorporation
 | 
	
		
			
				|  |  | -      }).then(res=>{
 | 
	
		
			
				|  |  | -        this.$message.success("发货成功")
 | 
	
		
			
				|  |  | -        this.dialogVisible = false
 | 
	
		
			
				|  |  | -        this.onLoad(this.page)
 | 
	
		
			
				|  |  | -      })
 | 
	
		
			
				|  |  | +      if (!this.form.courierNumber){
 | 
	
		
			
				|  |  | +        this.$alert('是否继续发货', '未填写快递单号', {
 | 
	
		
			
				|  |  | +          confirmButtonText: '确定',
 | 
	
		
			
				|  |  | +          callback: action => {
 | 
	
		
			
				|  |  | +            delivery({
 | 
	
		
			
				|  |  | +              id:this.form.id,
 | 
	
		
			
				|  |  | +              courierNumber:this.form.courierNumber,
 | 
	
		
			
				|  |  | +              courierCorporation:this.form.courierCorporation
 | 
	
		
			
				|  |  | +            }).then(res=>{
 | 
	
		
			
				|  |  | +              this.$message.success("发货成功")
 | 
	
		
			
				|  |  | +              this.dialogVisible = false
 | 
	
		
			
				|  |  | +              this.onLoad(this.page)
 | 
	
		
			
				|  |  | +            })
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +      }else{
 | 
	
		
			
				|  |  | +        delivery({
 | 
	
		
			
				|  |  | +          id:this.form.id,
 | 
	
		
			
				|  |  | +          courierNumber:this.form.courierNumber,
 | 
	
		
			
				|  |  | +          courierCorporation:this.form.courierCorporation
 | 
	
		
			
				|  |  | +        }).then(res=>{
 | 
	
		
			
				|  |  | +          this.$message.success("发货成功")
 | 
	
		
			
				|  |  | +          this.dialogVisible = false
 | 
	
		
			
				|  |  | +          this.onLoad(this.page)
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      query(status) {
 | 
	
		
			
				|  |  |        this.search.status = status
 | 
	
	
		
			
				|  | @@ -253,6 +388,20 @@ export default {
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |        this.$refs.crud.init();
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    expandChange(row, expendList) {
 | 
	
		
			
				|  |  | +      this.getWorkDicts("unit").then(res => {
 | 
	
		
			
				|  |  | +        this.findObject(this.optionList.column, "unit").dicData = res.data.data;
 | 
	
		
			
				|  |  | +      });
 | 
	
		
			
				|  |  | +      getStoragelist().then(res => {
 | 
	
		
			
				|  |  | +        this.storageoptions = res.data;
 | 
	
		
			
				|  |  | +        this.findObject(this.optionList.column, "storageId").dicData = res.data;
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +      if (row){
 | 
	
		
			
				|  |  | +        getDetails({ id: row.id }).then(res=>{
 | 
	
		
			
				|  |  | +          row.orderItemsList = res.data.data.orderItemsList
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      searchCriteriaSwitch(type) {
 | 
	
		
			
				|  |  |        if (type) {
 | 
	
		
			
				|  |  |          this.option.height = this.option.height - 138;
 | 
	
	
		
			
				|  | @@ -278,6 +427,11 @@ export default {
 | 
	
		
			
				|  |  |        this.$store.commit("IN_PJXS_STATUS");
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      onLoad(page, params = {}) {
 | 
	
		
			
				|  |  | +      if (this.$refs.expandCrud){
 | 
	
		
			
				|  |  | +        this.dataList.forEach(item => {
 | 
	
		
			
				|  |  | +          this.$refs.crud.toggleRowExpansion(item, false);
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  |        statusStatisticsApi().then(res => {
 | 
	
		
			
				|  |  |          this.badgeList = [];
 | 
	
		
			
				|  |  |          this.badgeList.push({
 |