|
@@ -3,62 +3,68 @@
|
|
|
<a-card size="small" :bordered="false" class="searchBoxNormal">
|
|
|
<!-- 搜索条件 -->
|
|
|
<div ref="tableSearch" class="table-page-search-wrapper">
|
|
|
- <a-form layout="inline" id="purchaseReceiptList-form" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
+ <a-form-model
|
|
|
+ layout="inline"
|
|
|
+ ref="ruleForm"
|
|
|
+ :model="queryParam"
|
|
|
+ :rules="rules"
|
|
|
+ id="purchaseReceiptList-form"
|
|
|
+ @keyup.enter.native="handleSearch">
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="创建时间">
|
|
|
+ <a-form-model-item label="创建时间" prop="time">
|
|
|
<rangeDate ref="rangeDate" id="purchaseReceiptList-time" @change="dateChange" />
|
|
|
- </a-form-item>
|
|
|
+ </a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="采购单号">
|
|
|
+ <a-form-model-item label="采购单号">
|
|
|
<a-input id="purchaseReceiptList-sparePartsNo" v-model.trim="queryParam.sparePartsNo" allowClear placeholder="请输入采购单号"/>
|
|
|
- </a-form-item>
|
|
|
+ </a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="供应商名称">
|
|
|
+ <a-form-model-item label="供应商名称">
|
|
|
<supplier id="purchaseReceiptList-supplierSn" v-model="queryParam.supplierSn" isPermission placeholder="请输入供应商名称"></supplier>
|
|
|
- </a-form-item>
|
|
|
+ </a-form-model-item>
|
|
|
</a-col>
|
|
|
<template v-if="advanced">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="客户名称">
|
|
|
+ <a-form-model-item label="客户名称">
|
|
|
<custList ref="custList" id="purchaseReceiptList-buyerSn" @change="custChange"></custList>
|
|
|
- </a-form-item>
|
|
|
+ </a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="关联单号">
|
|
|
- <a-input id="purchaseReceiptList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入关联单号"/>
|
|
|
- </a-form-item>
|
|
|
+ <a-form-model-item label="关联单号">
|
|
|
+ <a-input id="purchaseReceiptList-relationNo" v-model.trim="queryParam.relationNo" allowClear placeholder="请输入关联单号"/>
|
|
|
+ </a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="业务状态">
|
|
|
+ <a-form-model-item label="业务状态">
|
|
|
<v-select
|
|
|
v-model="queryParam.state"
|
|
|
ref="state"
|
|
|
- id="purchaseReceiptList-serviceState"
|
|
|
+ id="purchaseReceiptList-state"
|
|
|
code="PURCHASE_STATE"
|
|
|
placeholder="请选择业务状态"
|
|
|
allowClear
|
|
|
></v-select>
|
|
|
- </a-form-item>
|
|
|
+ </a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="供应商状态">
|
|
|
+ <a-form-model-item label="供应商状态">
|
|
|
<v-select
|
|
|
- v-model="queryParam.state"
|
|
|
- ref="state"
|
|
|
- id="purchaseReceiptList-state"
|
|
|
+ v-model="queryParam.thirdpartyBizState"
|
|
|
+ ref="thirdpartyBizState"
|
|
|
+ id="purchaseReceiptList-thirdpartyBizState"
|
|
|
code="THIRD_PARTY_BIZ_STATE"
|
|
|
placeholder="请选择供应商状态"
|
|
|
allowClear
|
|
|
></v-select>
|
|
|
- </a-form-item>
|
|
|
+ </a-form-model-item>
|
|
|
</a-col>
|
|
|
</template>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<span class="table-page-search-submitButtons">
|
|
|
- <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseReceiptList-refresh">查询</a-button>
|
|
|
+ <a-button type="primary" @click="handleSearch" :disabled="disabled" id="purchaseReceiptList-refresh">查询</a-button>
|
|
|
<a-button style="margin-left: 10px" @click="resetSearchForm()" :disabled="disabled" id="purchaseReceiptList-reset">重置</a-button>
|
|
|
<a @click="advanced=!advanced" style="margin-left: 8px">
|
|
|
{{ advanced ? '收起' : '展开' }}
|
|
@@ -67,7 +73,7 @@
|
|
|
</span>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
- </a-form>
|
|
|
+ </a-form-model>
|
|
|
</div>
|
|
|
</a-card>
|
|
|
<a-card size="small" :bordered="false" class="purchaseReceiptList-wrap">
|
|
@@ -166,12 +172,13 @@
|
|
|
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
+import moment from 'moment'
|
|
|
+import getDate from '@/libs/getDate.js'
|
|
|
// 组件
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
import custList from '@/views/common/custList.vue'
|
|
|
import supplier from '@/views/common/supplier.js'
|
|
|
-import warehouse from '@/views/common/chooseWarehouse.js'
|
|
|
import reviewModal from './reviewModal.vue'
|
|
|
import detailModal from './detailModal.vue'
|
|
|
import uploadVoucherModal from './uploadVoucherModal.vue'
|
|
@@ -180,7 +187,7 @@ import { purchaseList, purchasePageCount, purchaseCancel, purchaseAudit } from '
|
|
|
export default {
|
|
|
name: 'PurchaseReceiptList',
|
|
|
mixins: [commonMixin],
|
|
|
- components: { STable, supplier, VSelect, custList, rangeDate, warehouse, reviewModal, detailModal, uploadVoucherModal },
|
|
|
+ components: { STable, supplier, VSelect, custList, rangeDate, reviewModal, detailModal, uploadVoucherModal },
|
|
|
data () {
|
|
|
return {
|
|
|
spinning: false,
|
|
@@ -189,14 +196,16 @@ export default {
|
|
|
advanced: true, // 高级搜索 展开/关闭
|
|
|
// 查询参数
|
|
|
queryParam: {
|
|
|
- beginDate: undefined,
|
|
|
- endDate: undefined,
|
|
|
-
|
|
|
- sparePartsReturnNo: undefined,
|
|
|
- supplierSn: undefined,
|
|
|
- returnReason: undefined,
|
|
|
- warehouseSn: undefined, // 仓库
|
|
|
- state: undefined
|
|
|
+ time: [ moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
|
|
|
+ moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')],
|
|
|
+ beginDate: getDate.getThreeMonthDays().starttime, // 创建开始时间
|
|
|
+ endDate: getDate.getCurrMonthDays().endtime, // 创建结束时间
|
|
|
+ sparePartsNo: undefined, // 采购单号
|
|
|
+ supplierSn: undefined, // 供应商名称
|
|
|
+ buyerSn: undefined, // 客户名称
|
|
|
+ relationNo: undefined, // 关联单号
|
|
|
+ state: undefined, // 业务状态
|
|
|
+ thirdpartyBizState: undefined// 供应商状态
|
|
|
},
|
|
|
openReviewModal: false, // 审核弹窗
|
|
|
openVoucherModal: false, // 上传凭证
|
|
@@ -208,13 +217,15 @@ export default {
|
|
|
this.disabled = true
|
|
|
this.spinning = true
|
|
|
const params = Object.assign(parameter, this.queryParam)
|
|
|
+ const newParams = JSON.parse(JSON.stringify(params))
|
|
|
+ delete newParams.time
|
|
|
// 获取列表数据 有分页
|
|
|
- return purchaseList(params).then(res => {
|
|
|
+ return purchaseList(newParams).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
|
data = res.data
|
|
|
// 获取统计数据
|
|
|
- this.getCount(params)
|
|
|
+ this.getCount(newParams)
|
|
|
// 计算列表序号
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
@@ -225,6 +236,9 @@ export default {
|
|
|
this.spinning = false
|
|
|
return data
|
|
|
})
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ 'time': [{ required: true, message: '请选择创建时间', trigger: 'change' }]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -241,7 +255,7 @@ export default {
|
|
|
{ title: '采购金额', dataIndex: 'productTotalCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
|
|
|
{ title: '入库仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
{ title: '关联单号', dataIndex: 'lockBizNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '客户名称', dataIndex: 'shippingAddr', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '客户名称', dataIndex: 'supplierName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
{ title: '业务状态', dataIndex: 'stateDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
{ title: '供应商状态', dataIndex: 'thirdpartyBizStateDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
{ title: '备注', dataIndex: 'remark', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
@@ -254,8 +268,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- // <!-- state 取消 CANCEL 待提交 WAIT_SUBMIT 待审核 WAIT_AUDIT 待入库 WAIT_PUT 已完结 FINISH 审核通过 PASS 审核不通过 REJECT -->
|
|
|
- // <!-- thirdpartyBizState 审核通过 AUDIT_PASS 审核不通过 AUDIT_REJECT 已取消 CANCEL 已出库 FINISH 待审核 WAIT_AUDIT 待发货 WAIT_RECEIVE -->
|
|
|
// 是否显示取消按钮
|
|
|
isShowCancelBtn (row) {
|
|
|
const res = ((row.state === 'WAIT_SUBMIT' || row.state === 'WAIT_AUDIT' || row.state === 'REJECT') && !row.thirdpartyBizState) || (row.state === 'PASS' && row.thirdpartyBizState === 'WAIT_AUDIT') || (row.state === 'PASS' && row.thirdpartyBizState === 'AUDIT_PASS')
|
|
@@ -278,8 +290,25 @@ export default {
|
|
|
},
|
|
|
// 创建时间
|
|
|
dateChange (date) {
|
|
|
- this.queryParam.beginDate = date[0]
|
|
|
- this.queryParam.endDate = date[1]
|
|
|
+ if (date[0] && date[1]) {
|
|
|
+ this.queryParam.time = date
|
|
|
+ } else {
|
|
|
+ this.queryParam.time = []
|
|
|
+ }
|
|
|
+ this.queryParam.beginDate = date[0] || undefined
|
|
|
+ this.queryParam.endDate = date[1] || undefined
|
|
|
+ },
|
|
|
+ // 查询
|
|
|
+ handleSearch () {
|
|
|
+ const _this = this
|
|
|
+ this.$refs.ruleForm.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ _this.$refs.table.refresh(true)
|
|
|
+ } else {
|
|
|
+ _this.$message.error('请选择创建时间')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 获取统计数据
|
|
|
getCount (params) {
|
|
@@ -366,17 +395,22 @@ export default {
|
|
|
},
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
- this.queryParam = {
|
|
|
- beginDate: undefined,
|
|
|
- endDate: undefined,
|
|
|
- sparePartsReturnNo: undefined,
|
|
|
- supplierSn: undefined,
|
|
|
- returnReason: undefined,
|
|
|
- warehouseSn: undefined, // 仓库
|
|
|
- state: undefined
|
|
|
- }
|
|
|
+ this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
|
|
|
+ this.queryParam.endDate = getDate.getCurrMonthDays().endtime
|
|
|
+ this.queryParam.time = [
|
|
|
+ getDate.getThreeMonthDays().starttime,
|
|
|
+ getDate.getCurrMonthDays().endtime
|
|
|
+ ]
|
|
|
+ this.$refs.rangeDate.resetDate(this.queryParam.time)
|
|
|
+ this.queryParam.sparePartsNo = undefined
|
|
|
+ this.queryParam.supplierSn = undefined
|
|
|
+ this.queryParam.buyerSn = undefined
|
|
|
+ this.queryParam.relationNo = undefined
|
|
|
+ this.queryParam.state = undefined
|
|
|
+ this.queryParam.thirdpartyBizState = undefined
|
|
|
+ this.itemSn = null
|
|
|
this.$refs.custList.resetForm()
|
|
|
- this.$refs.rangeDate.resetDate()
|
|
|
+ this.$refs.ruleForm.resetFields()
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 初始化数据
|
|
@@ -385,11 +419,6 @@ export default {
|
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
_this.setTableH()
|
|
|
})
|
|
|
- this.openModal = false
|
|
|
- // this.openDetailModal = false
|
|
|
- this.itemSn = null
|
|
|
- this.rowSelectionInfo = null
|
|
|
- this.$refs.table.clearTable()
|
|
|
},
|
|
|
// 计算表格高度
|
|
|
setTableH () {
|