|
@@ -1,6 +1,5 @@
|
|
|
<!-- 采购订单修订—— 列表 -->
|
|
|
<script>
|
|
|
-// import { TableColumns, SearchColumns, TabColumns, SelectColumns } from "./column";
|
|
|
import { judgeColumns, SearchColumns } from "./column";
|
|
|
import orderApi from "@/api/business/purchase/purchase-order";
|
|
|
import {
|
|
@@ -20,7 +19,6 @@ TabColumns.forEach((column) => {
|
|
|
|
|
|
export default {
|
|
|
name: "PuchaseOrder",
|
|
|
- // dicts: initDicts(SelectColumns),
|
|
|
dicts: [...initDicts(allColumns), "oa_templete_id"],
|
|
|
components: {
|
|
|
AddDrawer: () => import("./add/index.vue"),
|
|
@@ -50,7 +48,6 @@ export default {
|
|
|
page: page,
|
|
|
searchColumns: SearchColumns,
|
|
|
params: initParams(SearchColumns),
|
|
|
- // tableColumns: TableColumns,
|
|
|
tableColumns: Columns,
|
|
|
tableData: [],
|
|
|
tabColumns: initTabColumns(),
|
|
@@ -67,73 +64,6 @@ export default {
|
|
|
timer: 300,
|
|
|
timeOut: null,
|
|
|
size: "mini",
|
|
|
- candidate: [
|
|
|
- {
|
|
|
- item: {
|
|
|
- key: "orderCode",
|
|
|
- title: "订单编号",
|
|
|
- },
|
|
|
- attr: {
|
|
|
- clearable: true,
|
|
|
- is: "el-input",
|
|
|
- placeholder: "请输入订单编号,多个使用,隔开",
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- item: {
|
|
|
- key: "materialCode",
|
|
|
- title: "物料编码",
|
|
|
- },
|
|
|
- attr: {
|
|
|
- clearable: true,
|
|
|
- is: "el-input",
|
|
|
- placeholder: "请输入物料编码,多个使用,隔开",
|
|
|
- // is: "el-popover-multiple-select-v2",
|
|
|
- // valueKey: "code",
|
|
|
- // referName: "MATERIAL_PARAM",
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- item: {
|
|
|
- key: "date",
|
|
|
- title: "订单日期",
|
|
|
- },
|
|
|
- attr: {
|
|
|
- clearable: true,
|
|
|
- is: "el-date-picker",
|
|
|
- type: "daterange",
|
|
|
- unlinkPanels: true,
|
|
|
- rangeSeparator: "至",
|
|
|
- valueFormat: "yyyy-MM-dd",
|
|
|
- endPlaceholder: "结束日期",
|
|
|
- startPlaceholder: "开始日期",
|
|
|
- value: [],
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- item: {
|
|
|
- key: "puOrgIds",
|
|
|
- title: "采购组织",
|
|
|
- },
|
|
|
- attr: {
|
|
|
- clearable: true,
|
|
|
- is: "el-popover-multiple-select-v2",
|
|
|
- valueKey: "id",
|
|
|
- referName: "ORG_PARAM",
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- item: {
|
|
|
- key: "source",
|
|
|
- title: "订单来源",
|
|
|
- },
|
|
|
- attr: {
|
|
|
- clearable: true,
|
|
|
- is: "el-select",
|
|
|
- dictName: "order_source",
|
|
|
- },
|
|
|
- },
|
|
|
- ],
|
|
|
};
|
|
|
},
|
|
|
|
|
@@ -160,7 +90,6 @@ export default {
|
|
|
if (this.$route.query.billCode)
|
|
|
this.params.orderCode = this.$route.query.billCode;
|
|
|
this.fetchList(this.params, this.page);
|
|
|
- // this.handleRefreshList();
|
|
|
},
|
|
|
methods: {
|
|
|
async fetchList(data, params) {
|
|
@@ -251,9 +180,6 @@ export default {
|
|
|
|
|
|
// 刷新操作
|
|
|
handleRefreshList() {
|
|
|
- // this.page.pageNum = 1;
|
|
|
-
|
|
|
- // this.page.pageSize = 10;
|
|
|
this.page = this.$init.page();
|
|
|
this.$refs.purchaseTable.$refs.superTable &&
|
|
|
this.$refs.purchaseTable.$refs.superTable.clearSelection();
|
|
@@ -289,10 +215,6 @@ export default {
|
|
|
|
|
|
copyVal.id && copyVal.id != "" && setCopyParams(copyVal.id);
|
|
|
},
|
|
|
- // 复制
|
|
|
- handleCopy() {
|
|
|
- this.handleOpenAddDrawer(this.checkedList[0]);
|
|
|
- },
|
|
|
// 查看
|
|
|
async handleOpenSeeDrawer(row) {
|
|
|
window.clearInterval(this.timeOut);
|
|
@@ -481,75 +403,6 @@ export default {
|
|
|
this.fetchList(this.params, this.page);
|
|
|
}
|
|
|
},
|
|
|
- // 判断“整单退回”按钮
|
|
|
- judgeIsAllReturn() {
|
|
|
- if (this.checkedList.length == 1) {
|
|
|
- // 非手工、状态:自由/驳回
|
|
|
- if (this.judgeIsOption("return", this.checkedList[0])) {
|
|
|
- // if (this.checkedList[0].source != 3 &&
|
|
|
- // (this.checkedList[0].status == 0 || this.checkedList[0].status == 3)
|
|
|
- // ) {
|
|
|
-
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- return true;
|
|
|
- },
|
|
|
- // 整单退回
|
|
|
- handleAllReturn() {
|
|
|
- this.handleReturn(this.checkedList[0].id, []);
|
|
|
- },
|
|
|
- // 判断“行退回”按钮
|
|
|
- judgeIsLineReturn() {
|
|
|
- if (this.checkedTabList.length == 1) {
|
|
|
- // 主信息:非手工、状态:自由/驳回
|
|
|
- if (this.judgeIsOption("return", this.primaryResource)) {
|
|
|
- // if(this.primaryResource.source != 3 &&
|
|
|
- // (this.primaryResource.status == 0 || this.primaryResource.status == 3) ){
|
|
|
-
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- return true;
|
|
|
- },
|
|
|
- // 行退回
|
|
|
- handleLineReturn() {
|
|
|
- let ids = this.checkedTabList.map((checked) => checked.id);
|
|
|
-
|
|
|
- console.log(ids, "行退回ids");
|
|
|
-
|
|
|
- this.handleReturn(this.primaryResource.id, ids);
|
|
|
- },
|
|
|
- // 退回接口
|
|
|
- handleReturn(id, documentIds) {
|
|
|
- this.$prompt("请输入退回原因", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- inputPattern: /\s*\S+?/,
|
|
|
- inputErrorMessage: "退回原因不能为空",
|
|
|
- })
|
|
|
- .then(async ({ value }) => {
|
|
|
- let data = {
|
|
|
- id: Number(id),
|
|
|
-
|
|
|
- documentIds: documentIds.map((ids) => Number(ids)),
|
|
|
-
|
|
|
- baskCause: value,
|
|
|
- };
|
|
|
-
|
|
|
- try {
|
|
|
- let { code, msg } = await orderApi.documentsReturn(data);
|
|
|
-
|
|
|
- if (code === 200) {
|
|
|
- this.handleRefreshList();
|
|
|
- }
|
|
|
- this.$notify.success({
|
|
|
- message: msg,
|
|
|
- });
|
|
|
- } catch (error) {}
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
- },
|
|
|
|
|
|
// 付款协议
|
|
|
async handlePaymentRequest() {
|
|
@@ -566,16 +419,6 @@ export default {
|
|
|
}
|
|
|
} catch (error) {}
|
|
|
},
|
|
|
- // 退货
|
|
|
- async handlePurchaseReturn() {
|
|
|
- const { id } = this.checkedList[0];
|
|
|
-
|
|
|
- const { setVisible, fetchStorage } = this.$refs.PurchaseReturnDrawerRef;
|
|
|
-
|
|
|
- await setVisible(true);
|
|
|
-
|
|
|
- await fetchStorage(id);
|
|
|
- },
|
|
|
// 主表Select框
|
|
|
handleSelect(selection, row) {
|
|
|
this.checkedList = selection;
|
|
@@ -712,7 +555,7 @@ export default {
|
|
|
<el-button
|
|
|
:size="size"
|
|
|
:disabled="checkedList.length != 1"
|
|
|
- @click="handleCopy"
|
|
|
+ @click="handleOpenAddDrawer(checkedList[0])"
|
|
|
>复制</el-button
|
|
|
>
|
|
|
<el-button :size="size" @click="handleBatchSubmit"
|
|
@@ -724,12 +567,6 @@ export default {
|
|
|
style="margin-left: 10px"
|
|
|
:key="checkedList.length + 1"
|
|
|
>
|
|
|
- <!-- <el-button
|
|
|
- :size="size"
|
|
|
- @click="handleAllReturn"
|
|
|
- :disabled="judgeIsAllReturn()"
|
|
|
- >整单退回</el-button
|
|
|
- > -->
|
|
|
<th-button
|
|
|
:size="size"
|
|
|
:main-data="checkedList"
|
|
@@ -743,11 +580,6 @@ export default {
|
|
|
</el-button-group>
|
|
|
|
|
|
<el-button-group style="margin: 0 10px">
|
|
|
- <!-- <el-button size="mini"
|
|
|
- :disabled="!(checkedList.length == 1 && checkedList[0].deliveryStatus == '0')"
|
|
|
- :key="checkedList.length"
|
|
|
- @click="handlePurchaseReturn"
|
|
|
- >采购退货</el-button> -->
|
|
|
<el-button :size="size" @click="handlePaymentRequest"
|
|
|
>付款申请</el-button
|
|
|
>
|
|
@@ -870,12 +702,6 @@ export default {
|
|
|
:subtabulation="checkedTabList"
|
|
|
@success="handleRefreshList"
|
|
|
></th-button>
|
|
|
- <!-- <el-button
|
|
|
- :size="size"
|
|
|
- @click="handleLineReturn"
|
|
|
- :disabled="judgeIsLineReturn()"
|
|
|
- >行退回</el-button
|
|
|
- > -->
|
|
|
<hgb-button
|
|
|
:select-data="checkedTabList"
|
|
|
:size="size"
|
|
@@ -919,12 +745,3 @@ export default {
|
|
|
</div>
|
|
|
</el-card>
|
|
|
</template>
|
|
|
-
|
|
|
-<!-- <style scoped>
|
|
|
->>> .el-message-box__content {
|
|
|
- max-height: 350px;
|
|
|
- overflow-y: scroll;
|
|
|
- overflow-x: auto;
|
|
|
- box-sizing: border-box;
|
|
|
-}
|
|
|
-</style> -->
|