|  | @@ -7,8 +7,8 @@
 | 
	
		
			
				|  |  |                  </el-button>
 | 
	
		
			
				|  |  |              </div>
 | 
	
		
			
				|  |  |              <div class="add-customer-btn">
 | 
	
		
			
				|  |  | -                <el-button class="el-button--small-yh" style="margin-left: 6px;"
 | 
	
		
			
				|  |  | -                    type="primary" size="small" v-if="editButton" @click="confirmEditing">编 辑
 | 
	
		
			
				|  |  | +                <el-button class="el-button--small-yh" style="margin-left: 6px;" type="primary" size="small"
 | 
	
		
			
				|  |  | +                    v-if="editButton" @click="confirmEditing">编 辑
 | 
	
		
			
				|  |  |                  </el-button>
 | 
	
		
			
				|  |  |                  <el-button class="el-button--small-yh" v-else style="margin-left: 6px;" type="primary" size="small"
 | 
	
		
			
				|  |  |                      :disabled="isSaveBtn" @click="editCustomer">保 存
 | 
	
	
		
			
				|  | @@ -21,16 +21,15 @@
 | 
	
		
			
				|  |  |                      <tempalte slot="customerName" slot-scope="{ row }">
 | 
	
		
			
				|  |  |                          <search-query :datalist="customerData" :selectValue="form.customerName" :clearable="true"
 | 
	
		
			
				|  |  |                              :buttonIf="false" :filterable="true" :remote="true"
 | 
	
		
			
				|  |  | -                            :disabled="findObject(optionForm.column, 'customerName').disabled || form.businessSource == '外部销售' || isDisabledTask"
 | 
	
		
			
				|  |  | -                            placeholder="请选择货主" :forParameter="{ key: 'id', label: 'cname', value: 'cname' }"
 | 
	
		
			
				|  |  | -                            @corpFocus="KHgetListfun" @remoteMethod="KHgetListfun" @corpChange="KHcorpChange"
 | 
	
		
			
				|  |  | -                            @corpClear="KHClear">
 | 
	
		
			
				|  |  | +                            :disabled="!(form.status == 0 || form.status == 3)" placeholder="请选择货主"
 | 
	
		
			
				|  |  | +                            :forParameter="{ key: 'id', label: 'cname', value: 'cname' }" @corpFocus="KHgetListfun"
 | 
	
		
			
				|  |  | +                            @remoteMethod="KHgetListfun" @corpChange="KHcorpChange" @corpClear="KHClear">
 | 
	
		
			
				|  |  |                          </search-query>
 | 
	
		
			
				|  |  |                      </tempalte>
 | 
	
		
			
				|  |  |                      <template slot-scope="{row,index}" slot="contacts">
 | 
	
		
			
				|  |  |                          <el-select v-model="form.contacts" placeholder="请选择" size="small" style="width:60%" clearable
 | 
	
		
			
				|  |  |                              filterable allow-create default-first-option @change="contactsChange($event)"
 | 
	
		
			
				|  |  | -                            :disabled=isContacts>
 | 
	
		
			
				|  |  | +                            :disabled="!(form.status == 0 || form.status == 3)">
 | 
	
		
			
				|  |  |                              <el-option v-for="item in contactsOption" :key="item.id" :label="item.contacts"
 | 
	
		
			
				|  |  |                                  :value="item.contacts" />
 | 
	
		
			
				|  |  |                          </el-select>
 | 
	
	
		
			
				|  | @@ -39,7 +38,7 @@
 | 
	
		
			
				|  |  |                          <dic-select v-model="form.salerName" placeholder="业务员" key="id" label="name"
 | 
	
		
			
				|  |  |                              url="/blade-user/salerList" :filterable="true"
 | 
	
		
			
				|  |  |                              @selectChange="dicChange('salerName', $event)"
 | 
	
		
			
				|  |  | -                            :disabled="form.generateTask == '已生成' || form.businessSource == '外部销售' || isDisabledTask">
 | 
	
		
			
				|  |  | +                            :disabled="!(form.status == 0 || form.status == 3)">
 | 
	
		
			
				|  |  |                          </dic-select>
 | 
	
		
			
				|  |  |                      </tempalte>
 | 
	
		
			
				|  |  |                  </avue-form>
 | 
	
	
		
			
				|  | @@ -48,17 +47,18 @@
 | 
	
		
			
				|  |  |                  <el-tabs v-model="activeName" type="card">
 | 
	
		
			
				|  |  |                      <el-tab-pane label="销售明细" name="sale_detail">
 | 
	
		
			
				|  |  |                          <avue-crud :option="optionContacts" v-model="formContacts" ref="formContacts"
 | 
	
		
			
				|  |  | -                            :data="form.orderItemsList" :key="key" @row-save="rowSave" @row-update="rowUpdate"
 | 
	
		
			
				|  |  | +                            :data="form.planItemsList" :key="key" @row-save="rowSave" @row-update="rowUpdate"
 | 
	
		
			
				|  |  |                              @row-close="rowClose" :before-close="beforeClose" @selection-change="selectionContacts"
 | 
	
		
			
				|  |  |                              @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.6)"
 | 
	
		
			
				|  |  |                              @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.6)">
 | 
	
		
			
				|  |  |                              <template slot-scope="{scope,row}" slot="menuLeft">
 | 
	
		
			
				|  |  |                                  <el-button type="primary" icon="el-icon-plus" size="small"
 | 
	
		
			
				|  |  | -                                    :disabled=" form.billType == 1" @click="rowAdd(row, 1)">添加商品</el-button>
 | 
	
		
			
				|  |  | +                                    :disabled="!(form.status == 0 || form.status == 3)"
 | 
	
		
			
				|  |  | +                                    @click="rowAdd(row, 1)">添加商品</el-button>
 | 
	
		
			
				|  |  |                                  <el-button type="primary" icon="el-icon-printer" size="small"
 | 
	
		
			
				|  |  |                                      @click="handlePrint">打印</el-button>
 | 
	
		
			
				|  |  |                                  <el-button type="danger" plain size="small" @click="batchDelete"
 | 
	
		
			
				|  |  | -                                    :disabled="form.generateTask == '已生成' || form.businessSource == '外部销售' || form.billType == 1">一键删除</el-button>
 | 
	
		
			
				|  |  | +                                    :disabled="!(form.status == 0 || form.status == 3)">一键删除</el-button>
 | 
	
		
			
				|  |  |                                  <el-popover width="600" trigger="click">
 | 
	
		
			
				|  |  |                                      <avue-crud :data="inventoryData" :option="inventoryOption"></avue-crud>
 | 
	
		
			
				|  |  |                                      <el-button type="primary" plain size="small" slot="reference" @click="viewInventory"
 | 
	
	
		
			
				|  | @@ -92,7 +92,7 @@
 | 
	
		
			
				|  |  |                                  <span v-else>{{ row.dot }}</span>
 | 
	
		
			
				|  |  |                              </template>
 | 
	
		
			
				|  |  |                              <template slot="subTotalMoney" slot-scope="{ row }">{{ row.goodsNum * row.price
 | 
	
		
			
				|  |  | -                            }}</template>
 | 
	
		
			
				|  |  | +                                }}</template>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                              <template slot="remarks" slot-scope="{ row }">
 | 
	
		
			
				|  |  |                                  <el-input v-if="!mingxibaocun" size="small" v-model="row.remarks"
 | 
	
	
		
			
				|  | @@ -101,17 +101,17 @@
 | 
	
		
			
				|  |  |                              </template>
 | 
	
		
			
				|  |  |                              <template slot-scope="{type,size,row,index,disabled}" slot="menu">
 | 
	
		
			
				|  |  |                                  <el-button v-if="mingxibaocun" :size="size"
 | 
	
		
			
				|  |  | -                                    :disabled="disabled  || form.billType == 1" :type="type"
 | 
	
		
			
				|  |  | +                                    :disabled="!(form.status == 0 || form.status == 3)" :type="type"
 | 
	
		
			
				|  |  |                                      :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
 | 
	
		
			
				|  |  |                                      @click="hangeditBtn(row, index)">编辑
 | 
	
		
			
				|  |  |                                  </el-button>
 | 
	
		
			
				|  |  | -                                <el-button v-else :size="size" :disabled="disabled  || form.billType == 1"
 | 
	
		
			
				|  |  | +                                <el-button v-else :size="size" :disabled="!(form.status == 0 || form.status == 3)"
 | 
	
		
			
				|  |  |                                      :type="type" :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
 | 
	
		
			
				|  |  |                                      @click="hangbaocun(row, index)">保存
 | 
	
		
			
				|  |  |                                  </el-button>
 | 
	
		
			
				|  |  |                                  <el-button icon="el-icon-delete" :size="size"
 | 
	
		
			
				|  |  | -                                    :disabled="disabled || isDisabled || form.billType == 1" :type="type"
 | 
	
		
			
				|  |  | -                                    @click="rowDelBox(row, index, 'orderItemsList')">删除
 | 
	
		
			
				|  |  | +                                    :disabled="!(form.status == 0 || form.status == 3)" :type="type"
 | 
	
		
			
				|  |  | +                                    @click="rowDelBox(row, index, 'planItemsList')">删除
 | 
	
		
			
				|  |  |                                  </el-button>
 | 
	
		
			
				|  |  |                              </template>
 | 
	
		
			
				|  |  |                          </avue-crud>
 | 
	
	
		
			
				|  | @@ -214,7 +214,7 @@ import {
 | 
	
		
			
				|  |  |      submit,
 | 
	
		
			
				|  |  |      generateShipTask,
 | 
	
		
			
				|  |  |      tradingBox,
 | 
	
		
			
				|  |  | -    delOrderItem,
 | 
	
		
			
				|  |  | +    itemRemove,
 | 
	
		
			
				|  |  |      checkOrder,
 | 
	
		
			
				|  |  |      confirmRefund,
 | 
	
		
			
				|  |  |      revokeCheckOrder,
 | 
	
	
		
			
				|  | @@ -386,10 +386,10 @@ export default {
 | 
	
		
			
				|  |  |              disabled: false, // 表格按钮的禁用
 | 
	
		
			
				|  |  |              key: 0,
 | 
	
		
			
				|  |  |              form: {
 | 
	
		
			
				|  |  | -                orderItemsList: [],
 | 
	
		
			
				|  |  | -                paymentRecordsList: [],
 | 
	
		
			
				|  |  | +                planItemsList: [],
 | 
	
		
			
				|  |  |                  outboundRecordsList: [],
 | 
	
		
			
				|  |  | -                freight: 5,
 | 
	
		
			
				|  |  | +                status: 0,
 | 
	
		
			
				|  |  | +                bsType:'CP'
 | 
	
		
			
				|  |  |              },
 | 
	
		
			
				|  |  |              customerData: [], // 货主数据
 | 
	
		
			
				|  |  |              optionForm: {
 | 
	
	
		
			
				|  | @@ -928,7 +928,7 @@ export default {
 | 
	
		
			
				|  |  |              ])
 | 
	
		
			
				|  |  |          },
 | 
	
		
			
				|  |  |          synchronous(row) {
 | 
	
		
			
				|  |  | -            this.form.orderItemsList.forEach(e => {
 | 
	
		
			
				|  |  | +            this.form.planItemsList.forEach(e => {
 | 
	
		
			
				|  |  |                  if (e.goodsName == this.selectionMultilist[0].goodsName) {
 | 
	
		
			
				|  |  |                      e.inventory = row.balanceQuantity
 | 
	
		
			
				|  |  |                      e.dot = row.dot
 | 
	
	
		
			
				|  | @@ -938,7 +938,7 @@ export default {
 | 
	
		
			
				|  |  |          uploadAfter(res, done, loading, column) {
 | 
	
		
			
				|  |  |              if (Array.isArray(res)) {
 | 
	
		
			
				|  |  |                  if (res instanceof Array) {
 | 
	
		
			
				|  |  | -                    this.form.orderItemsList = this.form.orderItemsList.concat(res)
 | 
	
		
			
				|  |  | +                    this.form.planItemsList = this.form.planItemsList.concat(res)
 | 
	
		
			
				|  |  |                      res.forEach(item => {
 | 
	
		
			
				|  |  |                          dotList({
 | 
	
		
			
				|  |  |                              storageId: this.form.storageId,
 | 
	
	
		
			
				|  | @@ -1014,7 +1014,7 @@ export default {
 | 
	
		
			
				|  |  |                  id: this.detailData.id
 | 
	
		
			
				|  |  |              }).then(res => {
 | 
	
		
			
				|  |  |                  this.form = res.data.data
 | 
	
		
			
				|  |  | -                this.form.orderItemsList = res.data.data.orderItemsList
 | 
	
		
			
				|  |  | +                this.form.planItemsList = res.data.data.planItemsList
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  console.log(this.isEditButton, 'bianj')
 | 
	
		
			
				|  |  |                  console.log(this.isDisabledTask, 'chexiao')
 | 
	
	
		
			
				|  | @@ -1159,7 +1159,7 @@ export default {
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -                this.form.orderItemsList.push(obj)
 | 
	
		
			
				|  |  | +                this.form.planItemsList.push(obj)
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              this.mingxibaocun = false
 | 
	
		
			
				|  |  |              this.dialogVisible = false
 | 
	
	
		
			
				|  | @@ -1283,17 +1283,17 @@ export default {
 | 
	
		
			
				|  |  |              this.$refs["form"].validate((valid, done) => {
 | 
	
		
			
				|  |  |                  done();
 | 
	
		
			
				|  |  |                  if (valid) {
 | 
	
		
			
				|  |  | -                    if (this.form.orderItemsList.length == 0) {
 | 
	
		
			
				|  |  | +                    if (this.form.planItemsList.length == 0) {
 | 
	
		
			
				|  |  |                          this.$message.warning("请添加商品");
 | 
	
		
			
				|  |  |                          return
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  | -                    for (let i in this.form.orderItemsList) {
 | 
	
		
			
				|  |  | -                        this.form.orderItemsList[i].subTotalMoney = Number(this.form.orderItemsList[i].goodsNum * this.form.orderItemsList[i].price) ? Number(this.form.orderItemsList[i].goodsNum * this.form.orderItemsList[i].price).toFixed(2) : 0
 | 
	
		
			
				|  |  | -                        if (this.form.orderItemsList[i].goodsNum <= 0) {
 | 
	
		
			
				|  |  | +                    for (let i in this.form.planItemsList) {
 | 
	
		
			
				|  |  | +                        this.form.planItemsList[i].subTotalMoney = Number(this.form.planItemsList[i].goodsNum * this.form.planItemsList[i].price) ? Number(this.form.planItemsList[i].goodsNum * this.form.planItemsList[i].price).toFixed(2) : 0
 | 
	
		
			
				|  |  | +                        if (this.form.planItemsList[i].goodsNum <= 0) {
 | 
	
		
			
				|  |  |                              return this.$message.warning(`销售明细序号${Number(i) + 1}的数量不能为零`);
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  | -                        if (!this.form.orderItemsList[i].sendNum) {
 | 
	
		
			
				|  |  | -                            this.form.orderItemsList[i].sendNum = 0
 | 
	
		
			
				|  |  | +                        if (!this.form.planItemsList[i].sendNum) {
 | 
	
		
			
				|  |  | +                            this.form.planItemsList[i].sendNum = 0
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                      this.mingxibaocun = true
 | 
	
	
		
			
				|  | @@ -1376,8 +1376,8 @@ export default {
 | 
	
		
			
				|  |  |                  type: "warning"
 | 
	
		
			
				|  |  |              }).then(() => {
 | 
	
		
			
				|  |  |                  if (row.id) {
 | 
	
		
			
				|  |  | -                    delOrderItem({ ids: row.id }).then(res => {
 | 
	
		
			
				|  |  | -                        this.form.orderItemsList.splice(index, 1);
 | 
	
		
			
				|  |  | +                    itemRemove({ ids: row.id }).then(res => {
 | 
	
		
			
				|  |  | +                        this.form.planItemsList.splice(index, 1);
 | 
	
		
			
				|  |  |                          this.$message.success("操作成功!");
 | 
	
		
			
				|  |  |                      });
 | 
	
		
			
				|  |  |                  } else {
 | 
	
	
		
			
				|  | @@ -1402,7 +1402,7 @@ export default {
 | 
	
		
			
				|  |  |                  type: "warning"
 | 
	
		
			
				|  |  |              }).then(() => {
 | 
	
		
			
				|  |  |                  let multiList = this.selectionMultilist
 | 
	
		
			
				|  |  | -                let arr = this.form.orderItemsList
 | 
	
		
			
				|  |  | +                let arr = this.form.planItemsList
 | 
	
		
			
				|  |  |                  // 获取有id 的数据
 | 
	
		
			
				|  |  |                  const itemsWithId = multiList.filter(item => item.hasOwnProperty('id'));
 | 
	
		
			
				|  |  |                  let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
 | 
	
	
		
			
				|  | @@ -1416,7 +1416,7 @@ export default {
 | 
	
		
			
				|  |  |                  })
 | 
	
		
			
				|  |  |                  // 有id 的处理
 | 
	
		
			
				|  |  |                  if (itemsWithId.length != 0) {
 | 
	
		
			
				|  |  | -                    delOrderItem({ ids: arrIds.join(',') }).then(res => {
 | 
	
		
			
				|  |  | +                    itemRemove({ ids: arrIds.join(',') }).then(res => {
 | 
	
		
			
				|  |  |                          this.$message.success("操作成功!");
 | 
	
		
			
				|  |  |                      });
 | 
	
		
			
				|  |  |                  }
 |