|
@@ -1,49 +1,15 @@
|
|
|
<!-- 生产记录 -->
|
|
|
<template>
|
|
|
<div class="production">
|
|
|
- <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
|
|
|
- <el-form-item label="采购编码">
|
|
|
- <el-input v-model="dataForm.purchaseCode" placeholder="采购编码" clearable/>
|
|
|
+ <el-form :inline="true" :model="dataForm" @keyup.enter.native="queryPage()">
|
|
|
+ <el-form-item label="订单编号">
|
|
|
+ <el-input v-model="dataForm.orderCode" placeholder="订单编号" clearable/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="说明">
|
|
|
- <el-input v-model="dataForm.notes" placeholder="说明" clearable/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="类别">
|
|
|
- <el-select
|
|
|
- v-model="dataForm.purchaseType"
|
|
|
- remote
|
|
|
- placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in optionsType"
|
|
|
- :key="item.code"
|
|
|
- :label="item.value"
|
|
|
- :value="item.code">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="申请日期">
|
|
|
- <el-date-picker
|
|
|
- v-model="dataForm.applyDate"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- type="date">
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="状态">
|
|
|
- <el-select
|
|
|
- v-model="dataForm.purchaseState"
|
|
|
- remote
|
|
|
- placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in optionsState"
|
|
|
- :key="item.code"
|
|
|
- :label="item.value"
|
|
|
- :value="item.code">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <el-form-item label="产品名称">
|
|
|
+ <el-input v-model="dataForm.productName" placeholder="产品名称" clearable/>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button @click="search()">查询</el-button>
|
|
|
- <el-button type="primary" @click="addOrUpdateHandle(0, false)">新建采购申请</el-button>
|
|
|
+ <el-button @click="queryPage()">查询</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<el-table
|
|
@@ -58,61 +24,28 @@
|
|
|
align="center">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="purchaseCode"
|
|
|
- header-align="center"
|
|
|
- align="center"
|
|
|
- min-width="100"
|
|
|
- label="采购编码">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="materialName"
|
|
|
+ prop="productName"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
- min-width="120"
|
|
|
- label="物品名称">
|
|
|
+ label="产品名称">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="purchaseType"
|
|
|
+ prop="prodCode"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
- :formatter="formatType"
|
|
|
- label="采购类别">
|
|
|
+ label="产品编号">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="createTime"
|
|
|
+ prop="orderCode"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
- min-width="160"
|
|
|
- label="申请时间">
|
|
|
+ label="订单编号">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="applierName"
|
|
|
+ prop="customerName"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
- min-width="100"
|
|
|
- label="申请人">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="deptName"
|
|
|
- header-align="center"
|
|
|
- align="center"
|
|
|
- min-width="100"
|
|
|
- label="申请部门">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="notes"
|
|
|
- header-align="center"
|
|
|
- align="center"
|
|
|
- min-width="180"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- label="说明">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="purchaseState"
|
|
|
- header-align="center"
|
|
|
- align="center"
|
|
|
- :formatter="formatState"
|
|
|
- label="当前状态">
|
|
|
+ label="客户名称">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
fixed="right"
|
|
@@ -121,9 +54,7 @@
|
|
|
width="150"
|
|
|
label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.purchaseId, true)">查看</el-button>
|
|
|
- <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.purchaseId, false)">编辑</el-button>
|
|
|
- <el-button style="color: red" type="text" size="small" @click="revokeHandle(scope.row.purchaseId)">撤回</el-button>
|
|
|
+ <el-button type="text" size="small" @click="details(scope.row.id)">查看</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -136,68 +67,35 @@
|
|
|
:total="totalPage"
|
|
|
layout="total, sizes, prev, pager, next, jumper">
|
|
|
</el-pagination>
|
|
|
- <!-- 弹窗, 新增 / 修改 -->
|
|
|
-<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>-->
|
|
|
+ <!-- 弹窗, 查看 -->
|
|
|
+ <detail v-if="detailsVisible" ref="details" @refreshDataList="getDataList"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- // import AddOrUpdate from './purchase-add-or-update'
|
|
|
- import { getDictList } from '@/api/dict'
|
|
|
- import { getPurchaseList, revokePurchase } from '@/api/sale'
|
|
|
+ import Detail from './recording-details'
|
|
|
+ import { getRecordingList } from '@/api/production'
|
|
|
export default {
|
|
|
name: 'recording',
|
|
|
+ components: {Detail},
|
|
|
data () {
|
|
|
return {
|
|
|
- addOrUpdateVisible: false,
|
|
|
+ detailsVisible: false,
|
|
|
dataForm: {},
|
|
|
dataList: [],
|
|
|
pageIndex: 1,
|
|
|
pageSize: 10,
|
|
|
totalPage: 0,
|
|
|
dataListLoading: false,
|
|
|
- dataListSelections: [],
|
|
|
- optionsType: [],
|
|
|
- // 审批状态:0 待提交 1 待审批 2 审批中 3 审批完成 4 审批不通过
|
|
|
- optionsState: [
|
|
|
- {
|
|
|
- code: '0',
|
|
|
- value: '待提交'
|
|
|
- },
|
|
|
- {
|
|
|
- code: '1',
|
|
|
- value: '待审批'
|
|
|
- },
|
|
|
- {
|
|
|
- code: '2',
|
|
|
- value: '审批中'
|
|
|
- },
|
|
|
- {
|
|
|
- code: '3',
|
|
|
- value: '审批完成'
|
|
|
- },
|
|
|
- {
|
|
|
- code: '4',
|
|
|
- value: '审批不通过'
|
|
|
- }
|
|
|
- ]
|
|
|
+ dataListSelections: []
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
- this.getTypeList()
|
|
|
this.getDataList()
|
|
|
},
|
|
|
methods: {
|
|
|
- // 获取采购类别字典
|
|
|
- getTypeList () {
|
|
|
- getDictList({type: 'purchase_type'}).then(({data}) => {
|
|
|
- if (data) {
|
|
|
- this.optionsType = data
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
// 查询
|
|
|
- search () {
|
|
|
+ queryPage () {
|
|
|
this.pageIndex = 1
|
|
|
this.getDataList()
|
|
|
},
|
|
@@ -208,13 +106,10 @@
|
|
|
let params = {
|
|
|
'current': this.pageIndex,
|
|
|
'size': this.pageSize,
|
|
|
- 'applyDate': this.dataForm.applyDate ? this.dataForm.applyDate : null,
|
|
|
- 'notes': this.dataForm.notes ? this.dataForm.notes : null,
|
|
|
- 'purchaseState': this.dataForm.purchaseState ? this.dataForm.purchaseState : null,
|
|
|
- 'purchaseType': this.dataForm.purchaseType ? this.dataForm.purchaseType : null,
|
|
|
- 'purchaseCode': this.dataForm.purchaseCode ? this.dataForm.purchaseCode : null
|
|
|
+ 'orderCode': this.dataForm.orderCode ? this.dataForm.orderCode : null,
|
|
|
+ 'productName': this.dataForm.productName ? this.dataForm.productName : null
|
|
|
}
|
|
|
- getPurchaseList(params).then(({data}) => {
|
|
|
+ getRecordingList(params).then(({data}) => {
|
|
|
if (data && data.code === '200') {
|
|
|
this.dataList = data.data.records
|
|
|
this.totalPage = Number(data.data.total)
|
|
@@ -225,30 +120,6 @@
|
|
|
this.dataListLoading = false
|
|
|
})
|
|
|
},
|
|
|
- revokeHandle (id) {
|
|
|
- if (!id) return
|
|
|
- let data = {id: id}
|
|
|
- this.$confirm(`确定撤回?`, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- revokePurchase(data).then(({data}) => {
|
|
|
- if (data && data.code === '200') {
|
|
|
- this.$message({
|
|
|
- message: '操作成功',
|
|
|
- type: 'success',
|
|
|
- duration: 1500,
|
|
|
- onClose: () => {
|
|
|
- this.getDataList()
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$message.error(data.msg)
|
|
|
- }
|
|
|
- })
|
|
|
- }).catch(() => {})
|
|
|
- },
|
|
|
// 每页数
|
|
|
sizeChangeHandle (val) {
|
|
|
this.pageSize = val
|
|
@@ -265,24 +136,11 @@
|
|
|
this.dataListSelections = val
|
|
|
},
|
|
|
// 新增 / 修改
|
|
|
- addOrUpdateHandle (id, disable) {
|
|
|
- this.addOrUpdateVisible = true
|
|
|
+ details (id) {
|
|
|
+ this.detailsVisible = true
|
|
|
this.$nextTick(() => {
|
|
|
- this.$refs.addOrUpdate.init(id, disable)
|
|
|
+ this.$refs.details.init(id)
|
|
|
})
|
|
|
- },
|
|
|
- // 转换属性“类别”
|
|
|
- formatType (row) {
|
|
|
- if (this.optionsType && row.purchaseType) {
|
|
|
- const item1 = this.optionsType.find((item) => item.code === row.purchaseType.toString())
|
|
|
- return item1 ? item1.value : ''
|
|
|
- }
|
|
|
- },
|
|
|
- // 转换属性“是否组合产品”
|
|
|
- formatState (row) {
|
|
|
- if (!row.purchaseState) return ''
|
|
|
- const item1 = this.optionsState.find((item) => item.code === row.purchaseState.toString())
|
|
|
- return item1 ? item1.value : ''
|
|
|
}
|
|
|
}
|
|
|
}
|