|
@@ -1,6 +1,7 @@
|
|
|
|
|
|
|
|
|
<script>
|
|
|
+import test from "@/components/form-test/index.vue";
|
|
|
import query from "@/components/query/index.vue";
|
|
|
import sendGoods from "./sendGoods.vue";
|
|
|
import * as API from "@/api/purchase-management/deliver-goods/index.js";
|
|
@@ -9,6 +10,7 @@ export default {
|
|
|
components: {
|
|
|
query,
|
|
|
sendGoods,
|
|
|
+ test,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -50,18 +52,41 @@ export default {
|
|
|
prop: "type",
|
|
|
data: [],
|
|
|
},
|
|
|
+ {
|
|
|
+ label: "付款状态",
|
|
|
+ prop: "type",
|
|
|
+ data: [],
|
|
|
+ },
|
|
|
],
|
|
|
tableList: [{}],
|
|
|
+ total: 0,
|
|
|
loading: false,
|
|
|
titleText: "",
|
|
|
open: false,
|
|
|
form: {
|
|
|
+ businessId: "",
|
|
|
+ businessType: "1",
|
|
|
+ logisticsCompanyCode: "",
|
|
|
+ code: "",
|
|
|
+ details: [],
|
|
|
+ fileInfos: [],
|
|
|
+ },
|
|
|
+ openArrive: false,
|
|
|
+ arriveForm: {
|
|
|
+ name: "",
|
|
|
id: "",
|
|
|
- receiptWarehouseId: "",
|
|
|
- planArrivalTime: "",
|
|
|
- cause: "",
|
|
|
- goodsId: [],
|
|
|
+ code: "",
|
|
|
},
|
|
|
+ arriveFormRules: {
|
|
|
+ id: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择物流/快递单号",
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+
|
|
|
selectData: [],
|
|
|
};
|
|
|
},
|
|
@@ -96,7 +121,7 @@ export default {
|
|
|
this.loading = false;
|
|
|
},
|
|
|
(err) => {
|
|
|
- console.log("purchaseList: " + err);
|
|
|
+ console.log("deliveryList: " + err);
|
|
|
this.loading = false;
|
|
|
}
|
|
|
);
|
|
@@ -109,35 +134,48 @@ export default {
|
|
|
},
|
|
|
handleSend(row) {
|
|
|
this.form = {
|
|
|
- purchaseId: "",
|
|
|
+ businessId: "",
|
|
|
+ businessType: "1",
|
|
|
+ logisticsCompanyCode: "",
|
|
|
code: "",
|
|
|
- details: [
|
|
|
- { purchaseId: "", applyPurchaseId: "", shipmentQuantity: "" },
|
|
|
- ],
|
|
|
+ details: [],
|
|
|
fileInfos: [],
|
|
|
};
|
|
|
- this.titleText = "发货";
|
|
|
+ this.titleText = "发货通知";
|
|
|
this.open = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.sendGoods.loading = true;
|
|
|
+ API.logisticsSelectData({ id: row.id }).then(
|
|
|
+ (res) => {
|
|
|
+ console.log(res, "aa");
|
|
|
+ this.$refs.sendGoods.loading = false;
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ this.$refs.sendGoods.loading = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
handleCancel() {
|
|
|
this.form = {
|
|
|
- purchaseId: "",
|
|
|
+ businessId: "",
|
|
|
+ businessType: "1",
|
|
|
+ logisticsCompanyCode: "",
|
|
|
code: "",
|
|
|
- details: [
|
|
|
- { purchaseId: "", applyPurchaseId: "", shipmentQuantity: "" },
|
|
|
- ],
|
|
|
+ details: [],
|
|
|
fileInfos: [],
|
|
|
};
|
|
|
this.open = false;
|
|
|
},
|
|
|
handleSubmit() {
|
|
|
- API.deliveryAdd(this.form).then(
|
|
|
+ API.deliveryNotice(this.form).then(
|
|
|
() => {
|
|
|
this.msgSuccess(this.$t("addSuccess"));
|
|
|
this.$refs.sendGoods.loading = false;
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
+ this.handleCancel();
|
|
|
},
|
|
|
(err) => {
|
|
|
console.log("sendPurchase: " + err);
|
|
@@ -145,35 +183,63 @@ export default {
|
|
|
}
|
|
|
);
|
|
|
},
|
|
|
- handleComplete(row) {
|
|
|
- this.$confirm(this.$t("askDeleteData"), {
|
|
|
+ handleArrive(row) {
|
|
|
+ this.titleText = "到货通知";
|
|
|
+ this.openArrive = true;
|
|
|
+ // this.$confirm(this.$t("askDeleteData"), {
|
|
|
+ // confirmButtonText: this.$t("submitText"),
|
|
|
+ // cancelButtonText: this.$t("cancelText"),
|
|
|
+ // type: "warning",
|
|
|
+ // }).then(() => {
|
|
|
+ // API.completePurchase({ id: row.id }).then(() => {
|
|
|
+ // this.msgSuccess(this.$t("deleteSuccess"));
|
|
|
+ // this.getList();
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ handlePurchaseEnd(row) {
|
|
|
+ this.$confirm("是否确定此操作 ?", {
|
|
|
confirmButtonText: this.$t("submitText"),
|
|
|
cancelButtonText: this.$t("cancelText"),
|
|
|
type: "warning",
|
|
|
}).then(() => {
|
|
|
- API.completePurchase({ id: row.id }).then(() => {
|
|
|
+ API.purchaseEnd({ id: row.id }).then(() => {
|
|
|
this.msgSuccess(this.$t("deleteSuccess"));
|
|
|
this.getList();
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
- handleSeeDeatils(row) {
|
|
|
- API.purchaseDetails({ id: row.id }).then((res) => {
|
|
|
- console.log(res, "ssde");
|
|
|
- });
|
|
|
- },
|
|
|
- handleDelete(row) {
|
|
|
- this.$confirm(this.$t("askDeleteData"), {
|
|
|
+ handlePurchaseCancel(row) {
|
|
|
+ this.$confirm("是否确定此操作 ?", {
|
|
|
confirmButtonText: this.$t("submitText"),
|
|
|
cancelButtonText: this.$t("cancelText"),
|
|
|
type: "warning",
|
|
|
}).then(() => {
|
|
|
- API.purchaseDel({ id: row.id }).then(() => {
|
|
|
+ API.purchaseCancel({ id: row.id }).then(() => {
|
|
|
this.msgSuccess(this.$t("deleteSuccess"));
|
|
|
this.getList();
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ handleSubmit1() {
|
|
|
+ this.$refs.arriveForm.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ API.arrivalNotice({ id: row.id }).then(() => {
|
|
|
+ this.msgSuccess("操作成功");
|
|
|
+ this.getList();
|
|
|
+ this.handleCancel1();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleCancel1() {
|
|
|
+ this.openArrive = false;
|
|
|
+ this.arriveForm = {
|
|
|
+ id: "",
|
|
|
+ name: "",
|
|
|
+ code: "",
|
|
|
+ };
|
|
|
+ },
|
|
|
isSelectable(row) {
|
|
|
if (row.status != 30) {
|
|
|
return false;
|
|
@@ -198,7 +264,7 @@ export default {
|
|
|
<el-card class="box-card">
|
|
|
<query
|
|
|
:selectConfig="selectConfig"
|
|
|
- :req="queryParams"
|
|
|
+ :req=" queryParams"
|
|
|
:isShowMore="false"
|
|
|
@handleQuery="handleQuery"
|
|
|
@handleMore="
|
|
@@ -210,14 +276,8 @@ export default {
|
|
|
<el-table
|
|
|
:data="tableList"
|
|
|
v-loading="loading"
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
>
|
|
|
- <el-table-column
|
|
|
- type="selection"
|
|
|
- width="50"
|
|
|
- align="center"
|
|
|
- :selectable="isSelectable"
|
|
|
- >
|
|
|
+
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
label="采购单号"
|
|
@@ -225,55 +285,53 @@ export default {
|
|
|
prop="code"
|
|
|
width="150"
|
|
|
>
|
|
|
- <template slot-scope="scope">
|
|
|
- <span style="color: #0084ff; cursor: pointer">
|
|
|
- {{ scope.row.code }}
|
|
|
- </span>
|
|
|
- </template>
|
|
|
+
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="总金额" align="center" prop="price" />
|
|
|
+ <el-table-column label="供应商" align="center" prop="price" />
|
|
|
+
|
|
|
+ <el-table-column label="采购总金额" align="center" prop="price" />
|
|
|
+ <el-table-column label="采购员" align="center" prop="createName" />
|
|
|
+
|
|
|
<el-table-column
|
|
|
- label="要求到货时间"
|
|
|
+ label="采购时间"
|
|
|
align="center"
|
|
|
prop="createTime"
|
|
|
width="160"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- label="采购状态"
|
|
|
+ label="状态"
|
|
|
align="center"
|
|
|
:formatter="(row) => dictDataEcho(row.status, purchaseStatusList)"
|
|
|
/>
|
|
|
- <el-table-column label="采购人" align="center" prop="createName" />
|
|
|
+ <el-table-column label="付款状态" align="center" prop="createName" />
|
|
|
|
|
|
- <el-table-column :label="$t('operation')" align="center" width="120">
|
|
|
+ <el-table-column :label="$t('operation')" align="center" width="240">
|
|
|
<!-- v-if="scope.row.status === 30" -->
|
|
|
<template slot-scope="scope">
|
|
|
<el-button type="text" @click="handleSend(scope.row)"
|
|
|
- >发货
|
|
|
+ > 发货通知
|
|
|
+ </el-button>
|
|
|
+ <el-button type="text" @click="handleArrive(scope.row)"
|
|
|
+ >到货通知
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- v-if="scope.row.status === 40"
|
|
|
- @click="handleComplete(scope.row)"
|
|
|
- >完成采购
|
|
|
+ <el-button type="text" @click="handlePurchaseEnd(scope.row)"
|
|
|
+ >结束
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- v-if="scope.row.status === 50"
|
|
|
- @click="handleSeeDeatils(scope.row)"
|
|
|
- >查看
|
|
|
+ <el-button type="text" @click="handlePurchaseCancel(scope.row)"
|
|
|
+ >取消
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</el-card>
|
|
|
|
|
|
- <el-dialog
|
|
|
+ <el-dialog
|
|
|
:title="titleText"
|
|
|
:visible.sync="open"
|
|
|
v-if="open"
|
|
|
width="80%"
|
|
|
- top="60px"
|
|
|
+
|
|
|
+ top="60px"
|
|
|
>
|
|
|
<send-goods
|
|
|
:form="form"
|
|
@@ -282,6 +340,78 @@ export default {
|
|
|
ref="sendGoods"
|
|
|
></send-goods>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog title="到货通知"
|
|
|
+ :visible.sync="openArrive"
|
|
|
+ v-if="openArrive"
|
|
|
+ width="30%"
|
|
|
+
|
|
|
+ top="60px">
|
|
|
+ <el-form
|
|
|
+ label-position="top"
|
|
|
+ :model="arriveForm"
|
|
|
+ ref="arriveForm"
|
|
|
+ :rules="arriveFormRules"
|
|
|
+ label-width="100px"
|
|
|
+ >
|
|
|
+ <el-row >
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="采购单号" prop="code">
|
|
|
+ <el-input
|
|
|
+ v-model="arriveForm.code"
|
|
|
+ :placeholder="$t('pleaseInput')"
|
|
|
+ disabled
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+ <el-form-item label="供应商" prop="name">
|
|
|
+ <el-input
|
|
|
+ v-model="arriveForm.name"
|
|
|
+ :placeholder="$t('pleaseInput')"
|
|
|
+ disabled
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-row >
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="物流/快递单号" prop="id">
|
|
|
+ <el-select
|
|
|
+ v-model="arriveForm.id"
|
|
|
+ :placeholder="$t('pleaseSelect')"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in logisticsData"
|
|
|
+ :key="item.code"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.code"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <div style="text-align: center; margin-top: 15px">
|
|
|
+ <el-button size="small" @click="handleCancel1"
|
|
|
+ >{{ $t("cancel") }}
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" size="small" @click="handleSubmit1">
|
|
|
+ {{ $t("submit") }}</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|