|
@@ -118,6 +118,7 @@
|
|
|
|
|
|
<div class="page-footer">
|
|
|
<div class="footer" :class="classObj">
|
|
|
+ <el-button type="primary" @click="openDirectDialog" :disabled="detailData.examineStatus !== 'OK'">提前开票</el-button>
|
|
|
<el-button type="primary" @click="openDeliverDialog" :disabled="detailData.examineStatus !== 'OK'">直调发货</el-button>
|
|
|
<el-button type="primary" @click="handleFinish" :disabled="detailData.examineStatus !== 'OK'">直调完成</el-button>
|
|
|
<el-button @click="goBack">关 闭</el-button>
|
|
@@ -183,11 +184,76 @@
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <el-dialog title="直接调拨单(提前开票)" :visible.sync="isShowDirectDialog" width="80%">
|
|
|
+ <el-form ref="directForm" :model="directForm" :rules="directFormRules" label-width="80px" size="small" label-position="left">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :xs="12" :sm="6" :lg="6">
|
|
|
+ <el-form-item label="调出仓库" prop="warehouse1">
|
|
|
+ <el-select v-model="directForm.warehouse1" placeholder="请选择调出仓库" style="width: 100%" filterable @change="changeWarehouse1">
|
|
|
+ <el-option v-for="item in warehouseList1" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="12" :sm="6" :lg="6">
|
|
|
+ <el-form-item label="调出仓位" prop="position1">
|
|
|
+ <el-select v-model="directForm.position1" placeholder="请调出仓位" style="width: 100%" filterable @change="changePosition1">
|
|
|
+ <el-option v-for="item in positionList1" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="12" :sm="6" :lg="6">
|
|
|
+ <el-form-item label="调入仓库" prop="warehouse2">
|
|
|
+ <el-select v-model="directForm.warehouse2" placeholder="请选择调入仓库" style="width: 100%" filterable @change="changeWarehouse2">
|
|
|
+ <el-option v-for="item in warehouseList2" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="12" :sm="6" :lg="6">
|
|
|
+ <el-form-item label="调入仓位" prop="position2">
|
|
|
+ <el-select v-model="directForm.position2" placeholder="请调入仓位" style="width: 100%" filterable @change="changePosition2">
|
|
|
+ <el-option v-for="item in positionList2" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <div class="table" style="margin-top: 20px">
|
|
|
+ <el-table :data="directGoodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
|
|
|
+ <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
|
|
|
+ <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="调出仓库" prop="warehouse1" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="调出仓位" prop="position1" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="调入仓库" prop="warehouse2" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="调入仓位" prop="position2" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="调出库存状态" prop="status1" min-width="110" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="调入库存状态" prop="status2" min-width="110" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="调出货主" min-width="100" show-overflow-tooltip>
|
|
|
+ <template slot-scope="">弘格</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="调入货主" min-width="100" show-overflow-tooltip>
|
|
|
+ <template slot-="scope">弘格</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="closeDirectDialog">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitDirectForm">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getDetail, getWarehouseList, adjustDeliver, finishData } from "@/api/supply/retail";
|
|
|
+import { getDetail, getWarehouseList, adjustDeliver, finishData, directOrder } from "@/api/supply/retail";
|
|
|
|
|
|
export default {
|
|
|
name: 'RetailDetail',
|
|
@@ -230,6 +296,33 @@ export default {
|
|
|
positionList: [],
|
|
|
|
|
|
goodsList: [],
|
|
|
+
|
|
|
+ isShowDirectDialog: false,
|
|
|
+ directForm: {
|
|
|
+ warehouse1: '',
|
|
|
+ position1: '',
|
|
|
+ warehouse2: '',
|
|
|
+ position2: '',
|
|
|
+ },
|
|
|
+ directFormRules: {
|
|
|
+ warehouse1: [
|
|
|
+ { required: true, message: '请选择调出仓库', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ position1: [
|
|
|
+ { required: true, message: '请选择调出仓位', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ warehouse2: [
|
|
|
+ { required: true, message: '请选择调入仓库', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ position2: [
|
|
|
+ { required: true, message: '请选择调入仓位', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ warehouseList1: [],
|
|
|
+ warehouseList2: [],
|
|
|
+ positionList1: [],
|
|
|
+ positionList2: [],
|
|
|
+ directGoodsList: [],
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -272,6 +365,8 @@ export default {
|
|
|
pageSize: -1,
|
|
|
}).then(res => {
|
|
|
this.warehouseList = res.data.records;
|
|
|
+ this.warehouseList1 = res.data.records;
|
|
|
+ this.warehouseList2 = res.data.records;
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -342,6 +437,85 @@ export default {
|
|
|
}).catch(() => {});
|
|
|
},
|
|
|
|
|
|
+ // 更改调出仓库
|
|
|
+ changeWarehouse1() {
|
|
|
+ this.directForm.position1 = '';
|
|
|
+ let obj = this.warehouseList1.find(o => o.id == this.directForm.warehouse1);
|
|
|
+ this.positionList1 = obj.kingDeeStocks;
|
|
|
+ this.directGoodsList.forEach(item => {
|
|
|
+ item.warehouse1 = obj.name;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 更改调入仓库
|
|
|
+ changeWarehouse2() {
|
|
|
+ this.directForm.position2 = '';
|
|
|
+ let obj = this.warehouseList2.find(o => o.id == this.directForm.warehouse2);
|
|
|
+ this.positionList2 = obj.kingDeeStocks;
|
|
|
+ this.directGoodsList.forEach(item => {
|
|
|
+ item.warehouse2 = obj.name;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 更改调出仓位
|
|
|
+ changePosition1() {
|
|
|
+ let obj = this.positionList1.find(o => o.id == this.directForm.position1);
|
|
|
+ this.directGoodsList.forEach(item => {
|
|
|
+ item.position1 = obj.name;
|
|
|
+ item.status1 = obj.defStockStatusName;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 更改调入仓位
|
|
|
+ changePosition2() {
|
|
|
+ let obj = this.positionList2.find(o => o.id == this.directForm.position2);
|
|
|
+ this.directGoodsList.forEach(item => {
|
|
|
+ item.position2 = obj.name;
|
|
|
+ item.status2 = obj.defStockStatusName;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 打开 提前开票
|
|
|
+ openDirectDialog() {
|
|
|
+ this.isShowDirectDialog = true;
|
|
|
+ this.directGoodsList = this.detailData.retailOrderItemList;
|
|
|
+ this.getWarehouseList();
|
|
|
+ },
|
|
|
+
|
|
|
+ // 关闭 提前开票
|
|
|
+ closeDirectDialog() {
|
|
|
+ this.isShowDirectDialog = false;
|
|
|
+ },
|
|
|
+
|
|
|
+ // 提交 提前开票
|
|
|
+ submitDirectForm() {
|
|
|
+ this.$refs.directForm.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ let warehouseItem1 = this.warehouseList1.find(o => o.id == this.directForm.warehouse1);
|
|
|
+ let positionItem1 = this.positionList1.find(o => o.id == this.directForm.position1);
|
|
|
+ let warehouseItem2 = this.warehouseList2.find(o => o.id == this.directForm.warehouse2);
|
|
|
+ let positionItem2 = this.positionList2.find(o => o.id == this.directForm.position2);
|
|
|
+ let params = {
|
|
|
+ orderNo: this.detailData.enginOrderId,
|
|
|
+ orderType: 'HOME', // TRADE=商用 HOME=家用 RETAIL=零售单 RETAIL_POLICY 销售政策单
|
|
|
+ correspondId: this.directForm.warehouse1,
|
|
|
+ correspondName: warehouseItem1.name,
|
|
|
+ stockId: this.directForm.position1,
|
|
|
+ stockName: positionItem1.name,
|
|
|
+ inCorrespondId: this.directForm.warehouse2,
|
|
|
+ inCorrespondName: warehouseItem2.name,
|
|
|
+ inStockId: this.directForm.position2,
|
|
|
+ inStockName: positionItem2.name,
|
|
|
+ }
|
|
|
+ directOrder(params).then(res => {
|
|
|
+ this.$successMsg();
|
|
|
+ this.isShowDirectDialog = false;
|
|
|
+ this.getDetail();
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|