|
@@ -1,42 +1,24 @@
|
|
|
<template>
|
|
|
<el-row :gutter="10">
|
|
|
- <!-- <p>{{ sitem }}</p> -->
|
|
|
- <p>{{ id }}--id</p>
|
|
|
- <p>isDetail--{{ isDetail }}</p>
|
|
|
- <p>showModel--{{ showModel }}</p>
|
|
|
- <p>{{ showModelThis }}--showModelThis</p>
|
|
|
<el-col :span="24">
|
|
|
<el-form
|
|
|
:model="ruleForm"
|
|
|
status-icon
|
|
|
:rules="rulesThis"
|
|
|
ref="ruleForm"
|
|
|
- label-width="110px"
|
|
|
+ label-width="95px"
|
|
|
class="demo-ruleForm"
|
|
|
>
|
|
|
- <el-form-item
|
|
|
- label="退货原因"
|
|
|
- prop="errorCode"
|
|
|
- v-if="id === 'add' || isDetail"
|
|
|
- >
|
|
|
- <el-select
|
|
|
- :disabled="isDetail"
|
|
|
- style="width: 100%"
|
|
|
- v-model="ruleForm.errorCode"
|
|
|
- placeholder="退换货原因"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in reason_options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <el-form-item label="退换货原因" prop="errorCode">
|
|
|
+ <abnormal-cause
|
|
|
+ :value="ruleForm.errorCode"
|
|
|
+ :placeholder="'退换货原因'"
|
|
|
+ :type="'5'"
|
|
|
+ @searchChange="errorCode_change"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="退货备注" prop="remark">
|
|
|
- <!-- <el-input v-model="ruleForm.tel" :disabled="isDetail"></el-input> -->
|
|
|
<el-input
|
|
|
:disabled="isDetail"
|
|
|
type="textarea"
|
|
@@ -46,7 +28,7 @@
|
|
|
v-model="ruleForm.remark"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="仓库信息">
|
|
|
+ <el-form-item label="仓库信息" :size="'mini'" required>
|
|
|
<el-table
|
|
|
:data="tableForm.product_go"
|
|
|
border
|
|
@@ -54,93 +36,31 @@
|
|
|
row-key="key"
|
|
|
v-if="!isDetail"
|
|
|
>
|
|
|
- <el-table-column label="商品总数量" width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.num }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="已发货数量" width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.send_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>
|
|
|
- {{ scope.row.send_num }}
|
|
|
- </p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="未发货数量" width="100">
|
|
|
+ <el-table-column
|
|
|
+ label="仓库名称"
|
|
|
+ min-width="300"
|
|
|
+ show-overflow-tooltip
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.wsend_num }}</p>
|
|
|
- </el-form-item>
|
|
|
+ {{ scope.row.wsm_supplier }}{{ scope.row.wsm_name }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="退货数量">
|
|
|
+ <el-table-column label="下单总数量" width="100" prop="num" />
|
|
|
+ <el-table-column label="已发货数量" width="100" prop="send_num" />
|
|
|
+ <el-table-column label="未发货数量" width="100" prop="wsend_num" />
|
|
|
+ <el-table-column label="退货数量" width="120">
|
|
|
<template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.return_num'" -->
|
|
|
- <el-form-item
|
|
|
- :style="!scope.row.edit ? 'margin:0' : ''"
|
|
|
- :rules="{
|
|
|
- required: true,
|
|
|
- message: '退货数量不能为空',
|
|
|
- trigger: 'blur',
|
|
|
- }"
|
|
|
- >
|
|
|
+ <el-form-item style="margin: 0">
|
|
|
<el-input
|
|
|
:disabled="!scope.row.edit"
|
|
|
- v-model="ruleForm.return_num"
|
|
|
+ :size="'mini'"
|
|
|
+ v-model="scope.row.return_num"
|
|
|
></el-input>
|
|
|
- <!-- <p></p> -->
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="采购订单编号" width="180">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.orderCode }}</p>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="仓库名称" width="150">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsm_name'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.wsm_name }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="仓库供应商" width="220">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.wsm_supplier }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="仓库编码" width="200">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.wsm_code }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <!-- <el-table-column label="仓库供应商">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.wsm_supplierNo }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column> -->
|
|
|
|
|
|
- <el-table-column fixed="right" label="操作" width="80">
|
|
|
+ <el-table-column fixed="right" label="操作" width="50">
|
|
|
<template slot-scope="scope">
|
|
|
<el-tooltip
|
|
|
effect="dark"
|
|
@@ -150,7 +70,7 @@
|
|
|
>
|
|
|
<i
|
|
|
class="el-icon-edit tb-icon"
|
|
|
- @click="editRow(scope.$index, 'return')"
|
|
|
+ @click="editRow(scope.$index, 0)"
|
|
|
></i>
|
|
|
</el-tooltip>
|
|
|
|
|
@@ -162,238 +82,50 @@
|
|
|
>
|
|
|
<i
|
|
|
class="el-icon-circle-check tb-icon"
|
|
|
- @click="checkRow(scope.$index, 'return')"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
-
|
|
|
- <el-tooltip effect="dark" content="重置" placement="top">
|
|
|
- <i
|
|
|
- v-if="scope.row.edit"
|
|
|
- class="el-icon-refresh-left tb-icon"
|
|
|
- @click="resetRow(scope.$index)"
|
|
|
+ @click="checkRow(scope.$index, 0)"
|
|
|
></i>
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
-
|
|
|
- <el-table
|
|
|
- disabled="true"
|
|
|
- :data="tableForm.product_go"
|
|
|
- border
|
|
|
- :size="'mini'"
|
|
|
- row-key="key"
|
|
|
- v-if="isDetail"
|
|
|
- >
|
|
|
- <el-table-column label="退货单编号" width="180" disabled="true">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p :disabled="true">{{ scope.row.returnCode }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="采购订单编号" width="180">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.orderCode }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column label="退货数量" width="80">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.send_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>
|
|
|
- {{ scope.row.return_num }}
|
|
|
- </p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="发货数量" width="80">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.total_num }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="采购编码" width="180">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.orderCode }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="仓库名称" width="150">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsm_name'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.wsm_name }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="仓库编码" width="200">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.wsm_code }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="仓库名称" width="220">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.wsm_name }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="仓库所属公司" width="200">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.wsm_supplier }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="仓库所属公司编码" width="200">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.wsm_supplierNo }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- <el-table-column fixed="right" label="操作" width="80">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-tooltip
|
|
|
- effect="dark"
|
|
|
- content="编辑"
|
|
|
- v-if="!scope.row.edit"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="el-icon-edit tb-icon"
|
|
|
- @click="editRow(scope.$index, 'return')"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
-
|
|
|
- <el-tooltip
|
|
|
- effect="dark"
|
|
|
- content="保存"
|
|
|
- v-if="scope.row.edit"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="el-icon-circle-check tb-icon"
|
|
|
- @click="checkRow(scope.$index, 'return')"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
-
|
|
|
- <el-tooltip effect="dark" content="重置" placement="top">
|
|
|
- <i
|
|
|
- v-if="scope.row.edit"
|
|
|
- class="el-icon-refresh-left tb-icon"
|
|
|
- @click="resetRow(scope.$index)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- </template>
|
|
|
- </el-table-column> -->
|
|
|
- </el-table>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="收货信息">
|
|
|
+ <el-form-item label="收货信息" :size="'mini'" required>
|
|
|
<el-table
|
|
|
:data="tableForm.get_product_go"
|
|
|
border
|
|
|
:size="'mini'"
|
|
|
row-key="key"
|
|
|
- v-if="!isDetail"
|
|
|
>
|
|
|
- <el-table-column label="收货总数量">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.send_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>
|
|
|
- {{ scope.row.receipt_quantity }}
|
|
|
- </p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="已发货数量">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.send_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>
|
|
|
- {{ scope.row.send_num }}
|
|
|
- </p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="未发货数量">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.wsend_num }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="退货数量">
|
|
|
+ <el-table-column
|
|
|
+ label="收货人-联系电话-地址"
|
|
|
+ min-width="300"
|
|
|
+ show-overflow-tooltip
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.return_num'" -->
|
|
|
- <el-form-item
|
|
|
- :style="!scope.row.edit ? 'margin:0' : ''"
|
|
|
- :rules="{
|
|
|
- required: true,
|
|
|
- message: '退货数量不能为空',
|
|
|
- trigger: 'blur',
|
|
|
- }"
|
|
|
- >
|
|
|
+ {{ scope.row.contactor }}-{{ scope.row.mobile }}-{{
|
|
|
+ scope.row.addr_info
|
|
|
+ }}{{ scope.row.addr }}
|
|
|
+ </template></el-table-column
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ label="收货总数量"
|
|
|
+ prop="receipt_quantity"
|
|
|
+ width="100"
|
|
|
+ />
|
|
|
+ <el-table-column label="已发货数量" prop="send_num" width="100" />
|
|
|
+ <el-table-column label="未发货数量" prop="wsend_num" width="100" />
|
|
|
+ <el-table-column label="退货数量" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-form-item style="margin: 0" :size="'mini'">
|
|
|
<el-input
|
|
|
:disabled="!scope.row.edit"
|
|
|
- v-model="ruleForm.get_return_num"
|
|
|
+ v-model="scope.row.return_num"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="采购编码" width="200">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.send_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>
|
|
|
- {{ scope.row.orderCode }}
|
|
|
- </p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- <el-table-column label="仓库供应商">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.wsm_supplierNo }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column> -->
|
|
|
- <el-table-column label="收货联系人 ">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsm_name'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.contactor }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="联系方式" width="120">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsm_name'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.mobile }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
|
|
|
- <el-table-column fixed="right" label="操作" width="80">
|
|
|
+ <el-table-column fixed="right" label="操作" width="50">
|
|
|
<template slot-scope="scope">
|
|
|
<el-tooltip
|
|
|
effect="dark"
|
|
@@ -403,7 +135,7 @@
|
|
|
>
|
|
|
<i
|
|
|
class="el-icon-edit tb-icon"
|
|
|
- @click="editRow(scope.$index, 'get')"
|
|
|
+ @click="editRow(scope.$index, 1)"
|
|
|
></i>
|
|
|
</el-tooltip>
|
|
|
|
|
@@ -415,117 +147,9 @@
|
|
|
>
|
|
|
<i
|
|
|
class="el-icon-circle-check tb-icon"
|
|
|
- @click="checkRow(scope.$index, 'get')"
|
|
|
+ @click="checkRow(scope.$index, 1)"
|
|
|
></i>
|
|
|
</el-tooltip>
|
|
|
-
|
|
|
- <el-tooltip effect="dark" content="重置" placement="top">
|
|
|
- <i
|
|
|
- v-if="scope.row.edit"
|
|
|
- class="el-icon-refresh-left tb-icon"
|
|
|
- @click="resetRow(scope.$index)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
-
|
|
|
- <el-table
|
|
|
- :data="tableForm.get_product_go"
|
|
|
- border
|
|
|
- :size="'mini'"
|
|
|
- row-key="key"
|
|
|
- v-if="isDetail"
|
|
|
- >
|
|
|
- <el-table-column label="退货单编号" width="180">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.send_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>
|
|
|
- {{ scope.row.returnCode }}
|
|
|
- </p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="采购订单编号" width="180">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.send_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>
|
|
|
- {{ scope.row.orderCode }}
|
|
|
- </p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="收货数量">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.send_num }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="退货数量">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.return_num }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="联系人 ">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsm_name'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.contactor }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="联系方式" width="120">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsm_name'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.mobile }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="物流费" width="200">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.send_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>
|
|
|
- {{ scope.row.post_fee }}
|
|
|
- </p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- <el-table-column label="收货时间" width="200">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>
|
|
|
- {{ scope.row.addive_time }}
|
|
|
- </p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column> -->
|
|
|
- <el-table-column label="客户编码" width="200">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.send_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>
|
|
|
- {{ scope.row.customer_code }}
|
|
|
- </p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="客户名称" min-width="250">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.send_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>
|
|
|
- {{ scope.row.customer_name }}
|
|
|
- </p>
|
|
|
- </el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -533,12 +157,10 @@
|
|
|
</el-form>
|
|
|
</el-col>
|
|
|
<el-col :span="24" style="text-align: right">
|
|
|
- <el-button type="primary" @click="submitForm" v-if="!isDetail"
|
|
|
- >保 存
|
|
|
- </el-button>
|
|
|
- <el-button @click="showModelThis = false" v-if="!isDetail">{{
|
|
|
- isDetail ? "关 闭" : "取 消"
|
|
|
- }}</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm">保 存 </el-button>
|
|
|
+ <el-button @click="showModelThis = false" v-if="!isDetail"
|
|
|
+ >关 闭</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</template>
|
|
@@ -546,99 +168,19 @@
|
|
|
<script>
|
|
|
import asyncRequest from "@/apis/service/sellOut/sellReturnList";
|
|
|
import resToken from "@/mixins/resToken";
|
|
|
-import {
|
|
|
- isnumber,
|
|
|
- isMobile,
|
|
|
- validEmail,
|
|
|
- isAlphanumeric,
|
|
|
- isChinese,
|
|
|
- isEmoticon,
|
|
|
- validAlphabets,
|
|
|
-} from "@/utils/validate";
|
|
|
+import { isnumber } from "@/utils/validate";
|
|
|
export default {
|
|
|
name: "sellReturnList",
|
|
|
props: ["showModel", "id", "isDetail", "sitem", "showModelThis", "newTime"],
|
|
|
mixins: [resToken],
|
|
|
data() {
|
|
|
- const validateusername = (rule, value, callback) => {
|
|
|
- if (value === "") {
|
|
|
- callback(new Error("账号不能为空!"));
|
|
|
- } else {
|
|
|
- if (value.length < 6 || value.length > 18) {
|
|
|
- callback(new Error("账号规则为6~18位数字与字母组合!"));
|
|
|
- } else {
|
|
|
- if (isnumber(value)) {
|
|
|
- callback(new Error("账号规则为6~18位数字与字母组合!"));
|
|
|
- } else if (validAlphabets(value)) {
|
|
|
- callback(new Error("账号规则为6~18位数字与字母组合!"));
|
|
|
- } else if (!isAlphanumeric(value)) {
|
|
|
- callback(new Error("账号规则为6~18位数字与字母组合!"));
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
- const validatename = (rule, value, callback) => {
|
|
|
- if (value === "") {
|
|
|
- callback(new Error("真实姓名不能为空!"));
|
|
|
- } else {
|
|
|
- if (value.length < 2 || value.length > 12) {
|
|
|
- callback(new Error("真实姓名规则为2~12位汉字!"));
|
|
|
- } else {
|
|
|
- if (!isChinese(value)) {
|
|
|
- callback(new Error("真实姓名规则为2~12位汉字!"));
|
|
|
- } else if (isEmoticon(value)) {
|
|
|
- callback(new Error("真实姓名规则为2~12位汉字!"));
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
- const validatemobile = (rule, value, callback) => {
|
|
|
- if (value === "") {
|
|
|
- callback(new Error("手机号不能为空!"));
|
|
|
- } else {
|
|
|
- if (!isMobile(value)) {
|
|
|
- callback(new Error("手机号格式不正确!"));
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- const validateEmail = (rule, value, callback) => {
|
|
|
- if (value === "") {
|
|
|
- callback();
|
|
|
- } else {
|
|
|
- if (!validEmail(value)) {
|
|
|
- callback(new Error("邮箱格式不正确!"));
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
return {
|
|
|
- totalReturnNum: "", //仓库总退货数量
|
|
|
- totalReturnNumbers: "", //收货总退货数量
|
|
|
-
|
|
|
- noSendNumbers: "", //收货-未发货数量
|
|
|
- noSendNum: "", //销售-未发货数量
|
|
|
- reason_options: [], //退换货原因备选项
|
|
|
loading: false,
|
|
|
- title: "添加销售退货单",
|
|
|
showModelThis: this.showModel,
|
|
|
ruleForm: {
|
|
|
- get_return_num: "",
|
|
|
orderCode: "", //出库单编号
|
|
|
remark: "", //退货备注
|
|
|
- return_num: "", //退货数量
|
|
|
errorCode: "", //退货原因
|
|
|
- // email: "",
|
|
|
- // role_id: "",
|
|
|
- // status: "1",
|
|
|
- // item: [],
|
|
|
},
|
|
|
rulesThis: this.rules,
|
|
|
rules: {
|
|
@@ -646,17 +188,9 @@ export default {
|
|
|
{
|
|
|
required: true,
|
|
|
message: "请选择退货原因",
|
|
|
- // type: "array",
|
|
|
trigger: "change",
|
|
|
},
|
|
|
],
|
|
|
- return_num: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- validator: validatemobile,
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
remark: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -675,125 +209,53 @@ export default {
|
|
|
this.initForm();
|
|
|
},
|
|
|
watch: {
|
|
|
- showModel: function (val) {
|
|
|
- this.showModelThis = val;
|
|
|
- if (val) {
|
|
|
- this.initForm();
|
|
|
- }
|
|
|
- },
|
|
|
- showModelThis(val) {
|
|
|
- if (!val) {
|
|
|
- this.$emit("cancel");
|
|
|
- }
|
|
|
- },
|
|
|
newTime: function (val) {
|
|
|
if (val) {
|
|
|
this.initForm();
|
|
|
}
|
|
|
},
|
|
|
- id: function (val) {
|
|
|
- if (val) {
|
|
|
- this.initForm();
|
|
|
- }
|
|
|
- },
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
-
|
|
|
- // 获取退换货原因
|
|
|
- async getReason() {
|
|
|
- this.loading = true;
|
|
|
- let model = {
|
|
|
- page: 1,
|
|
|
- size: 15,
|
|
|
- type: "5",
|
|
|
- };
|
|
|
- this.reason_options = [];
|
|
|
- const res = await asyncRequest.getReason(model);
|
|
|
- if (res && res.code === 0 && res.data) {
|
|
|
- res.data.list.forEach((element) => {
|
|
|
- let obj = {
|
|
|
- value: element.result_code,
|
|
|
- label: element.result,
|
|
|
- id: element.id,
|
|
|
- };
|
|
|
- this.reason_options.push(obj);
|
|
|
- });
|
|
|
- } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
- await this.logout();
|
|
|
- } else {
|
|
|
- this.tableData = [];
|
|
|
- this.pageInfo.total = 0;
|
|
|
- }
|
|
|
- this.loading = false;
|
|
|
+ errorCode_change(e) {
|
|
|
+ this.ruleForm.errorCode = e && e.code ? e.code : "";
|
|
|
+ this.$refs.ruleForm.validateField("errorCode");
|
|
|
},
|
|
|
async initForm() {
|
|
|
this.loading = true;
|
|
|
- if (this.id === "add") {
|
|
|
- this.title = "添加销售退货单";
|
|
|
- this.rulesThis = this.rules;
|
|
|
- await this.resetForm();
|
|
|
- } else {
|
|
|
- if (this.isDetail) {
|
|
|
- this.title = "添加销售退货单详情";
|
|
|
- this.rulesThis = {};
|
|
|
- } else {
|
|
|
- this.title = "修改添加销售退货单";
|
|
|
- this.rulesThis = this.rules;
|
|
|
- }
|
|
|
- // await this.getReason();
|
|
|
- await this.initData();
|
|
|
- }
|
|
|
-
|
|
|
- this.getReason(); //获取退还货原因
|
|
|
-
|
|
|
+ this.rulesThis = this.rules;
|
|
|
+ await this.resetForm();
|
|
|
this.loading = false;
|
|
|
},
|
|
|
- async initData() {
|
|
|
- let model = JSON.parse(JSON.stringify(this.sitem));
|
|
|
- this.ruleForm = {
|
|
|
- get_return_num: model.addrinfo,
|
|
|
- orderCode: "", //出库单编号
|
|
|
- remark: model.remark, //退货备注
|
|
|
- return_num: model.num, //退货数量
|
|
|
- errorCode: [model.error_msg], //退货原因
|
|
|
- };
|
|
|
- let { addrinfo, wsminfo } = model;
|
|
|
- this.tableForm.product_go = wsminfo;
|
|
|
- this.tableForm.get_product_go = addrinfo;
|
|
|
- },
|
|
|
async resetForm() {
|
|
|
// 重置
|
|
|
await this.$nextTick(() => {
|
|
|
if (this.$refs.ruleForm) {
|
|
|
this.$refs.ruleForm.resetFields();
|
|
|
this.$refs.ruleForm.clearValidate();
|
|
|
- this.orderCode = this.sitem.orderCode;
|
|
|
- const { info, addrs } = this.sitem;
|
|
|
- info.forEach((ele) => {
|
|
|
- this.noSendNum += ele.wsend_num;
|
|
|
- });
|
|
|
+ const { info, addrs, orderCode } = this.sitem;
|
|
|
let list = JSON.parse(JSON.stringify(info)); //
|
|
|
list.map((v) => {
|
|
|
v.edit = false;
|
|
|
+ v.return_num = v.return_num || "0";
|
|
|
return v;
|
|
|
});
|
|
|
this.tableForm.product_go = [].concat(...list);
|
|
|
-
|
|
|
- addrs.forEach((ele) => {
|
|
|
- this.noSendNumbers += ele.wsend_num;
|
|
|
- });
|
|
|
let l_list = JSON.parse(JSON.stringify(addrs));
|
|
|
l_list.map((ele) => {
|
|
|
ele.edit = false;
|
|
|
+ ele.return_num = ele.return_num || "0";
|
|
|
return ele;
|
|
|
});
|
|
|
- this.tableForm.get_product_go = [].concat(...l_list);
|
|
|
this.ruleForm = {
|
|
|
+ orderCode: orderCode || "",
|
|
|
remark: "", //退货备注
|
|
|
- return_num: "", //退货数量
|
|
|
errorCode: "", //退货原因
|
|
|
};
|
|
|
+ this.tableForm = {
|
|
|
+ product_go: [].concat(...list),
|
|
|
+ get_product_go: [].concat(...l_list),
|
|
|
+ };
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -802,42 +264,55 @@ export default {
|
|
|
await this.$refs.ruleForm.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
this.loading = true;
|
|
|
- const model = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
+ let model = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
let arr = JSON.parse(JSON.stringify(this.tableForm.product_go));
|
|
|
- //收货信息列表入参
|
|
|
+ let arr1 = JSON.parse(JSON.stringify(this.tableForm.get_product_go));
|
|
|
+ let wsm_code_edit = false,
|
|
|
+ addr_edit = false,
|
|
|
+ wsm_code_total = 0,
|
|
|
+ addr_total = 0;
|
|
|
let list = [];
|
|
|
- arr.map((e) => {
|
|
|
+ arr.forEach((e) => {
|
|
|
+ if (e.edit) {
|
|
|
+ wsm_code_edit = true;
|
|
|
+ }
|
|
|
let obj = {
|
|
|
wsm_code: e.wsm_code,
|
|
|
- return_num: model.return_num,
|
|
|
+ return_num: e.return_num,
|
|
|
};
|
|
|
+ wsm_code_total += e.return_num;
|
|
|
list.push(obj);
|
|
|
});
|
|
|
- // 地址列表入参
|
|
|
- let arr1 = JSON.parse(JSON.stringify(this.tableForm.get_product_go));
|
|
|
let addr = [];
|
|
|
- arr1.map((e) => {
|
|
|
+ arr1.forEach((e) => {
|
|
|
+ if (e.edit) {
|
|
|
+ addr_edit = true;
|
|
|
+ }
|
|
|
let obj = {
|
|
|
addrid: e.id,
|
|
|
- return_num: model.get_return_num,
|
|
|
+ return_num: e.return_num,
|
|
|
};
|
|
|
+ addr_total += e.return_num;
|
|
|
addr.push(obj);
|
|
|
});
|
|
|
model.list = list;
|
|
|
model.addr = addr;
|
|
|
- model.orderCode = this.orderCode;
|
|
|
- delete model["get_return_num"];
|
|
|
- if (Number(model.return_num) > Number(this.noSendNum)) {
|
|
|
- this.$message.warning("退货数量不能大于未发货数量");
|
|
|
+ if (wsm_code_edit) {
|
|
|
+ this.$message.warning("仓库信息正在编辑,请保存后再试!");
|
|
|
+ this.loading = false;
|
|
|
return;
|
|
|
}
|
|
|
- let res = {};
|
|
|
- if (this.id === "add") {
|
|
|
- delete model["id"];
|
|
|
- res = await asyncRequest.add(model);
|
|
|
- } else {
|
|
|
- res = await asyncRequest.update(model);
|
|
|
+ if (addr_edit) {
|
|
|
+ this.$message.warning("地址信息正在编辑,请保存后再试!");
|
|
|
+ this.loading = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (wsm_code_total !== addr_total) {
|
|
|
+ this.$message.warning("仓库退货总数不等于收货地址总数!");
|
|
|
+ this.loading = false;
|
|
|
+ return;
|
|
|
}
|
|
|
+ let res = await asyncRequest.add(model);
|
|
|
this.loading = false;
|
|
|
if (res && res.code === 0) {
|
|
|
const title = this.id === "add" ? "添加成功" : "修改成功";
|
|
@@ -859,64 +334,55 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- //异常原因筛选
|
|
|
//保存某一行
|
|
|
- checkRow(rowIndex, name) {
|
|
|
- if (name == "return") {
|
|
|
- const model = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
- if (Number(model.return_num) > Number(this.noSendNum)) {
|
|
|
- this.$message.warning("退货数量不能大于未发货数量");
|
|
|
+ checkRow(rowIndex, type) {
|
|
|
+ if (type === 0) {
|
|
|
+ const { wsend_num, return_num } = this.tableForm.product_go[rowIndex];
|
|
|
+ if (!isnumber(return_num)) {
|
|
|
+ this.$message.warning("退货数量不规范!");
|
|
|
return;
|
|
|
}
|
|
|
- const { check_value, check_remark } =
|
|
|
- this.tableForm.product_go[rowIndex];
|
|
|
- if (check_value != "" && check_remark != "") {
|
|
|
- this.tableForm.product_go[rowIndex].edit = false;
|
|
|
- } else {
|
|
|
- this.$message.warning("审核情况或审核备注不能为空");
|
|
|
- }
|
|
|
- } else if (name == "get") {
|
|
|
- const model = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
- if (Number(model.get_return_num) > Number(this.noSendNum)) {
|
|
|
- this.$message.warning("退货数量不能大于未发货数量");
|
|
|
+ if (parseInt(wsend_num) < parseInt(return_num)) {
|
|
|
+ this.$message.warning("退货数量不能大于未发货总数量!");
|
|
|
return;
|
|
|
}
|
|
|
- const { check_value, check_remark } =
|
|
|
- this.tableForm.get_product_go[rowIndex];
|
|
|
- if (check_value != "" && check_remark != "") {
|
|
|
- this.tableForm.get_product_go[rowIndex].edit = false;
|
|
|
- } else {
|
|
|
- this.$message.warning("审核情况或审核备注不能为空");
|
|
|
- }
|
|
|
+ this.tableForm.product_go[rowIndex].edit = false;
|
|
|
}
|
|
|
- },
|
|
|
- //编辑某一行
|
|
|
- editRow(rowIndex, name) {
|
|
|
- if (name == "return") {
|
|
|
- let index = this.tableForm.product_go.findIndex((v) => {
|
|
|
- v.edit;
|
|
|
- });
|
|
|
- if (index !== -1) {
|
|
|
- this.$message.warning("请完成其他行的编辑!");
|
|
|
+
|
|
|
+ if (type === 1) {
|
|
|
+ const { wsend_num, return_num } =
|
|
|
+ this.tableForm.get_product_go[rowIndex];
|
|
|
+ if (!isnumber(return_num)) {
|
|
|
+ this.$message.warning("退货数量不规范!");
|
|
|
return;
|
|
|
- } else {
|
|
|
- this.tableForm.product_go[rowIndex].edit = true;
|
|
|
}
|
|
|
- } else if (name == "get") {
|
|
|
- let index = this.tableForm.product_go.findIndex((v) => {
|
|
|
- v.edit;
|
|
|
- });
|
|
|
- if (index !== -1) {
|
|
|
- this.$message.warning("请完成其他行的编辑!");
|
|
|
+ if (parseInt(wsend_num) < parseInt(return_num)) {
|
|
|
+ this.$message.warning("退货数量不能大于未发货总数量!");
|
|
|
return;
|
|
|
- } else {
|
|
|
- this.tableForm.get_product_go[rowIndex].edit = true;
|
|
|
}
|
|
|
+ this.tableForm.get_product_go[rowIndex].edit = false;
|
|
|
}
|
|
|
},
|
|
|
- resetRow(rowIndex) {
|
|
|
- this.tableForm.product_go[rowIndex].check_remark = "";
|
|
|
- this.tableForm.product_go[rowIndex].check_value = "agree";
|
|
|
+ //编辑某一行
|
|
|
+ editRow(rowIndex, type) {
|
|
|
+ let list = JSON.parse(
|
|
|
+ JSON.stringify(
|
|
|
+ type === 0 ? this.tableForm.product_go : this.tableForm.get_product_go
|
|
|
+ )
|
|
|
+ );
|
|
|
+ let index = list.findIndex((v) => {
|
|
|
+ v.edit;
|
|
|
+ });
|
|
|
+ if (index !== -1) {
|
|
|
+ this.$message.warning("请完成其他行的编辑!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (type === 0) {
|
|
|
+ this.tableForm.product_go[rowIndex].edit = true;
|
|
|
+ } else {
|
|
|
+ this.tableForm.get_product_go[rowIndex].edit = true;
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
};
|