Przeglądaj źródła

feat(saleManage/returnGoods): 新增原单价、仓库名称列并改造价输入控件

liujt 4 dni temu
rodzic
commit
0569e549eb

+ 14 - 1
src/views/saleManage/saleOrder/returnGoods/components/detailDialog.vue

@@ -380,11 +380,24 @@
           },
           {
             width: 100,
+            prop: 'deliverySinglePrice',
+            label: '原单价',
+            align: 'center'
+          },
+          {
+            width: 160,
             prop: 'singlePrice',
-            label: '单价',
+            label: '退货单价',
             slot: 'singlePrice',
             align: 'center'
           },
+          {
+            width: 200,
+            prop: 'warehouseName',
+            label: '仓库名称',
+            slot: 'warehouseName',
+            align: 'center'
+          },
           {
             width: 160,
             prop: 'taxRate',

+ 56 - 2
src/views/saleManage/saleOrder/returnGoods/components/inventoryTable.vue

@@ -172,6 +172,39 @@
         </el-form-item>
       </template>
 
+      <template v-slot:singlePrice="scope">
+        <el-form-item
+          :prop="'datasource.' + scope.$index + '.singlePrice'"
+          :rules="{
+            required: true,
+            message: '请输入单价',
+            trigger: 'change'
+          }"
+        >
+          <el-input
+            v-model="scope.row.singlePrice"
+            placeholder="请输入"
+            @input="changeNum(scope.row, scope.$index)"
+            type="number"
+          >
+            <!-- <template slot="append">元</template> -->
+          </el-input>
+        </el-form-item>
+      </template>
+
+      <template v-slot:warehouseId="{ row, $index }">
+        <el-form-item :prop="'datasource.' + $index + '.warehouseId'">
+          <el-select v-model="row.warehouseId" style="width: 100%" @change="changeWarehouse(row, $index)">
+            <el-option
+              :label="item.name"
+              :value="item.id"
+              v-for="(item, index) in warehouseOption"
+              :key="index"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </template>
+
       <template v-slot:totalCount="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -287,6 +320,7 @@
   import outboundDetailsDialog from '@/views/purchasingManage/purchaseOrder/invoice/components/outboundDetailsDialog.vue';
   import innertboundDetailsDialog from '@/views/purchasingManage/purchaseOrder/returnGoods/components/innerboundDetailsDialog.vue';
   import tabMixins from '@/mixins/tableColumnsMixin';
+  import { getWarehouseList } from '@/api/saleManage/saleorder';
   import { levelList, pricingWayList } from '@/enum/dict.js';
 
   export default {
@@ -329,6 +363,7 @@
         technicalDrawings: []
       };
       return {
+        warehouseOption: [],
         cacheKeyUrl: 'eos-saleManage-returnorder-inventoryTable',
         payAmount: '',
         outboundDetailsDialogFlag: false,
@@ -484,13 +519,26 @@
             },
             align: 'center'
           },
+          // {
+          //   width: 100,
+          //   prop: 'deliverySinglePrice',
+          //   label: '原单价',
+          //   align: 'center'
+          // },
           {
-            width: 100,
+            width: 160,
             prop: 'singlePrice',
-            label: '单价',
+            label: '退货单价',
             slot: 'singlePrice',
             align: 'center'
           },
+          {
+            width: 200,
+            prop: 'warehouseId',
+            label: '仓库名称',
+            slot: 'warehouseId',
+            align: 'center'
+          },
           {
             width: 160,
             prop: 'taxRate',
@@ -604,6 +652,9 @@
     created() {
       this.requestDict('产地');
       this.requestDict('商品价格类型');
+      getWarehouseList().then((res) => {
+        this.warehouseOption = res;
+      });
     },
     computed: {
       totalAmount() {
@@ -773,6 +824,9 @@
       orderNoChange(row, item) {
         row['orderId'] = item.orderId;
       },
+      changeWarehouse(row, index) {
+        row['warehouseName'] = this.warehouseOption.find((item) => item.id == row.warehouseId)?.name || '';
+      },
       //选择产品回调
       async changeParent(obj, idx) {
         console.log(obj, '9999');