|
@@ -100,6 +100,12 @@
|
|
|
>生成采购</el-button>
|
|
|
<el-button
|
|
|
type="text"
|
|
|
+ size="small"
|
|
|
+ @click="customerReceipt(scope.row)"
|
|
|
+ :disabled="!scope.row.status || scope.row.status < 3 || scope.row.createFreight == 1"
|
|
|
+ >客户收货</el-button>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
icon="el-icon-delete"
|
|
|
size="small"
|
|
|
@click.stop="rowDel(scope.row,scope.index)"
|
|
@@ -121,7 +127,9 @@
|
|
|
|
|
|
<script>
|
|
|
import option from "./configuration/mainList.json";
|
|
|
-import {customerList, typeSave, deleteDetails, saveSell,detail} from "@/api/basicData/configuration"
|
|
|
+import {customerList,
|
|
|
+ typeSave, deleteDetails,
|
|
|
+ saveSell,detail, generateShipment} from "@/api/basicData/configuration"
|
|
|
import detailPage from "./detailsPageEdit";
|
|
|
import search from "../../../page/index/search";
|
|
|
import { defaultDate } from "@/util/date";
|
|
@@ -588,6 +596,47 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ customerReceipt(row) {
|
|
|
+ if (this.$store.getters.inStatus) {
|
|
|
+ this.$alert("客户收货存在,请保存客户收货再进行操作", "温馨提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ type: "warning",
|
|
|
+ callback: action => {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ let arr = []
|
|
|
+ this.openFullScreen(false, '正在生成客户收货...');
|
|
|
+ detail(row.id).then(res => {
|
|
|
+ arr = res.data.data.orderItemsList? res.data.data.orderItemsList: [];
|
|
|
+ if (arr.length === 0) return this.$message.error('该单子明细为空,不能生成客户收货')
|
|
|
+ let ids = [];
|
|
|
+ arr.forEach(item => ids.push(item.id));
|
|
|
+ generateShipment({id: row.id, orderItemIds: ids}).then(res => {
|
|
|
+ this.$router.$avueRouter.closeTag("/businessManagement/deliveryNotice/index");
|
|
|
+ this.$router.push({
|
|
|
+ path: "/businessManagement/deliveryNotice/index",
|
|
|
+ query: {
|
|
|
+ form: JSON.stringify(res.data.data),
|
|
|
+ pageType: "Generate",
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }).finally(() => {
|
|
|
+ this.openFullScreen(true);
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //遮罩层
|
|
|
+ openFullScreen(res, text) {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: text,
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
+ if (res === true) loading.close();
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|