chenrui 1 tahun lalu
induk
melakukan
d99759cf32

+ 39 - 33
src/views/allocationManagement/transferReturn/edit.vue

@@ -86,18 +86,22 @@
           :scroll="{ y: 300 }"
           :defaultLoadData="false"
           bordered>
+          <!-- 价格级别 -->
+          <template slot="priceLevel" slot-scope="text, record, index">
+            <span v-if="record.powerFlag!=0">{{ record.priceLevelDictValue }}</span>
+            <v-select
+              v-else
+              style="width:90%;"
+              size="small"
+              code="PRICE_LEVEL"
+              v-model="record.priceLevel"
+              allowClear
+              placeholder="请选择价格级别"
+              @change="e => handlePriceLevel(e,index)"></v-select>
+          </template>
           <!-- 退货单价 -->
           <template slot="returnPrice" slot-scope="text, record">
-            <div @dblclick.stop>
-              <a-input-number
-                size="small"
-                v-model="record.productPrice"
-                :precision="2"
-                :min="0"
-                :max="99999999"
-                placeholder="请输入"
-                style="width: 100%;" />
-            </div>
+            <span>{{ record.productPrice }}</span>
           </template>
           <!-- 退货数量 -->
           <template slot="returnQty" slot-scope="text, record">
@@ -176,18 +180,6 @@
           :scroll="{ y: 300 }"
           :defaultLoadData="false"
           bordered>
-          <!-- 退货单价 -->
-          <template slot="returnPrice" slot-scope="text, record">
-            <a-input-number
-              size="small"
-              v-model="record.price"
-              :precision="2"
-              :min="0"
-              :max="99999999"
-              @blur="e => priceChange(e.target.value, record)"
-              placeholder="请输入"
-              style="width: 100%;" />
-          </template>
           <!-- 退货数量 -->
           <template slot="returnQty" slot-scope="text, record">
             <a-input-number
