|
@@ -1,26 +1,53 @@
|
|
<template>
|
|
<template>
|
|
- <template-page ref="pageRef" :get-list="getList" :exportList="exportList" :table-attributes="tableAttributes"
|
|
|
|
- :table-events="tableEvents" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
|
|
|
|
- :column-parsing="columnParsing" :operation="operation()" :replaceOrNotMap="false">
|
|
|
|
|
|
+ <template-page
|
|
|
|
+ ref="pageRef"
|
|
|
|
+ :get-list="getList"
|
|
|
|
+ :exportList="exportList"
|
|
|
|
+ :table-attributes="tableAttributes"
|
|
|
|
+ :table-events="tableEvents"
|
|
|
|
+ :options-evens-group="optionsEvensGroup"
|
|
|
|
+ :moreParameters="moreParameters"
|
|
|
|
+ :column-parsing="columnParsing"
|
|
|
|
+ :operation="operation()"
|
|
|
|
+ :replaceOrNotMap="false"
|
|
|
|
+ >
|
|
<div class="cartographer">
|
|
<div class="cartographer">
|
|
- <el-dialog :title="({ M: '辅材退货单', P: '配件退货单' })[storageType]" width="100%" :modal="false" :visible.sync="formDialog"
|
|
|
|
- :before-close="formCancel">
|
|
|
|
|
|
+ <el-dialog
|
|
|
|
+ :title="{ M: '辅材退货单', P: '配件退货单' }[storageType]"
|
|
|
|
+ width="100%"
|
|
|
|
+ :modal="false"
|
|
|
|
+ :visible.sync="formDialog"
|
|
|
|
+ :before-close="formCancel"
|
|
|
|
+ >
|
|
<zj-form-container v-if="formDialog" ref="formRef" :form-data="formData" :styleSwitch="false">
|
|
<zj-form-container v-if="formDialog" ref="formRef" :form-data="formData" :styleSwitch="false">
|
|
- <zj-form-module title="单据信息" label-width="120px" :showPackUp="false" :form-data="formData"
|
|
|
|
- :form-items="formItems1">
|
|
|
|
|
|
+ <zj-form-module
|
|
|
|
+ title="单据信息"
|
|
|
|
+ label-width="120px"
|
|
|
|
+ :showPackUp="false"
|
|
|
|
+ :form-data="formData"
|
|
|
|
+ :form-items="formItems1"
|
|
|
|
+ >
|
|
</zj-form-module>
|
|
</zj-form-module>
|
|
- <zj-form-module :title="({ M: '辅材信息', P: '配件信息' })[storageType]" label-width="120px" :showPackUp="false"
|
|
|
|
- :form-data="formData" :form-items="formItems2">
|
|
|
|
|
|
+ <zj-form-module
|
|
|
|
+ :title="{ M: '辅材信息', P: '配件信息' }[storageType]"
|
|
|
|
+ label-width="120px"
|
|
|
|
+ :showPackUp="false"
|
|
|
|
+ :form-data="formData"
|
|
|
|
+ :form-items="formItems2"
|
|
|
|
+ >
|
|
</zj-form-module>
|
|
</zj-form-module>
|
|
</zj-form-container>
|
|
</zj-form-container>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button size="mini" @click="formCancel">取 消</el-button>
|
|
<el-button size="mini" @click="formCancel">取 消</el-button>
|
|
- <el-button v-if="~[0, 1].indexOf(formDialogType)" size="mini" @click="formConfirm" type="primary">确
|
|
|
|
- 定</el-button>
|
|
|
|
- <el-button v-if="~[3].indexOf(formDialogType)" size="mini" @click="passExamination('OK')"
|
|
|
|
- type="primary">审核通过</el-button>
|
|
|
|
- <el-button v-if="~[3].indexOf(formDialogType)" size="mini" @click="passExamination('FAIL')"
|
|
|
|
- type="primary">驳回</el-button>
|
|
|
|
|
|
+ <el-button v-if="~[0, 1].indexOf(formDialogType)" size="mini" @click="formConfirm" type="primary"
|
|
|
|
+ >确 定</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button v-if="~[3].indexOf(formDialogType)" size="mini" @click="passExamination('OK')" type="primary"
|
|
|
|
+ >审核通过</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button v-if="~[3].indexOf(formDialogType)" size="mini" @click="passExamination('FAIL')" type="primary"
|
|
|
|
+ >驳回</el-button
|
|
|
|
+ >
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
@@ -30,14 +57,21 @@
|
|
<script>
|
|
<script>
|
|
import TemplatePage from '@/components/template/template-page-1.vue'
|
|
import TemplatePage from '@/components/template/template-page-1.vue'
|
|
import import_mixin from '@/components/template/import_mixin.js'
|
|
import import_mixin from '@/components/template/import_mixin.js'
|
|
-import form_tpl from "../mixins/form_tpl.js"
|
|
|
|
|
|
+import form_tpl from '../mixins/form_tpl.js'
|
|
import operation_mixin from '@/components/template/operation_mixin.js'
|
|
import operation_mixin from '@/components/template/operation_mixin.js'
|
|
-import { websitPurchaseRetList, websitPurchaseRetListExport, websitPurchaseRetAdd, websitPurchaseRetEdit, websitPurchaseRetConfirm, websitPurchaseRetDetail } from "@/api/purchasingManagement.js"
|
|
|
|
|
|
+import {
|
|
|
|
+ websitPurchaseRetList,
|
|
|
|
+ websitPurchaseRetListExport,
|
|
|
|
+ websitPurchaseRetAdd,
|
|
|
|
+ websitPurchaseRetEdit,
|
|
|
|
+ websitPurchaseRetConfirm,
|
|
|
|
+ websitPurchaseRetDetail
|
|
|
|
+} from '@/api/purchasingManagement.js'
|
|
export default {
|
|
export default {
|
|
props: {
|
|
props: {
|
|
storageType: {
|
|
storageType: {
|
|
type: String,
|
|
type: String,
|
|
- default: ""
|
|
|
|
|
|
+ default: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
components: { TemplatePage },
|
|
components: { TemplatePage },
|
|
@@ -46,38 +80,38 @@ export default {
|
|
return {
|
|
return {
|
|
formData: {
|
|
formData: {
|
|
companyWechatName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
|
|
companyWechatName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
|
|
- "companyWechatId": "",
|
|
|
|
- "confirmBy": "",
|
|
|
|
- "confirmTime": "",
|
|
|
|
- "createBy": "",
|
|
|
|
- "createTime": "",
|
|
|
|
- "flag": "",
|
|
|
|
- "goodsType": this.storageType,
|
|
|
|
- "purchaseId": "",
|
|
|
|
- "purchaseRetId": "",
|
|
|
|
- "remark": "",
|
|
|
|
- "retTime": "",
|
|
|
|
- "retTotalAmount": 0,
|
|
|
|
- "retTotalQty": 0,
|
|
|
|
- "updateBy": "",
|
|
|
|
- "updateTime": "",
|
|
|
|
- "venderId": "",
|
|
|
|
- "venderName": "",
|
|
|
|
- storageId:"",
|
|
|
|
- "websitId": "",
|
|
|
|
- "websitName": "",
|
|
|
|
|
|
+ companyWechatId: '',
|
|
|
|
+ confirmBy: '',
|
|
|
|
+ confirmTime: '',
|
|
|
|
+ createBy: '',
|
|
|
|
+ createTime: '',
|
|
|
|
+ flag: '',
|
|
|
|
+ goodsType: this.storageType,
|
|
|
|
+ purchaseId: '',
|
|
|
|
+ purchaseRetId: '',
|
|
|
|
+ remark: '',
|
|
|
|
+ retTime: '',
|
|
|
|
+ retTotalAmount: 0,
|
|
|
|
+ retTotalQty: 0,
|
|
|
|
+ updateBy: '',
|
|
|
|
+ updateTime: '',
|
|
|
|
+ venderId: '',
|
|
|
|
+ venderName: '',
|
|
|
|
+ storageId: '',
|
|
|
|
+ websitId: '',
|
|
|
|
+ websitName: '',
|
|
items: [],
|
|
items: [],
|
|
imageUrl: []
|
|
imageUrl: []
|
|
- },
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 列表请求函数
|
|
// 列表请求函数
|
|
getList(p, cb) {
|
|
getList(p, cb) {
|
|
var pam = JSON.parse(JSON.stringify(p))
|
|
var pam = JSON.parse(JSON.stringify(p))
|
|
- pam.params.push({ "param": "a.goods_type", "compare": "=", "value": this.storageType })
|
|
|
|
|
|
+ pam.params.push({ param: 'a.goods_type', compare: '=', value: this.storageType })
|
|
if (pam.flag) {
|
|
if (pam.flag) {
|
|
- pam.params.push({ "param": "a.flag", "compare": "=", "value": pam.flag })
|
|
|
|
|
|
+ pam.params.push({ param: 'a.flag', compare: '=', value: pam.flag })
|
|
}
|
|
}
|
|
cb && cb(pam)
|
|
cb && cb(pam)
|
|
return websitPurchaseRetList(pam)
|
|
return websitPurchaseRetList(pam)
|
|
@@ -89,7 +123,7 @@ export default {
|
|
return this.operationBtn({
|
|
return this.operationBtn({
|
|
edit: {
|
|
edit: {
|
|
conditions: ({ row, index, column }) => {
|
|
conditions: ({ row, index, column }) => {
|
|
- return row.flag == "SAVE"
|
|
|
|
|
|
+ return row.flag == 'SAVE'
|
|
},
|
|
},
|
|
click: ({ row, index, column }) => {
|
|
click: ({ row, index, column }) => {
|
|
this.getDetail(row.purchaseRetId, 1)
|
|
this.getDetail(row.purchaseRetId, 1)
|
|
@@ -102,12 +136,12 @@ export default {
|
|
},
|
|
},
|
|
examine: {
|
|
examine: {
|
|
conditions: ({ row, index, column }) => {
|
|
conditions: ({ row, index, column }) => {
|
|
- return row.flag == "SAVE"
|
|
|
|
|
|
+ return row.flag == 'SAVE'
|
|
},
|
|
},
|
|
click: ({ row, index, column }) => {
|
|
click: ({ row, index, column }) => {
|
|
this.getDetail(row.purchaseRetId, 3)
|
|
this.getDetail(row.purchaseRetId, 3)
|
|
}
|
|
}
|
|
- },
|
|
|
|
|
|
+ }
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
@@ -127,23 +161,29 @@ export default {
|
|
formConfirm() {
|
|
formConfirm() {
|
|
this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
|
|
this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- ([websitPurchaseRetAdd, websitPurchaseRetEdit][this.formDialogType])({
|
|
|
|
- ...this.formData,
|
|
|
|
- "goodsType": this.storageType,
|
|
|
|
- imageUrl: this.formData.imageUrl.map(item => item.url).join(","),
|
|
|
|
- }).then(res => {
|
|
|
|
- this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
|
|
|
|
- this.formCancel()
|
|
|
|
- this.$refs.pageRef.refreshList()
|
|
|
|
- })
|
|
|
|
|
|
+ ;[websitPurchaseRetAdd, websitPurchaseRetEdit]
|
|
|
|
+ [this.formDialogType]({
|
|
|
|
+ ...this.formData,
|
|
|
|
+ goodsType: this.storageType,
|
|
|
|
+ imageUrl: this.formData.imageUrl.map(item => item.url).join(',')
|
|
|
|
+ })
|
|
|
|
+ .then(res => {
|
|
|
|
+ this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
|
|
|
|
+ this.formCancel()
|
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
|
+ })
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
passExamination(flag) {
|
|
passExamination(flag) {
|
|
this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
|
|
this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- websitPurchaseRetConfirm({ purchaseRetId: this.formData.purchaseRetId, flag: flag, storageId: this?.formData?.storageId }).then(res => {
|
|
|
|
- this.$message({ type: 'success', message: flag=='OK'?`审核通过!`:'驳回通过' })
|
|
|
|
|
|
+ websitPurchaseRetConfirm({
|
|
|
|
+ purchaseRetId: this.formData.purchaseRetId,
|
|
|
|
+ flag: flag,
|
|
|
|
+ storageId: this?.formData?.storageId
|
|
|
|
+ }).then(res => {
|
|
|
|
+ this.$message({ type: 'success', message: flag == 'OK' ? `审核通过!` : '驳回通过' })
|
|
this.formCancel()
|
|
this.formCancel()
|
|
this.$refs.pageRef.refreshList()
|
|
this.$refs.pageRef.refreshList()
|
|
})
|
|
})
|
|
@@ -162,4 +202,3 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|
|
-
|
|
|