|
@@ -1,34 +1,41 @@
|
|
<template>
|
|
<template>
|
|
- <div class="page">
|
|
|
|
- <template-page v-if="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="50"
|
|
|
|
- :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
|
|
|
|
- :operation="operation" :exportList="exportList">
|
|
|
|
-
|
|
|
|
- <div slot="moreSearch">
|
|
|
|
- <el-radio-group v-model="goodsType" size="mini" @change="changeType">
|
|
|
|
- <el-radio-button label="">全部</el-radio-button>
|
|
|
|
- <el-radio-button label="PAY_NOT_TAKE">待确认</el-radio-button>
|
|
|
|
- <el-radio-button label="SUBMIT">已确认</el-radio-button>
|
|
|
|
- </el-radio-group>
|
|
|
|
- <br><br>
|
|
|
|
- </div>
|
|
|
|
- </template-page>
|
|
|
|
- <div class="detail" v-if="formDialog">
|
|
|
|
- <auxiliarySalesOrderDetail :id="id" @back="backList" :title="'辅材销售订单' + formDialogTitles[formDialogType]"></auxiliarySalesOrderDetail>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="50"
|
|
|
|
+ :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
|
|
|
|
+ :operation="operation" :exportList="exportList">
|
|
|
|
+
|
|
|
|
+ <div slot="moreSearch">
|
|
|
|
+ <el-radio-group v-model="goodsType" size="mini" @change="changeType">
|
|
|
|
+ <el-radio-button label="">全部</el-radio-button>
|
|
|
|
+ <el-radio-button label="PAY_NOT_TAKE">待确认</el-radio-button>
|
|
|
|
+ <el-radio-button label="SUBMIT">已确认</el-radio-button>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ <br><br>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <el-dialog title="" width="1200px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
|
|
|
|
+ :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
|
|
|
|
+ <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
|
|
|
|
+ <zj-form-module :title="formDialogTitles[formDialogType]" label-width="160px" :showPackUp="false"
|
|
|
|
+ :form-data="formData" :form-items="formItems1" :disabled="formDialogType==2">
|
|
|
|
+ </zj-form-module>
|
|
|
|
+ </zj-form-container>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button size="mini" @click="formCancel">取 消</el-button>
|
|
|
|
+ <el-button size="mini" type="primary" @click="formConfirm()">确定</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ </template-page>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import TemplatePage from '@/components/template/template-page-1.vue'
|
|
import TemplatePage from '@/components/template/template-page-1.vue'
|
|
-import auxiliarySalesOrderDetail from '../components/auxiliarySalesOrderDetail.vue'
|
|
|
|
import import_mixin from '@/components/template/import_mixin.js'
|
|
import import_mixin from '@/components/template/import_mixin.js'
|
|
import ImageUpload from '@/components/file-upload'
|
|
import ImageUpload from '@/components/file-upload'
|
|
import { downloadFiles } from '@/utils/util'
|
|
import { downloadFiles } from '@/utils/util'
|
|
import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
|
|
import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
|
|
import { listPageV2,pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/auxiliarySalesReturnOrder";
|
|
import { listPageV2,pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/auxiliarySalesReturnOrder";
|
|
export default {
|
|
export default {
|
|
- components: { TemplatePage, ImageUpload, auxiliarySalesOrderDetail },
|
|
|
|
|
|
+ components: { TemplatePage, ImageUpload },
|
|
mixins: [import_mixin],
|
|
mixins: [import_mixin],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -58,7 +65,28 @@ export default {
|
|
formDialogType: 0,
|
|
formDialogType: 0,
|
|
formDialogTitles: ["新增","编辑", "详情"],
|
|
formDialogTitles: ["新增","编辑", "详情"],
|
|
formDialog: false,
|
|
formDialog: false,
|
|
- id: '',
|
|
|
|
|
|
+ formData: {
|
|
|
|
+ companyWechatName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
|
|
|
|
+ "companyWechatId": "",
|
|
|
|
+ "confirmBy": "",
|
|
|
|
+ "confirmTime": "",
|
|
|
|
+ "createBy": "",
|
|
|
|
+ "createTime": "",
|
|
|
|
+ "flag": "",
|
|
|
|
+ "goodsType": "",
|
|
|
|
+ "purchaseId": "",
|
|
|
|
+ "purchaseTime": "",
|
|
|
|
+ "remark": "",
|
|
|
|
+ "totalAmount": 0,
|
|
|
|
+ "updateBy": "",
|
|
|
|
+ "updateTime": "",
|
|
|
|
+ "venderId": "",
|
|
|
|
+ "venderName": "",
|
|
|
|
+ "websitId": "",
|
|
|
|
+ "websitName": "",
|
|
|
|
+ items: [],
|
|
|
|
+ imageUrl: []
|
|
|
|
+ },
|
|
goodsType: ''
|
|
goodsType: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -67,17 +95,100 @@ export default {
|
|
moreParameters() {
|
|
moreParameters() {
|
|
return []
|
|
return []
|
|
},
|
|
},
|
|
- formItems() {}
|
|
|
|
|
|
+ formItems1() {
|
|
|
|
+ return [
|
|
|
|
+ {
|
|
|
|
+ md: 24,
|
|
|
|
+ isShow: true,
|
|
|
|
+ name: 'slot-component',
|
|
|
|
+ formItemAttributes: {
|
|
|
|
+ label: '',
|
|
|
|
+ prop: '',
|
|
|
|
+ 'label-width': '0px'
|
|
|
|
+ },
|
|
|
|
+ render: (h, { props, onInput }) => {
|
|
|
|
+ var { value } = props
|
|
|
|
+ return (
|
|
|
|
+ <div>
|
|
|
|
+ <el-descriptions border title="" column={4} colon={false} labelStyle={{ width: '8%' }} contentStyle={{ width: '17%' }}>
|
|
|
|
+ <el-descriptions-item label="单据状态">
|
|
|
|
+ {({ SAVE: "保存", OK: "通过", FAIL: "失败" })[this.formData.flag]}
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="单据编号">
|
|
|
|
+ {(!!~['auxiliaryMaterialsStorage', 'partsStorage'].indexOf(this.pageType) ? this.formData.purchaseId : this.formData.purchaseRetId) || ''}
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="所属商户" contentStyle={{ width: '42%' }}>
|
|
|
|
+ {this.formData.companyWechatName}
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ </el-descriptions>
|
|
|
|
+ <el-descriptions border title="" column={2} colon={false} labelStyle={{ width: '8%' }} contentStyle={{ width: '42%' }} style="margin-top:-1px">
|
|
|
|
+ <el-descriptions-item label="网点名称">
|
|
|
|
+ <el-select style="width:100%" value={this.formData.websitId} onInput={(val) => { this.formData.websitId = val }} placeholder="请选择">
|
|
|
|
+ {this.getWebsitList.map(item => <el-option key={item.websitId} label={item.name} value={item.websitId}></el-option>)}
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="供应商名称">
|
|
|
|
+ <el-select style="width:100%" value={this.formData.venderId} onInput={(val) => { this.formData.venderId = val }} placeholder="请选择">
|
|
|
|
+ {this.listPageV2Data.map(item => <el-option key={item.venderId} label={item.venderName} value={item.venderId}></el-option>)}
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ </el-descriptions>
|
|
|
|
+ {
|
|
|
|
+ !!~['returnAuxiliaryMaterials', 'partsReturn'].indexOf(this.pageType) ?
|
|
|
|
+ <el-descriptions border title="" column={4} colon={false} labelStyle={{ width: '8%' }} contentStyle={{ width: '17%' }} style="margin-top:-1px">
|
|
|
|
+ <el-descriptions-item label="采购入库单号" contentStyle={{ width: '42%' }}>
|
|
|
|
+ {this.formData.purchaseId}
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="退货数量">
|
|
|
|
+ {this.formData.retTotalQty}
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="退款金额">
|
|
|
|
+ {this.formData.retTotalAmount}
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ </el-descriptions> : null
|
|
|
|
+ }
|
|
|
|
+ <el-descriptions border title="" column={4} colon={false} labelStyle={{ width: '8%' }} contentStyle={{ width: '17%' }} style="margin-top:-1px">
|
|
|
|
+ <el-descriptions-item label="制单人">
|
|
|
|
+ {this.formData.createBy}
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="制单时间">
|
|
|
|
+ {this.formData.createTime}
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="审核人">
|
|
|
|
+ {this.formData.confirmBy}
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="审核时间">
|
|
|
|
+ {this.formData.confirmTime}
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ </el-descriptions>
|
|
|
|
+ <el-descriptions border title="" column={4} colon={false} labelStyle={{ width: '8%' }} contentStyle={{ width: '17%' }} style="margin-top:-1px">
|
|
|
|
+ <el-descriptions-item label="附件">
|
|
|
|
+ <ImageUpload fileList={this.formData.imageUrl} uid="imgSrc666_materials_drawing_images" limit={1} isEdit={this.formDialogType < 2} />
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="备注" contentStyle={{ width: '67%' }}>
|
|
|
|
+ <el-input
|
|
|
|
+ type="textarea"
|
|
|
|
+ placeholder="请输入内容"
|
|
|
|
+ value={this.formData.remark}
|
|
|
|
+ onInput={(val) => { this.formData.remark = val }}
|
|
|
|
+ maxlength="200"
|
|
|
|
+ show-word-limit
|
|
|
|
+ autosize={{ minRows: 6, maxRows: 8 }}
|
|
|
|
+ >
|
|
|
|
+ </el-input>
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ </el-descriptions>
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ },]
|
|
|
|
+ },
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 切换状态
|
|
// 切换状态
|
|
changeType(val) {
|
|
changeType(val) {
|
|
this.$refs.pageRef.refreshList()
|
|
this.$refs.pageRef.refreshList()
|
|
},
|
|
},
|
|
- backList() {
|
|
|
|
- this.formDialog = false;
|
|
|
|
- this.getList()
|
|
|
|
- },
|
|
|
|
// 列表请求函数
|
|
// 列表请求函数
|
|
getList(p) {
|
|
getList(p) {
|
|
try {
|
|
try {
|
|
@@ -93,7 +204,18 @@ export default {
|
|
// 列表导出函数
|
|
// 列表导出函数
|
|
exportList: pageExport,
|
|
exportList: pageExport,
|
|
// 表格列解析渲染数据更改
|
|
// 表格列解析渲染数据更改
|
|
- columnParsing(item, defaultData) {},
|
|
|
|
|
|
+ columnParsing(item, defaultData) {
|
|
|
|
+ if (item.jname === 'idCardImg') {
|
|
|
|
+ defaultData.render = (h, { row, index, column }) => {
|
|
|
|
+ return (
|
|
|
|
+ <div style="padding:0 6px;cursor: pointer;">
|
|
|
|
+ {row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return defaultData
|
|
|
|
+ },
|
|
// 监听勾选变化
|
|
// 监听勾选变化
|
|
selectionChange(data) {
|
|
selectionChange(data) {
|
|
this.recordSelected = data
|
|
this.recordSelected = data
|
|
@@ -103,9 +225,14 @@ export default {
|
|
return (
|
|
return (
|
|
<div class='operation-btns'>
|
|
<div class='operation-btns'>
|
|
<el-button type="text" onClick={() => {
|
|
<el-button type="text" onClick={() => {
|
|
- this.id = row.salesRetId
|
|
|
|
- this.formDialogType = 1
|
|
|
|
- this.openForm()
|
|
|
|
|
|
+ getDetail({ id: row.venderId }).then(res => {
|
|
|
|
+ Object.assign(this.formData, res.data,{
|
|
|
|
+ imageUrl:res.data?.imageUrl? res.data?.imageUrl?.split(",").map(item=>({url:item})) : []
|
|
|
|
+ })
|
|
|
|
+ console.log(this.formData)
|
|
|
|
+ this.formDialogType = 1
|
|
|
|
+ this.openForm()
|
|
|
|
+ })
|
|
}}>编辑</el-button>
|
|
}}>编辑</el-button>
|
|
</div>
|
|
</div>
|
|
)
|
|
)
|
|
@@ -117,6 +244,48 @@ export default {
|
|
openForm() {
|
|
openForm() {
|
|
this.formDialog = true;
|
|
this.formDialog = true;
|
|
},
|
|
},
|
|
|
|
+ formCancel() {
|
|
|
|
+ this.$refs.formRef.$refs.inlineForm.clearValidate()
|
|
|
|
+ this.$data.formData = this.$options.data().formData
|
|
|
|
+ this.formDialog = false
|
|
|
|
+ },
|
|
|
|
+ updateStatus(stateEnum){
|
|
|
|
+ if(this.recordSelected.length == 0){
|
|
|
|
+ return this.$message.warning('请至少勾选一条数据!');
|
|
|
|
+ }
|
|
|
|
+ console.log(this.recordSelected)
|
|
|
|
+ this.$confirm(`请确认是否${stateEnum=='OFF'?'下架':'上架'}该配件, 是否继续?`, '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ memberInner({
|
|
|
|
+ stateEnum,
|
|
|
|
+ ids: this.recordSelected.map(item=>{return item.goodsId}).join(',')
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.$message({ type: 'success', message: `${stateEnum=='ON'?'下架':'上架'}成功!` })
|
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(res.msg);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ formConfirm() {
|
|
|
|
+ this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ ([add, edit][this.formDialogType])({
|
|
|
|
+ ...this.formData,
|
|
|
|
+ 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()
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 下载导入模版
|
|
// 下载导入模版
|
|
handleDownload() {
|
|
handleDownload() {
|
|
// downloadFiles('charging/standard/download');
|
|
// downloadFiles('charging/standard/download');
|
|
@@ -126,9 +295,6 @@ export default {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
- .page{
|
|
|
|
- height: 100%;
|
|
|
|
- }
|
|
|
|
.tab{
|
|
.tab{
|
|
padding: 20px 20px 0 20px;
|
|
padding: 20px 20px 0 20px;
|
|
}
|
|
}
|