|
@@ -232,7 +232,7 @@
|
|
<el-dialog :title="dialogTitle" :visible.sync="remarkVisible" :show-close="false" :width="dialogWidth"
|
|
<el-dialog :title="dialogTitle" :visible.sync="remarkVisible" :show-close="false" :width="dialogWidth"
|
|
:close-on-click-modal="false">
|
|
:close-on-click-modal="false">
|
|
<el-form :model="orderForm" :rules="orderFormRules" ref="orderForm" v-if="curOpenDialogType !== 'query'"
|
|
<el-form :model="orderForm" :rules="orderFormRules" ref="orderForm" v-if="curOpenDialogType !== 'query'"
|
|
- label-width="90px" label-position="left">
|
|
|
|
|
|
+ label-width="100px" label-position="left">
|
|
<el-form-item prop="remark" v-if="curOpenDialogType === 'remark'">
|
|
<el-form-item prop="remark" v-if="curOpenDialogType === 'remark'">
|
|
<el-input type="textarea" :autosize="{ minRows: 8, maxRows: 16 }" placeholder="请输入备注内容" v-model="remark"
|
|
<el-input type="textarea" :autosize="{ minRows: 8, maxRows: 16 }" placeholder="请输入备注内容" v-model="remark"
|
|
maxlength="100" show-word-limit>
|
|
maxlength="100" show-word-limit>
|
|
@@ -250,27 +250,218 @@
|
|
<el-form-item label="收货地址" prop="receAddress" v-if="curOpenDialogType === 'info'">
|
|
<el-form-item label="收货地址" prop="receAddress" v-if="curOpenDialogType === 'info'">
|
|
<el-input v-model="orderForm.receAddress" autocomplete="off" placeholder="请输入收货地址"></el-input>
|
|
<el-input v-model="orderForm.receAddress" autocomplete="off" placeholder="请输入收货地址"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="快递单号" prop="logisticsNo" v-if="curOpenDialogType === 'send'">
|
|
|
|
- <el-input v-model="orderForm.logisticsNo" autocomplete="off" placeholder="请输入快递单号"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="物流公司" prop="companyCode" v-if="curOpenDialogType === 'send'">
|
|
|
|
- <el-select v-model="orderForm.companyCode" placeholder="请选择物流公司" style="width: 100%;">
|
|
|
|
- <el-option :label="item.name" :value="item.code" v-for="(item, index) in companyList"
|
|
|
|
- :key="index"></el-option>
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="仓储" prop="storageId" v-if="curOpenDialogType === 'send'">
|
|
|
|
- <el-select v-model="orderForm.storageId" placeholder="请选择仓储" style="width: 100%;">
|
|
|
|
- <el-option :label="item.storageName" :value="item.storageId" v-for="(item, index) in storageList"
|
|
|
|
- :key="index"></el-option>
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="是否派单" prop="workOrder" v-if="curOpenDialogType === 'send'">
|
|
|
|
- <el-radio-group v-model="orderForm.workOrder">
|
|
|
|
- <el-radio :label="true">是</el-radio>
|
|
|
|
- <el-radio :label="false">否</el-radio>
|
|
|
|
- </el-radio-group>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
+ <template v-if="curOpenDialogType === 'send'">
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
+ <el-col :span="6">
|
|
|
|
+ <el-form-item label="发货方式" prop="pickType">
|
|
|
|
+ <el-radio-group v-model="orderForm.pickType">
|
|
|
|
+ <el-radio label="YES">自提/自送</el-radio>
|
|
|
|
+ <el-radio label="NO">快递物流</el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="6">
|
|
|
|
+ <el-form-item v-if="orderForm.pickType == 'YES'" label="提货人" prop="pickName" :rules="[{ required: true, message: '提货人不能为空', trigger: 'blur' }]">
|
|
|
|
+ <el-input v-model="orderForm.pickName" placeholder="请输入提货人"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="6">
|
|
|
|
+ <el-form-item v-if="orderForm.pickType == 'YES'" label="提货人电话" prop="pickPhone" :rules="[{ required: true, message: '提货人电话不能为空', trigger: 'blur' },{ pattern:/^((1[3456789]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }]">
|
|
|
|
+ <el-input v-model="orderForm.pickPhone" placeholder="请输入提货人电话"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="6">
|
|
|
|
+ <el-form-item v-if="orderForm.pickType == 'NO'" label="快递单号" prop="logisticsNo">
|
|
|
|
+ <el-input v-model="orderForm.logisticsNo" autocomplete="off" placeholder="请输入快递单号"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="6">
|
|
|
|
+ <el-form-item v-if="orderForm.pickType == 'NO'" label="物流公司" prop="companyCode">
|
|
|
|
+ <el-select v-model="orderForm.companyCode" placeholder="请选择物流公司" style="width: 100%;">
|
|
|
|
+ <el-option :label="item.name" :value="item.code" v-for="(item, index) in companyList"
|
|
|
|
+ :key="index"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="6">
|
|
|
|
+ <el-form-item label="仓储" prop="storageId">
|
|
|
|
+ <el-select v-model="orderForm.storageId" placeholder="请选择仓储" style="width: 100%;">
|
|
|
|
+ <el-option :label="item.storageName" :value="item.storageId" v-for="(item, index) in storageList"
|
|
|
|
+ :key="index"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="6">
|
|
|
|
+ <el-form-item label="是否派单" prop="workOrder">
|
|
|
|
+ <el-radio-group v-model="orderForm.workOrder">
|
|
|
|
+ <el-radio :label="true">是</el-radio>
|
|
|
|
+ <el-radio :label="false">否</el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <el-card class="box-card">
|
|
|
|
+ <el-tabs v-model="typeIndex">
|
|
|
|
+ <el-tab-pane label="发货数量" name="1"></el-tab-pane>
|
|
|
|
+ <el-tab-pane label="发货条码" name="2"></el-tab-pane>
|
|
|
|
+ </el-tabs>
|
|
|
|
+ <br/>
|
|
|
|
+ <el-button size="small" v-show="typeIndex == 2" type="primary" @click="addCode()">新增</el-button>
|
|
|
|
+ <el-button size="small" v-show="typeIndex == 1" type="primary" @click="handleDownload('导入条码模板')">导入条码模板下载</el-button>
|
|
|
|
+ <div class="table">
|
|
|
|
+ <!-- 发货数量 -->
|
|
|
|
+ <el-form v-show="typeIndex == 1" ref="formData1" :model="formData1" label-width="0" size="small" label-position="left">
|
|
|
|
+ <el-table :data="formData1.list" element-loading-text="Loading" border fit highlight-current-row stripe>
|
|
|
|
+ <el-table-column prop="brandName" align="center" label="品牌"></el-table-column>
|
|
|
|
+ <el-table-column prop="mainName" align="center" label="大类"></el-table-column>
|
|
|
|
+ <el-table-column prop="smallName" align="center" label="小类"></el-table-column>
|
|
|
|
+ <el-table-column prop="goodsName" align="center" label="商品名称"></el-table-column>
|
|
|
|
+ <el-table-column prop="goodsMaterialSpecsName" align="center" label="规格型号"></el-table-column>
|
|
|
|
+ <el-table-column prop="goodsMaterialUnit" align="center" label="单位">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ {{scope.row.goodsMaterialUnit == 'C'?'整套':scope.row.goodsMaterialUnit == 'I'?"单个":''}}
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="num" align="center" label="数量"></el-table-column>
|
|
|
|
+ <el-table-column prop="insideNum" align="center" label="内机数量"></el-table-column>
|
|
|
|
+ <el-table-column prop="outNum" align="center" label="外机数量"></el-table-column>
|
|
|
|
+ <el-table-column prop="partNum" align="center" label="配件数量"></el-table-column>
|
|
|
|
+ <el-table-column prop="insideCodeQty" align="center" label="导入内机条码数量" width="140"></el-table-column>
|
|
|
|
+ <el-table-column prop="outCodeQty" align="center" label="导入外机条码数量" width="140"></el-table-column>
|
|
|
|
+ <el-table-column prop="partsCodeQty" align="center" label="导入配件条码数量" width="140"></el-table-column>
|
|
|
|
+ <el-table-column label="操作" align="center" width="140" fixed="right">
|
|
|
|
+ <template slot-scope="scope" v-if="joinCode">
|
|
|
|
+ <el-upload
|
|
|
|
+ action='_'
|
|
|
|
+ :show-file-list='false'
|
|
|
|
+ :http-request="importCode"
|
|
|
|
+ >
|
|
|
|
+ <el-button @click="orderDetailId = scope.row.orderDetailId" size="mini" type="text">导入条码</el-button>
|
|
|
|
+ </el-upload>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </el-form>
|
|
|
|
+ <!-- 发货条码 -->
|
|
|
|
+ <el-form ref="formData2" :model="formData2">
|
|
|
|
+ <el-table v-show="typeIndex == 2" :data="formData2.list" element-loading-text="Loading" border fit highlight-current-row stripe>
|
|
|
|
+ <el-table-column label="品牌" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-input type="text" v-model="scope.row.brandName" :disabled="true" placeholder="请输入"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="商品大类" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-input type="text" v-model="scope.row.mainName" :disabled="true" placeholder="请输入"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="商品小类" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-input type="text" v-model="scope.row.smallName" :disabled="true" placeholder="请输入"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="" align="center" label="商品名称">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-input type="text" v-model="scope.row.goodsMaterialName" :disabled="true" placeholder="请输入"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="规格型号" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-form-item :prop="'list.' + scope.$index + '.specs'" :rules="[{ required: true, message: `请选择规格型号`, trigger: 'blur' }]">
|
|
|
|
+ <el-select v-model="scope.row.specs" @change="(e)=>{changeSpecs(e,scope.row)}" value-key="goodsMaterialSpecsName" :disabled="isEdit2 != scope.$index" placeholder="请选择" style="width: 100%;">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="(item,ind) in formData1.list"
|
|
|
|
+ :key="ind"
|
|
|
|
+ :label="item.goodsMaterialSpecsName"
|
|
|
|
+ :value="item">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="物料类型" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-form-item :prop="'list.' + scope.$index + '.goodsMaterialItemType'" :rules="[{ required: true, message: `请选择物料类型`, trigger: 'blur' }]">
|
|
|
|
+ <el-select v-model="scope.row.goodsMaterialItemType" @change="(e)=>{changeMaterial(e,scope.row)}"
|
|
|
|
+ :disabled="isEdit2 != scope.$index" placeholder="请选择" style="width: 100%;">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="(item,ind) in [{name: '内机',id: 'INSIDE'},{name: '外机',id: 'OUT'},{name: '配件',id: 'PARTS'}]"
|
|
|
|
+ :key="ind"
|
|
|
|
+ :label="item.name"
|
|
|
|
+ :value="item.id">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="物料名称" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-form-item :prop="'list.' + scope.$index + '.material'" :rules="[{ required: true, message: `请选择物料名称`, trigger: 'blur' }]">
|
|
|
|
+ <el-select v-model="scope.row.material" @focus="(e)=>{
|
|
|
|
+ if(!scope.row.goodsMaterialItemType){
|
|
|
|
+ return $message.warning('请先选择物料类型!');
|
|
|
|
+ }
|
|
|
|
+ }" @change="(e)=>{
|
|
|
|
+ scope.row.materialName = e.name
|
|
|
|
+ scope.row.stockQty = (e.uniqueCode=='YES'?1:null)
|
|
|
|
+ scope.row.uniqueCode = e.uniqueCode
|
|
|
|
+ scope.row.goodsMaterialItemId = e.itemId
|
|
|
|
+ }" value-key="name" :disabled="isEdit2 != scope.$index" placeholder="请选择" style="width: 100%;">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="(item,ind) in scope.row.materialList"
|
|
|
|
+ :key="ind"
|
|
|
|
+ :label="item.name"
|
|
|
|
+ :value="item">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="" align="center" label="是否一物一码" >
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-form-item>
|
|
|
|
+ {{scope.row.uniqueCode=='YES'?'是':scope.row.uniqueCode=='NO'?'否':''}}
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="" align="center" label="条码" >
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-form-item :prop="'list.' + scope.$index + '.materialCode'" :rules="[{ required: true, message: `请输入条码`, trigger: 'blur' }]">
|
|
|
|
+ <el-input type="text" v-model="scope.row.materialCode" :disabled="isEdit2 != scope.$index" placeholder="请输入"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="" align="center" label="数量">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-form-item :prop="'list.' + scope.$index + '.stockQty'" :rules="[{ required: true, message: `请输入数量`, trigger: 'blur' }]">
|
|
|
|
+ <el-input type="number" v-model="scope.row.stockQty" :disabled="isEdit2 != scope.$index || scope.row.uniqueCode=='YES'" placeholder="请输入"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="操作" align="right" width="140" fixed="right">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button size="mini" type="primary" v-if="scope.$index == isEdit2" @click="saveCode(scope.row)">保存</el-button>
|
|
|
|
+ <el-button size="mini" type="primary" v-if="scope.$index != isEdit2" @click="isEdit2 = scope.$index">编辑</el-button>
|
|
|
|
+ <el-popconfirm title="确定删除吗?" @confirm="delCode(scope.row.orderDetailCodeId,scope.$index)">
|
|
|
|
+ <el-button slot="reference" size="mini" type="danger">删除</el-button>
|
|
|
|
+ </el-popconfirm>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
|
|
+ </el-card>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </template>
|
|
</el-form>
|
|
</el-form>
|
|
<el-table v-loading="logisticsLoading" :data="logistics" style="width: 100%" size="mini"
|
|
<el-table v-loading="logisticsLoading" :data="logistics" style="width: 100%" size="mini"
|
|
v-if="curOpenDialogType === 'query'">
|
|
v-if="curOpenDialogType === 'query'">
|
|
@@ -285,7 +476,9 @@
|
|
<el-table-column prop="context" label="物流详情" align="center"></el-table-column>
|
|
<el-table-column prop="context" label="物流详情" align="center"></el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
- <el-button type="primary" @click="saveForm" v-if="curOpenDialogType !== 'query'">保 存</el-button>
|
|
|
|
|
|
+
|
|
|
|
+ <el-button type="primary" @click="saveForm" v-if="curOpenDialogType !== 'query' && curOpenDialogType !== 'send'">保 存</el-button>
|
|
|
|
+ <el-button type="primary" @click="deliverGoods" v-if="curOpenDialogType == 'send'">发 货</el-button>
|
|
<el-button @click="cancelForm">{{ curOpenDialogType === 'query' ? '关 闭' : '取 消' }}</el-button>
|
|
<el-button @click="cancelForm">{{ curOpenDialogType === 'query' ? '关 闭' : '取 消' }}</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -318,9 +511,10 @@ import {
|
|
confirmOrder,
|
|
confirmOrder,
|
|
getOrderDetail, goodsDeliver,
|
|
getOrderDetail, goodsDeliver,
|
|
saveRemark, orderRefund, orderCompensate, getCompensateList,
|
|
saveRemark, orderRefund, orderCompensate, getCompensateList,
|
|
- changeShow
|
|
|
|
|
|
+ changeShow, getCodeDetail, getMaterialList, listImport, saveCode, delCode
|
|
} from "@/api/order";
|
|
} from "@/api/order";
|
|
import { getExpress, getCompanyList } from "@/api/common";
|
|
import { getExpress, getCompanyList } from "@/api/common";
|
|
|
|
+import { commonTemplateDownload } from '@/api/common.js'
|
|
import * as Storage from "@/api/storage";
|
|
import * as Storage from "@/api/storage";
|
|
import { mapGetters } from 'vuex'
|
|
import { mapGetters } from 'vuex'
|
|
|
|
|
|
@@ -344,6 +538,9 @@ export default {
|
|
logisticsNo: '',
|
|
logisticsNo: '',
|
|
companyCode: '',
|
|
companyCode: '',
|
|
workOrder: true,
|
|
workOrder: true,
|
|
|
|
+ pickType: 'YES',
|
|
|
|
+ pickName: '',
|
|
|
|
+ pickPhone: ''
|
|
},
|
|
},
|
|
orderFormRules: {
|
|
orderFormRules: {
|
|
payAmount: [
|
|
payAmount: [
|
|
@@ -456,6 +653,17 @@ export default {
|
|
refundNum: '',
|
|
refundNum: '',
|
|
},
|
|
},
|
|
compensateList: [],
|
|
compensateList: [],
|
|
|
|
+ typeIndex: '1',
|
|
|
|
+ formData1: {
|
|
|
|
+ list: [],
|
|
|
|
+ },
|
|
|
|
+ formData2: {
|
|
|
|
+ list: [],
|
|
|
|
+ },
|
|
|
|
+ isEdit1: 0,
|
|
|
|
+ isEdit2: 0,
|
|
|
|
+ joinCode: JSON.parse(localStorage.getItem('greemall_user')).joinCode,
|
|
|
|
+ orderDetailId: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -472,10 +680,11 @@ export default {
|
|
this.orderDetail.workerName = this.orderDetail.workerName ? this.orderDetail.workerName : '暂无'
|
|
this.orderDetail.workerName = this.orderDetail.workerName ? this.orderDetail.workerName : '暂无'
|
|
this.orderDetail.workerPhone = this.orderDetail.workerPhone ? this.orderDetail.workerPhone : ''
|
|
this.orderDetail.workerPhone = this.orderDetail.workerPhone ? this.orderDetail.workerPhone : ''
|
|
this.evaluateDetail = res.data.orderComment;
|
|
this.evaluateDetail = res.data.orderComment;
|
|
|
|
+ this.formData1.list = res.data.orderDetails
|
|
})
|
|
})
|
|
},
|
|
},
|
|
showDialog(type) {
|
|
showDialog(type) {
|
|
- this.dialogWidth = type === 'query' ? '80%' : '50%'
|
|
|
|
|
|
+ this.dialogWidth = type === 'query' ? '80%' : type === 'send' ? '80%': '50%'
|
|
this.remarkVisible = true
|
|
this.remarkVisible = true
|
|
this.curOpenDialogType = type
|
|
this.curOpenDialogType = type
|
|
if (type === 'remark') {
|
|
if (type === 'remark') {
|
|
@@ -705,7 +914,192 @@ export default {
|
|
this.getDetail();
|
|
this.getDetail();
|
|
this.$successMsg();
|
|
this.$successMsg();
|
|
})
|
|
})
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ async getCodeDetail(){
|
|
|
|
+ getCodeDetail({orderId: this.orderId}).then(async res => {
|
|
|
|
+ for(var item of res.data){
|
|
|
|
+ item.specs = {goodsMaterialSpecsName: item.specsName}
|
|
|
|
+ item.material = {name: item.materialName}
|
|
|
|
+ item.materialList = await this.getMaterialList(item.specsName,item.goodsMaterialItemType)
|
|
|
|
+ }
|
|
|
|
+ this.formData2.list = res.data
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ async getMaterialList(specsName,type){
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
+ getMaterialList({
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: -1,
|
|
|
|
+ specsName,
|
|
|
|
+ type
|
|
|
|
+ }).then(async res => {
|
|
|
|
+ resolve(res.data.records)
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ async changeSpecs(e,row){
|
|
|
|
+ row.brandName = e.brandName
|
|
|
|
+ row.brandId = e.brandId
|
|
|
|
+ row.mainName = e.mainName
|
|
|
|
+ row.mainId = e.mainNumber
|
|
|
|
+ row.smallName = e.smallName
|
|
|
|
+ row.smallId = e.smallNumber
|
|
|
|
+ row.specsName = e.goodsMaterialSpecsName
|
|
|
|
+ row.goodsMaterialName = e.goodsName
|
|
|
|
+ row.goodsMaterialId = e.goodsMaterialId
|
|
|
|
+ row.material = null
|
|
|
|
+ row.materialName = ''
|
|
|
|
+ row.stockQty = ''
|
|
|
|
+ row.uniqueCode = ''
|
|
|
|
+ row.materialList = await this.getMaterialList(row.specsName,row.goodsMaterialItemType)
|
|
|
|
+ row.orderDetailId = e.orderDetailId
|
|
|
|
+ },
|
|
|
|
+ async changeMaterial(e,row){
|
|
|
|
+ if(!row.specs){
|
|
|
|
+ return this.$message.warning('请先选择规格型号!');
|
|
|
|
+ }
|
|
|
|
+ row.material = null
|
|
|
|
+ row.materialName = ''
|
|
|
|
+ row.stockQty = ''
|
|
|
|
+ row.uniqueCode = ''
|
|
|
|
+ row.materialList = await this.getMaterialList(row.specsName,row.goodsMaterialItemType)
|
|
|
|
+ },
|
|
|
|
+ //发货新增条码
|
|
|
|
+ addCode(){
|
|
|
|
+ this.$refs.formData2.validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ this.isEdit2 = 0
|
|
|
|
+ this.formData2.list.unshift({
|
|
|
|
+ brandId: '',
|
|
|
|
+ brandName: '',
|
|
|
|
+ mainId: '',
|
|
|
|
+ mainName: '',
|
|
|
|
+ stockQty: '',
|
|
|
|
+ smallId: '',
|
|
|
|
+ smallName: '',
|
|
|
|
+ goodsMaterialItemType: '',
|
|
|
|
+ goodsMaterialName: '',
|
|
|
|
+ goodsMaterialId: '',
|
|
|
|
+ materialCode: '',
|
|
|
|
+ uniqueCode: '',
|
|
|
|
+ specs: null,
|
|
|
|
+ specsName: '',
|
|
|
|
+ materialName: '',
|
|
|
|
+ material: null,
|
|
|
|
+ materialList: [],
|
|
|
|
+ orderDetailId: '',
|
|
|
|
+ goodsMaterialItemId: ''
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ delCode(orderDetailCodeId,index){
|
|
|
|
+ if(orderDetailCodeId){
|
|
|
|
+ delCode({
|
|
|
|
+ orderDetailCodeId
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.$message({ type: 'success', message: '删除成功!' })
|
|
|
|
+ this.getOrderDetail()
|
|
|
|
+ this.getCodeDetail()
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(res.msg);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ this.formData2.list.splice(index,1)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ saveCode(orderDetailCodes){
|
|
|
|
+ const that = this
|
|
|
|
+ let params = [{
|
|
|
|
+ ...orderDetailCodes,
|
|
|
|
+ orderId: this.orderId,
|
|
|
|
+ }]
|
|
|
|
+ delete params[0].material;
|
|
|
|
+ delete params[0].specs;
|
|
|
|
+ this.$refs.formData2.validate((valid, invalidFields, errLabels) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ saveCode(params).then(res=>{
|
|
|
|
+ if(res.code == 200){
|
|
|
|
+ that.$message.success('保存成功!')
|
|
|
|
+ this.getOrderDetail()
|
|
|
|
+ this.getCodeDetail()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ deliverGoods(){
|
|
|
|
+ this.$refs.orderForm.validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ goodsDeliver({
|
|
|
|
+ orderId: this.orderId,
|
|
|
|
+ logisticsNo: this.orderForm.logisticsNo,
|
|
|
|
+ storageId: this.orderForm.storageId,
|
|
|
|
+ companyCode: this.orderForm.companyCode,
|
|
|
|
+ workOrder: this.orderForm.workOrder,
|
|
|
|
+ pickName: this.orderForm.pickName,
|
|
|
|
+ pickPhone: this.orderForm.pickPhone,
|
|
|
|
+ pickType: this.orderForm.pickType,
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.cancelForm();
|
|
|
|
+ this.getDetail();
|
|
|
|
+ this.$successMsg('发货成功');
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ importCode(data){
|
|
|
|
+ const loading = this.$loading({
|
|
|
|
+ lock: true,
|
|
|
|
+ text: '正在导入',
|
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
+ })
|
|
|
|
+ var formdata = new FormData()
|
|
|
|
+ formdata.append('file', data.file)
|
|
|
|
+ let params = {
|
|
|
|
+ orderDetailId: this.orderDetailId
|
|
|
|
+ }
|
|
|
|
+ if (!!params) {
|
|
|
|
+ for (const key in params) {
|
|
|
|
+ if (Object.hasOwnProperty.call(params, key)) {
|
|
|
|
+ formdata.append(key, params[key])
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ listImport({ formdata })
|
|
|
|
+ .then(res => {
|
|
|
|
+ this.getOrderDetail()
|
|
|
|
+ loading.close()
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'success',
|
|
|
|
+ message: '导入成功!'
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ .catch(err => {
|
|
|
|
+ loading.close()
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'error',
|
|
|
|
+ message: err.message || '导入失败'
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 下载导入模版
|
|
|
|
+ handleDownload(title) {
|
|
|
|
+ commonTemplateDownload({ name: '导入条码.xlsx' }, title).then(res => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '下载成功',
|
|
|
|
+ type: 'success'
|
|
|
|
+ })
|
|
|
|
+ }).catch(err => {
|
|
|
|
+ this.$message.error('下载失败')
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -738,7 +1132,7 @@ export default {
|
|
const totalAmount = parseFloat(this.orderDetail.totalAmount)
|
|
const totalAmount = parseFloat(this.orderDetail.totalAmount)
|
|
const freight = parseFloat(this.orderDetail.freight)
|
|
const freight = parseFloat(this.orderDetail.freight)
|
|
return (totalAmount - freight).toFixed(2)
|
|
return (totalAmount - freight).toFixed(2)
|
|
- }
|
|
|
|
|
|
+ },
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|