@@ -286,19 +278,25 @@ export default {
       loading: false,
       chooseDisabled: false, //  查询、重置按钮是否可操作
       advanced: false, // 高级搜索 展开/关闭
+      dealerLevel: '',
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        const dealerLevel = this.dealerLevel == 'OTHER' ? undefined : this.dealerLevel
-        const warehouseSn = this.basicInfoData.warehouseSn
-        const dealerSnInfo = this.dealerLevel != 'OTHER' ? this.basicInfoData.dealerEntity.dealerSn : undefined
-        const ajaxName = _this.$route.params.targetType === 'DEALER' ? queryStockProductPage : stockQueryStockProductPage
-        return ajaxName(Object.assign(parameter, this.queryParam, { dealerLevel: dealerLevel == 0 ? '' : dealerLevel, warehouseSn: warehouseSn, dealerSn: dealerSnInfo })).then(res => {
+        const warehouseSn = _this.basicInfoData.warehouseSn
+        const dealerLevel = _this.dealerLevel == 'OTHER' ? undefined : _this.dealerLevel
+        const dealerSnInfo = _this.dealerLevel != 'OTHER' ? _this.basicInfoData.dealerEntity.dealerSn : undefined
+        const ajaxName = _this.basicInfoData.targetType === 'DEALER' ? queryStockProductPage : stockQueryStockProductPage
+        return ajaxName(Object.assign(parameter, this.queryParam, { dealerLevel: dealerLevel === '0' ? '' : dealerLevel, warehouseSn: warehouseSn, dealerSn: dealerSnInfo })).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
             data.list[i].qty = 1
+            if (_this.dealerLevel === 'DEALER') {
+              data.list[i].productPrice = data.list[i].priceLevel === 'PROVINCE' ? data.list[i].provincePrice : data.list[i].priceLevel === 'CITY' ? data.list[i].cityPrice : data.list[i].specialPrice
+            } else {
+              data.list[i].productPrice = data.list[i].lastStockCost
+            }
           }
           this.loadDataSource = data.list || []
           this.disabled = false
@@ -307,7 +305,6 @@ export default {
       },
       loadDataSource: [],
       localDataSource: [],
-      dealerLevel: '',
       allocateReturnSn: '',
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
@@ -336,18 +333,19 @@ export default {
   },
   computed: {
     columns () {
+      const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', align: 'left', width: '29%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         // { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货单价', scopedSlots: { customRender: 'returnPrice' }, width: '10%', align: 'right' },
+        { title: '退货单价', dataIndex: 'productPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '退货数量', scopedSlots: { customRender: 'returnQty' }, width: '10%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
-      if (this.$route.params.targetType === 'DEALER') {
-        arr.splice(4, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } })
+      if (_this.basicInfoData && _this.basicInfoData.targetType === 'DEALER') {
+        arr.splice(4, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '6%', align: 'center', scopedSlots: { customRender: 'priceLevel' } })
       }
       return arr
     },
@@ -358,7 +356,7 @@ export default {
         { title: '产品编码', dataIndex: 'product.code', width: '10%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'product.name', align: 'left', width: '29%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '单位', dataIndex: 'product.unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货单价', scopedSlots: { customRender: 'returnPrice' }, width: '10%', align: 'right' },
+        { title: '退货单价', dataIndex: 'price', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '退货数量', scopedSlots: { customRender: 'returnQty' }, width: '10%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
@@ -369,6 +367,10 @@ export default {
     }
   },
   methods: {
+    // 价格等级
+    handlePriceLevel (val, pos) {
+      this.loadDataSource[pos].productPrice = val == 'PROVINCE' ? this.loadDataSource[pos].provincePrice : val == 'CITY' ? this.loadDataSource[pos].cityPrice : this.loadDataSource[pos].specialPrice
+    },
     // 修改备注
     handleEditRemark (flag) {
       const _this = this
@@ -446,6 +448,10 @@ export default {
     },
     //  添加/编辑
     handleAdd (row, isEdit, isRefresh) {
+      if (this.dealerLevel === 'DEALER' && !row.priceLevel) {
+        this.$message.error('请先选择产品价格级别')
+        return
+      }
       const params = {
         allocateReturnSn: this.allocateReturnSn,
         productSn: row.productSn,
@@ -540,6 +546,7 @@ export default {
       allocateReturnQueryBySn({ allocateReturnSn: this.allocateReturnSn }).then(res => {
         if (res.status == 200) {
           this.basicInfoData = res.data
+          this.dealerLevel = res.data.dealerLevel || '0'
           if (this.basicInfoData.costTypeSn) {
             this.allocateTypeVal = [this.basicInfoData.costTypeSn, this.basicInfoData.allocateSortSn, this.basicInfoData.allocateReturnTypeSn]
           }
@@ -576,7 +583,6 @@ export default {
       this.$refs.chooseTable.refresh()
     },
     pageInit () {
-      this.dealerLevel = this.$route.params.dealerLevel
       this.allocateReturnSn = this.$route.params.sn
       this.refashPage()
     }

+ 157 - 149
src/views/allocationManagement/transferReturn/editGrp.vue

@@ -52,58 +52,58 @@
       </a-card>
       <!-- 选择产品 -->
       <a-card size="small" title="选择产品" :bordered="false" class="editGrap-cont">
-            <!-- 筛选条件 -->
-            <div class="table-page-search-wrapper" style="display:flex;align-items: center;">
-              <div style="margin-bottom: 10px;padding-right: 20px;">
-                <a-button
-                  type="primary"
-                  class="button-info"
-                  id="salesEdit-plDel-btn"
-                  @click="handleBatchAdd">批量添加</a-button>
-                  <span>已选{{ selectTotal }}项</span>
-              </div>
-              <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-                <a-row :gutter="15">
-                  <a-col :md="6" :sm="24">
-                    <a-form-item label="调拨单号" prop="allocateNo">
-                      <a-input id="editGrap-allocateNo" v-model.trim="queryParam.allocateNo" placeholder="请输入调拨单号" allowClear />
-                    </a-form-item>
-                  </a-col>
-                  <a-col :md="6" :sm="24">
-                    <a-form-item label="产品编码" prop="productCode">
-                      <a-input id="editGrap-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
-                    </a-form-item>
-                  </a-col>
-                  <a-col :md="6" :sm="24">
-                    <a-form-item label="产品名称" prop="productName">
-                      <a-input id="editGrap-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
-                    </a-form-item>
-                  </a-col>
-                  <a-col :md="4" :sm="24" style="margin-bottom: 10px;">
-                    <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutList-refresh">查询</a-button>
-                    <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
-                  </a-col>
-                </a-row>
-              </a-form>
-            </div>
-            <!-- 列表 -->
-            <s-table
-              class="sTable"
-              ref="table"
-              size="small"
-              index="0"
-              tableId="table1"
-              :rowKey="(record) => record.allocateNo +'-'+ record.productSn"
-              :columns="columns"
-              :customRow="handleClickRow"
-              :data="loadData"
-              :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: !record.refundableQty } }) }"
-              @rowSelection="rowSelectionFun"
-              :scroll="{ y: 300 }"
-              :defaultLoadData="false"
-              bordered>
-              <!-- 退货单价 -->
-              <template slot="returnPrice" slot-scope="text, record">
+        <!-- 筛选条件 -->
+        <div class="table-page-search-wrapper" style="display:flex;align-items: center;">
+          <div style="margin-bottom: 10px;padding-right: 20px;">
+            <a-button
+              type="primary"
+              class="button-info"
+              id="salesEdit-plDel-btn"
+              @click="handleBatchAdd">批量添加</a-button>
+            <span>已选{{ selectTotal }}项</span>
+          </div>
+          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+            <a-row :gutter="15">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="调拨单号" prop="allocateNo">
+                  <a-input id="editGrap-allocateNo" v-model.trim="queryParam.allocateNo" placeholder="请输入调拨单号" allowClear />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品编码" prop="productCode">
+                  <a-input id="editGrap-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品名称" prop="productName">
+                  <a-input id="editGrap-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24" style="margin-bottom: 10px;">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutList-refresh">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          index="0"
+          tableId="table1"
+          :rowKey="(record) => record.allocateNo +'-'+ record.productSn"
+          :columns="columns"
+          :customRow="handleClickRow"
+          :data="loadData"
+          :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: !record.refundableQty } }) }"
+          @rowSelection="rowSelectionFun"
+          :scroll="{ y: 300 }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 退货单价 -->
+          <!-- <template slot="returnPrice" slot-scope="text, record">
                 <div @dblclick.stop>
                   <a-input-number
                     size="small"
@@ -114,89 +114,101 @@
                     placeholder="请输入"
                     style="width: 100%;" />
                 </div>
-              </template>
-              <!-- 操作 -->
-              <template slot="action" slot-scope="text, record">
-                <a-button
-                  size="small"
-                  v-if="record.refundableQty"
-                  type="link"
-                  class="button-primary"
-                  @click="handleAdd(record)"
-                  id="editGrap-add-btn">添加</a-button>
-                <span v-else>--</span>
-              </template>
-            </s-table>
+              </template> -->
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              v-if="record.refundableQty"
+              type="link"
+              class="button-primary"
+              @click="handleAdd(record)"
+              id="editGrap-add-btn">添加</a-button>
+            <span v-else>--</span>
+          </template>
+        </s-table>
       </a-card>
       <!-- 已选产品 -->
       <a-card size="small" title="已选产品" :bordered="false" class="editGrap-cont">
-            <!-- 总计 -->
-            <a-alert type="info" style="margin-bottom:10px">
-              <div slot="message">
-                退货总数量:<strong>{{ (basicInfoData&&(basicInfoData.totalQty || basicInfoData.totalQty==0)) ? basicInfoData.totalQty : '--' }}</strong> ;
-                <span>退货总金额:<strong>{{ (basicInfoData&&(basicInfoData.totalPrice || basicInfoData.totalPrice==0)) ? toThousands(basicInfoData.totalPrice) : '--' }}</strong>;</span>
-              </div>
-            </a-alert>
-            <!-- 筛选条件 -->
-            <a-row :gutter="15">
-              <a-col :span="17">
-                <div class="table-page-search-wrapper">
-                  <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
-                    <a-row :gutter="15">
-                      <a-col :md="9" :sm="24">
-                        <a-form-item label="产品编码" prop="productCode">
-                          <a-input id="editGrap-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
-                        </a-form-item>
-                      </a-col>
-                      <a-col :md="9" :sm="24">
-                        <a-form-item label="产品名称" prop="productName">
-                          <a-input id="editGrap-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
-                        </a-form-item>
-                      </a-col>
-                      <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                        <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="storeTransferOutList-refresh">查询</a-button>
-                        <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="storeTransferOutList-reset">重置</a-button>
-                      </a-col>
-                    </a-row>
-                  </a-form>
-                </div>
-              </a-col>
-              <a-col :span="7" style="text-align: right;">
-                <!-- <a-button size="small" id="editGrap-import-btn" @click="openGuideModal=true">导入产品</a-button> -->
-                <!-- <a-button size="small" type="danger" style="margin-left: 5px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button> -->
-              </a-col>
-            </a-row>
-            <!-- 列表 -->
-            <s-table
-              class="sTable"
-              ref="chooseTable"
+        <!-- 总计 -->
+        <a-alert type="info" style="margin-bottom:10px">
+          <div slot="message">
+            退货总数量:<strong>{{ (basicInfoData&&(basicInfoData.totalQty || basicInfoData.totalQty==0)) ? basicInfoData.totalQty : '--' }}</strong> ;
+            <span>退货总金额:<strong>{{ (basicInfoData&&(basicInfoData.totalPrice || basicInfoData.totalPrice==0)) ? toThousands(basicInfoData.totalPrice) : '--' }}</strong>;</span>
+          </div>
+        </a-alert>
+        <!-- 筛选条件 -->
+        <a-row :gutter="15">
+          <a-col :span="17">
+            <div class="table-page-search-wrapper">
+              <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
+                <a-row :gutter="15">
+                  <a-col :md="9" :sm="24">
+                    <a-form-item label="产品编码" prop="productCode">
+                      <a-input id="editGrap-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="9" :sm="24">
+                    <a-form-item label="产品名称" prop="productName">
+                      <a-input id="editGrap-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+                    <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="storeTransferOutList-refresh">查询</a-button>
+                    <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="storeTransferOutList-reset">重置</a-button>
+                  </a-col>
+                </a-row>
+              </a-form>
+            </div>
+          </a-col>
+          <a-col :span="7" style="text-align: right;">
+            <!-- <a-button size="small" id="editGrap-import-btn" @click="openGuideModal=true">导入产品</a-button> -->
+            <!-- <a-button size="small" type="danger" style="margin-left: 5px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button> -->
+          </a-col>
+        </a-row>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="chooseTable"
+          size="small"
+          index="1"
+          tableId="table2"
+          :rowKey="(record) => record.no"
+          rowKeyName="no"
+          :columns="chooseColumns"
+          :data="chooseLoadData"
+          :scroll="{ y: 300 }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 退货单价 -->
+          <!-- <template slot="returnPrice" slot-scope="text, record">
+            <a-input-number
+              size="small"
+              v-model="record.price"
+              @blur="e => priceChange(e.target.value, record)"
+              :precision="2"
+              :min="0"
+              :max="99999999"
+              placeholder="请输入"
+              style="width: 100%;" />
+          </template> -->
+          <!-- 退货数量 -->
+          <template slot="returnQty" slot-scope="text, record,index">
+            <a-input-number
               size="small"
-              index="1"
-              tableId="table2"
-              :rowKey="(record) => record.no"
-              rowKeyName="no"
-              :columns="chooseColumns"
-              :data="chooseLoadData"
-              :scroll="{ y: 300 }"
-              :defaultLoadData="false"
-              bordered>
-              <!-- 退货单价 -->
-              <template slot="returnPrice" slot-scope="text, record">
-                <a-input-number
-                  size="small"
-                  v-model="record.price"
-                  @blur="e => priceChange(e.target.value, record)"
-                  :precision="2"
-                  :min="0"
-                  :max="99999999"
-                  placeholder="请输入"
-                  style="width: 100%;" />
-              </template>
-              <!-- 操作 -->
-              <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="editGrap-del-btn">删除</a-button>
-              </template>
-            </s-table>
+              v-model="record.returnQty"
+              @blur="e => returnQtyChange(e.target.value, record,index)"
+              :precision="0"
+              :min="0"
+              :max="record.returnQty"
+              placeholder="请输入"
+              style="width: 100%;" />
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="editGrap-del-btn">删除</a-button>
+          </template>
+        </s-table>
       </a-card>
     <!--</a-spin>-->
     </div>
@@ -278,15 +290,13 @@ export default {
       loading: false,
       chooseDisabled: false, //  查询、重置按钮是否可操作
       advanced: false, // 高级搜索 展开/关闭
-      targetType: '',
       allocateReturnSn: '',
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        const warehouseSn = this.basicInfoData.warehouseSn
-        const targetSn =  this.basicInfoData.targetSn
+        const targetSn = this.basicInfoData.targetSn
         const allocateNo = this.queryParam.allocateNo
-        const otherParams = { allocateBill: { targetType: this.targetType , targetSn:targetSn, allocateNo: allocateNo } }
+        const otherParams = { allocateBill: { targetType: this.basicInfoData.targetType, targetSn: targetSn, allocateNo: allocateNo } }
         return allocDetailQueryPageForReturn(Object.assign(parameter, this.queryParam, otherParams)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -338,11 +348,11 @@ export default {
         { title: '单位', dataIndex: 'productUnit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '调拨数量', dataIndex: 'qty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '剩余可退数量', dataIndex: 'refundableQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货单价', scopedSlots: { customRender: 'returnPrice' }, width: '10%', align: 'center' },
+        { title: '退货单价', dataIndex: 'returnPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '退货数量', dataIndex: 'returnQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
-        arr.splice(5,0,{ title: '调拨单价', dataIndex: 'price', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      arr.splice(5, 0, { title: '调拨单价', dataIndex: 'price', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       return arr
     },
     chooseColumns () {
@@ -353,11 +363,11 @@ export default {
         { title: '产品编码', dataIndex: 'product.code', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'product.name', align: 'center', width: '29%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '单位', dataIndex: 'product.unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货单价', scopedSlots: { customRender: 'returnPrice' }, width: '10%', align: 'center' },
-        { title: '退货数量', dataIndex: 'returnQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货单价', dataIndex: 'price', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '退货数量', scopedSlots: { customRender: 'returnQty' }, width: '10%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
-        arr.splice(7,0,{ title: '退货金额', dataIndex: 'totalReturnPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') }})
+      arr.splice(7, 0, { title: '退货金额', dataIndex: 'totalReturnPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       return arr
     }
   },
@@ -434,7 +444,7 @@ export default {
       _this.editRemark = false
     },
     // 修改仓库
-    updateWarehouse(warehouseSn){
+    updateWarehouse (warehouseSn) {
       this.basicInfoData.warehouseSn = warehouseSn
       this.handleEditRemark()
     },
@@ -503,7 +513,8 @@ export default {
         productSn: row.productSn,
         price: isEdit ? row.price : row.returnPrice,
         allocateNo: row.allocateNo,
-        allocateSn: row.allocateSn
+        allocateSn: row.allocateSn,
+        returnableQty: row.returnQty
       }
       const fun = isEdit ? allocReturnDetailUpdate : allocReturnDetailInsert
       if (isEdit) { // 编辑
@@ -605,12 +616,10 @@ export default {
     handleBack () {
       this.$router.push({ name: 'transferReturnList', query: { closeLastOldTab: true } })
     },
-    // 已选产品 退货单价  change
-    priceChange (val, record) {
-      //  光标移出,值发生改变再调用编辑接口
-      if (Number(val) != Number(record.oldPrice)) {
-        this.handleAdd(record, true, 'noRefresh')
-      }
+    // 已选产品 退货数量  change
+    returnQtyChange (val, row, pos) {
+      this.localDataSource[pos].returnQty = Number(val)
+      this.handleAdd(row, true, 'noRefresh')
     },
     // 刷新当前页面
     refashPage () {
@@ -619,7 +628,6 @@ export default {
       this.$refs.chooseTable.refresh()
     },
     pageInit () {
-      this.targetType = this.$route.params.targetType
       this.allocateReturnSn = this.$route.params.sn
       this.getDetail()
       this.chooseResetSearchForm()

+ 1 - 1
src/views/allocationManagement/transferReturn/list.vue

@@ -317,7 +317,7 @@ export default {
     },
     //  编辑
     handleEdit (row) {
-      this.$router.push({ name: row.grabFlag == 1 ? 'transferReturnGrpEdit' : 'transferReturnEdit', params: { sn: row.allocateReturnSn, targetType: row.targetType, dealerLevel: row.dealerLevel || '0' } })
+      this.$router.push({ name: row.grabFlag == 1 ? 'transferReturnGrpEdit' : 'transferReturnEdit', params: { sn: row.allocateReturnSn } })
     },
     // 品检
     handleCheck (row) {