|
@@ -1,56 +1,106 @@
|
|
<template>
|
|
<template>
|
|
- <zj-form-container ref="formRef" :form-data="formData" :form-rules="formRules">
|
|
|
|
- <zj-form-module title="调拨单" :form-data="formData" :form-items="formItems" label-width="100px" :column="3" />
|
|
|
|
- <zj-form-module title="调拨单明细" :form-items="detailData" label-width="0" :column="3" />
|
|
|
|
- <div>
|
|
|
|
- <el-button type="primary" size="default" @click="onSubmit">提交</el-button>
|
|
|
|
- <el-button size="default" @click="onSave">保存</el-button>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <zj-form-container ref="formRef" :form-data="formData" :form-rules="formRules">
|
|
|
|
+ <zj-form-module title="调拨单" :form-data="formData" :form-items="formItems" label-width="100px" :column="3" />
|
|
|
|
+ <zj-form-module title="调拨单明细" :form-items="detailData" label-width="0" :column="3" />
|
|
|
|
+ </zj-form-container>
|
|
|
|
+ <el-dialog title="添加产品" :visible.sync="visible" width="60%" :append-to-body="true" @close="visible = false">
|
|
|
|
+ <div style="height: 600px">
|
|
|
|
+ <template-page
|
|
|
|
+ ref="pageRef"
|
|
|
|
+ style="height: 100%"
|
|
|
|
+ :get-list="getList"
|
|
|
|
+ :column-parsing="columnParsing"
|
|
|
|
+ :table-attributes="tableAttributes"
|
|
|
|
+ :table-events="tableEvents"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ <span slot="footer">
|
|
|
|
+ <el-button type="primary" @click="handleAddData">提交</el-button>
|
|
|
|
+ </span>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ <!-- 新增 -->
|
|
|
|
+ <div v-if="!comDisabled">
|
|
|
|
+ <template v-if="moduleType === 1">
|
|
|
|
+ <el-button type="primary" size="default" @click="onSubmit('WAIT')">提交</el-button>
|
|
|
|
+ <el-button size="default" @click="onSubmit('SAVE')">保存</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-else>
|
|
|
|
+ <el-button type="primary" size="default" @click="onSubmit">编辑</el-button>
|
|
|
|
+ </template>
|
|
<el-button size="default" @click="onReset">重置</el-button>
|
|
<el-button size="default" @click="onReset">重置</el-button>
|
|
</div>
|
|
</div>
|
|
- </zj-form-container>
|
|
|
|
|
|
+ <!-- 审核 /详情-->
|
|
|
|
+ <div v-if="moduleType === 3 || moduleType === 2">
|
|
|
|
+ <el-button v-if="moduleType === 3" type="primary" size="default" @click="onExamine('OK')">同意</el-button>
|
|
|
|
+ <el-button size="default" @click="onInvoice('SAVE')">撤回</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import TemplatePage from '@/components/template/template-page-1.vue'
|
|
|
|
+import { getcustomerFrontList } from '@/api/stock'
|
|
|
|
+import { getStagecustomerListV2, getDealerListV2 } from '@/api/basic_data/dealer'
|
|
|
|
+import {
|
|
|
|
+ addCustomerTransfer,
|
|
|
|
+ updateCustomerTransfer,
|
|
|
|
+ getCustomerTransferDetail,
|
|
|
|
+ examineCustomerTransfer,
|
|
|
|
+ invoiceCustomerTransfer
|
|
|
|
+} from '@/api/transferOrder'
|
|
|
|
+import { mapGetters } from 'vuex'
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
|
|
+ components: { TemplatePage },
|
|
props: {
|
|
props: {
|
|
edit: {
|
|
edit: {
|
|
type: Boolean,
|
|
type: Boolean,
|
|
default: false
|
|
default: false
|
|
},
|
|
},
|
|
- details: {
|
|
|
|
- type: Object,
|
|
|
|
- default: () => {
|
|
|
|
- return {}
|
|
|
|
- }
|
|
|
|
|
|
+ detailsId: {
|
|
|
|
+ type: String,
|
|
|
|
+ default: null
|
|
|
|
+ },
|
|
|
|
+ moduleType: {
|
|
|
|
+ type: Number,
|
|
|
|
+ default: null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ visible: false,
|
|
|
|
+ // 表格属性
|
|
|
|
+ tableAttributes: {
|
|
|
|
+ // 启用勾选列
|
|
|
|
+ selectColumn: true,
|
|
|
|
+ selectable: this.selectable
|
|
|
|
+ }, // 关闭新增弹窗
|
|
|
|
+
|
|
|
|
+ // 表格事件
|
|
|
|
+ tableEvents: {
|
|
|
|
+ 'selection-change': this.selectionChange
|
|
|
|
+ },
|
|
|
|
+ itemTableEvents: { 'selection-change': this.itemSelectionChange },
|
|
|
|
+ recordSelected: [],
|
|
formData: {
|
|
formData: {
|
|
- categoryType: 'HOME',
|
|
|
|
- contractTemplateImg: '',
|
|
|
|
- contractTemplateName: '',
|
|
|
|
- contractTemplatePdf: '',
|
|
|
|
- contractType: 'MAIN',
|
|
|
|
- followContractTemplateId: '',
|
|
|
|
- followType: '',
|
|
|
|
- mainContractUse: 'MAIN',
|
|
|
|
- signObj: 'WORKER',
|
|
|
|
- status: 'ON',
|
|
|
|
- websitId: '',
|
|
|
|
- websitName: ''
|
|
|
|
|
|
+ customerNumber: '',
|
|
|
|
+ customerName: '',
|
|
|
|
+ transferTime: '',
|
|
|
|
+ createBy: '',
|
|
|
|
+ transferCustomerNumber: '',
|
|
|
|
+ transferCustomerName: '',
|
|
|
|
+ stockType: '',
|
|
|
|
+ createTime: '',
|
|
|
|
+ notes: ''
|
|
},
|
|
},
|
|
formRules: {
|
|
formRules: {
|
|
- websitId: [{ required: true, message: '必填项', trigger: 'blur' }],
|
|
|
|
- categoryType: [{ required: true, message: '必填项', trigger: 'blur' }],
|
|
|
|
- contractTemplateImg: [{ required: true, message: '必填项', trigger: 'blur' }],
|
|
|
|
- contractTemplateName: [{ required: true, message: '必填项', trigger: 'blur' }],
|
|
|
|
- contractTemplatePdf: [{ required: true, message: '必填项', trigger: 'blur' }],
|
|
|
|
- contractType: [{ required: true, message: '必填项', trigger: 'blur' }],
|
|
|
|
- mainContractUse: [{ required: true, message: '必填项', trigger: 'blur' }],
|
|
|
|
- signObj: [{ required: true, message: '必填项', trigger: 'blur' }],
|
|
|
|
- status: [{ required: true, message: '必填项', trigger: 'blur' }],
|
|
|
|
- followType: [{ required: true, message: '必填项', trigger: 'blur' }]
|
|
|
|
|
|
+ customerNumber: [{ required: true, message: '请输入', trigger: 'blur' }],
|
|
|
|
+ customerName: [{ required: true, message: '请输入', trigger: 'blur' }],
|
|
|
|
+ transferTime: [{ required: true, message: '请选择', trigger: 'change' }],
|
|
|
|
+ transferCustomerNumber: [{ required: true, message: '请输入', trigger: 'blur' }],
|
|
|
|
+ transferCustomerName: [{ required: true, message: '请选择', trigger: 'change' }],
|
|
|
|
+ stockType: [{ required: true, message: '请输入', trigger: 'blur' }]
|
|
},
|
|
},
|
|
fileType: ['word', 'excel', 'ppt', 'pdf'],
|
|
fileType: ['word', 'excel', 'ppt', 'pdf'],
|
|
fileList: [],
|
|
fileList: [],
|
|
@@ -60,74 +110,213 @@ export default {
|
|
mainContractList: [],
|
|
mainContractList: [],
|
|
serviceProviderList: [],
|
|
serviceProviderList: [],
|
|
filetype: [],
|
|
filetype: [],
|
|
- authList: []
|
|
|
|
|
|
+ authList: [],
|
|
|
|
+ selectData: [],
|
|
|
|
+ itemRecordSelected: [],
|
|
|
|
+ sonCustomerList: []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
|
|
+ ...mapGetters(['customerNumber']),
|
|
|
|
+ comDisabled() {
|
|
|
|
+ // 禁止
|
|
|
|
+ return !!~[2, 3].indexOf(this.moduleType || 1)
|
|
|
|
+ },
|
|
formItems() {
|
|
formItems() {
|
|
return [
|
|
return [
|
|
{
|
|
{
|
|
name: 'el-input',
|
|
name: 'el-input',
|
|
md: 6,
|
|
md: 6,
|
|
- attributes: {},
|
|
|
|
- formItemAttributes: { label: '商家编号', prop: 'contractTemplateName' }
|
|
|
|
|
|
+ attributes: { disabled: this.comDisabled, placeholder: '请输入' },
|
|
|
|
+ formItemAttributes: { label: '商家编号', prop: 'customerNumber' }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: 'el-input',
|
|
name: 'el-input',
|
|
md: 6,
|
|
md: 6,
|
|
- attributes: {},
|
|
|
|
- formItemAttributes: { label: '商家名称', prop: 'contractTemplateName' }
|
|
|
|
|
|
+ attributes: { disabled: this.comDisabled, placeholder: '请输入' },
|
|
|
|
+ formItemAttributes: { label: '商家名称', prop: 'customerName' }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: 'el-date-picker',
|
|
name: 'el-date-picker',
|
|
md: 6,
|
|
md: 6,
|
|
- attributes: { type: 'datetime', style: { width: '100%' }, placeholder: '选择日期时间' },
|
|
|
|
- formItemAttributes: { label: '调整日期', prop: 'contractTemplateName' }
|
|
|
|
|
|
+ attributes: {
|
|
|
|
+ type: 'datetime',
|
|
|
|
+ style: { width: '100%' },
|
|
|
|
+ placeholder: '选择日期时间',
|
|
|
|
+ valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
|
|
|
+ disabled: this.comDisabled
|
|
|
|
+ },
|
|
|
|
+ formItemAttributes: { label: '调整日期', prop: 'transferTime' }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: 'el-input',
|
|
name: 'el-input',
|
|
md: 6,
|
|
md: 6,
|
|
- attributes: {},
|
|
|
|
- formItemAttributes: { label: '制单人', prop: 'contractTemplateName' }
|
|
|
|
|
|
+ attributes: { disabled: true, placeholder: '系统自动生成' },
|
|
|
|
+ formItemAttributes: { label: '制单人', prop: 'createBy' }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: 'el-input',
|
|
name: 'el-input',
|
|
md: 6,
|
|
md: 6,
|
|
- attributes: {},
|
|
|
|
- formItemAttributes: { label: '商家编号', prop: 'contractTemplateName' }
|
|
|
|
|
|
+ attributes: { disabled: this.comDisabled, placeholder: '请输入' },
|
|
|
|
+ formItemAttributes: { label: '商家编号', prop: 'transferCustomerNumber' }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: 'el-select',
|
|
name: 'el-select',
|
|
- options: this.authList,
|
|
|
|
|
|
+ options: this.sonCustomerList,
|
|
md: 6,
|
|
md: 6,
|
|
attributes: {
|
|
attributes: {
|
|
clearable: true,
|
|
clearable: true,
|
|
- filterable: true
|
|
|
|
|
|
+ filterable: true,
|
|
|
|
+ disabled: this.comDisabled
|
|
},
|
|
},
|
|
- formItemAttributes: { label: '商家名称', prop: 'websitId' }
|
|
|
|
|
|
+ formItemAttributes: { label: '商家名称', prop: 'transferCustomerName' }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- name: 'el-input',
|
|
|
|
|
|
+ name: 'el-select',
|
|
md: 6,
|
|
md: 6,
|
|
- attributes: {},
|
|
|
|
- formItemAttributes: { label: '调拨仓库', prop: 'contractTemplateName' }
|
|
|
|
|
|
+ options: [
|
|
|
|
+ { label: '嘉贤前置仓', value: 'JIAXIAN' },
|
|
|
|
+ { label: '商家仓', value: 'SHANGJIA' }
|
|
|
|
+ ],
|
|
|
|
+ attributes: { disabled: this.comDisabled, placeholder: '请输入' },
|
|
|
|
+ formItemAttributes: { label: '调拨仓库', prop: 'stockType' }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: 'el-input',
|
|
name: 'el-input',
|
|
md: 6,
|
|
md: 6,
|
|
- attributes: {},
|
|
|
|
- formItemAttributes: { label: '制单时间', prop: 'contractTemplateName' }
|
|
|
|
|
|
+ attributes: { disabled: true, placeholder: '系统自动生成' },
|
|
|
|
+ formItemAttributes: { label: '制单时间', prop: 'createTime' }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: 'el-input',
|
|
name: 'el-input',
|
|
- md: 6,
|
|
|
|
- attributes: { type: 'textarea', style: { width: '100%' }},
|
|
|
|
- formItemAttributes: { label: '备注', prop: 'contractTemplateName' }
|
|
|
|
|
|
+ md: 12,
|
|
|
|
+ attributes: { type: 'textarea', style: { width: '100%' }, disabled: this.comDisabled, placeholder: '请输入' },
|
|
|
|
+ formItemAttributes: { label: '备注', prop: 'notes' }
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ columns() {
|
|
|
|
+ return [
|
|
|
|
+ {
|
|
|
|
+ columnAttributes: {
|
|
|
|
+ label: '产品名称',
|
|
|
|
+ prop: 'materialName'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ columnAttributes: {
|
|
|
|
+ label: '产品编码',
|
|
|
|
+ prop: 'materialOldNumber'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ columnAttributes: {
|
|
|
|
+ label: '规格型号',
|
|
|
|
+ prop: 'specification',
|
|
|
|
+ width: 300
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ columnAttributes: {
|
|
|
|
+ label: '可调拨库存数',
|
|
|
|
+ prop: 'frontStockNum'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ columnAttributes: {
|
|
|
|
+ label: '调拨数量',
|
|
|
|
+ prop: 'qty'
|
|
|
|
+ },
|
|
|
|
+ render: (h, { column, row, index }) => {
|
|
|
|
+ return (
|
|
|
|
+ <div style="margin:0 20px">
|
|
|
|
+ <el-input
|
|
|
|
+ type="number"
|
|
|
|
+ disabled={this.comDisabled}
|
|
|
|
+ value={row.qty}
|
|
|
|
+ onInput={e => (row.qty = e)}
|
|
|
|
+ placeholder="调拨数量"
|
|
|
|
+ size="mini"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ columnAttributes: {
|
|
|
|
+ label: '备注',
|
|
|
|
+ prop: 'notes'
|
|
|
|
+ },
|
|
|
|
+ render: (h, { column, row, index }) => {
|
|
|
|
+ return (
|
|
|
|
+ <el-input
|
|
|
|
+ type="text"
|
|
|
|
+ value={row.notes}
|
|
|
|
+ disabled={this.comDisabled}
|
|
|
|
+ onInput={e => (row.notes = e)}
|
|
|
|
+ placeholder="备注"
|
|
|
|
+ size="mini"
|
|
|
|
+ ></el-input>
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ columnAttributes: {
|
|
|
|
+ label: '调拨仓库',
|
|
|
|
+ prop: 'stockName'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ columnAttributes: {
|
|
|
|
+ label: '操作',
|
|
|
|
+ prop: ''
|
|
|
|
+ },
|
|
|
|
+ render: (h, { column, row, index }) => {
|
|
|
|
+ return (
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ size="default"
|
|
|
|
+ onClick={() => {
|
|
|
|
+ this.handleDel(index)
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ 删除
|
|
|
|
+ </el-button>
|
|
|
|
+ )
|
|
|
|
+ }
|
|
}
|
|
}
|
|
]
|
|
]
|
|
},
|
|
},
|
|
detailData() {
|
|
detailData() {
|
|
return [
|
|
return [
|
|
|
|
+ ...[
|
|
|
|
+ !this.comDisabled
|
|
|
|
+ ? {
|
|
|
|
+ name: 'slot-component',
|
|
|
|
+ md: 24,
|
|
|
|
+ attributes: { disabled: false },
|
|
|
|
+ formItemAttributes: { label: '', prop: '' },
|
|
|
|
+ render: (h, { props, onInput }) => {
|
|
|
|
+ return (
|
|
|
|
+ <div>
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ onClick={() => {
|
|
|
|
+ this.visible = true
|
|
|
|
+ this.recordSelected = []
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ 添加
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button size="mini" onClick={() => this.handleAllDel()}>
|
|
|
|
+ 删除
|
|
|
|
+ </el-button>
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ : {}
|
|
|
|
+ ],
|
|
{
|
|
{
|
|
name: 'slot-component',
|
|
name: 'slot-component',
|
|
md: 24,
|
|
md: 24,
|
|
@@ -135,100 +324,169 @@ export default {
|
|
formItemAttributes: { label: '', prop: '' },
|
|
formItemAttributes: { label: '', prop: '' },
|
|
render: (h, { props, onInput }) => {
|
|
render: (h, { props, onInput }) => {
|
|
var { value } = props
|
|
var { value } = props
|
|
- return <zj-table></zj-table>
|
|
|
|
|
|
+ return (
|
|
|
|
+ <zj-table
|
|
|
|
+ isDrop={true}
|
|
|
|
+ columns={this.columns}
|
|
|
|
+ tableData={this.selectData}
|
|
|
|
+ tableAttributes={{ border: true, selectColumn: !this.comDisabled }}
|
|
|
|
+ tableEvents={this.itemTableEvents}
|
|
|
|
+ ></zj-table>
|
|
|
|
+ )
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- created() {
|
|
|
|
- this.getAuthList()
|
|
|
|
- this.getTemplateList()
|
|
|
|
- // this.getProviderList()
|
|
|
|
- this.getTemplateFollowType()
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- getAuthList() {
|
|
|
|
- getAuthList({
|
|
|
|
- pageNum: 1,
|
|
|
|
- pageSize: -1
|
|
|
|
- }).then(res => {
|
|
|
|
- this.authList = res.data.records.map(v => {
|
|
|
|
- return {
|
|
|
|
- label: v.companyName,
|
|
|
|
- value: v.companyCaAuthId
|
|
|
|
- }
|
|
|
|
|
|
+ mounted() {
|
|
|
|
+ this.getStagecustomerListV2()
|
|
|
|
+ if (this.detailsId) {
|
|
|
|
+ getCustomerTransferDetail({ id: this.detailsId }).then(res => {
|
|
|
|
+ this.formData = res.data
|
|
|
|
+ this.selectData = res.data.orders.map(k => {
|
|
|
|
+ k.disabledId = k.customerStockId
|
|
|
|
+ return k
|
|
})
|
|
})
|
|
|
|
+ delete this.formData.orders
|
|
})
|
|
})
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ // 列表请求函数
|
|
|
|
+ getList(...p) {
|
|
|
|
+ this.recordSelected = []
|
|
|
|
+ return getcustomerFrontList(...p)
|
|
|
|
+ },
|
|
|
|
+ // 表格列解析渲染数据更改
|
|
|
|
+ columnParsing(item, defaultData) {
|
|
|
|
+ return defaultData
|
|
|
|
+ }, // 监听勾选变化
|
|
|
|
+ selectionChange(data) {
|
|
|
|
+ this.recordSelected = data
|
|
|
|
+ },
|
|
|
|
+ itemSelectionChange(data) {
|
|
|
|
+ this.itemRecordSelected = data
|
|
|
|
+ },
|
|
|
|
+ selectable(row, index) {
|
|
|
|
+ for (let j = 0; j < this.selectData.length; j++) {
|
|
|
|
+ if (row.id === this.selectData[j].disabledId) {
|
|
|
|
+ this.$set(row, 'disabledId', this.selectData[j].disabledId)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (!row.disabledId) {
|
|
|
|
+ return true
|
|
|
|
+ } else {
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
},
|
|
},
|
|
- getTemplateList() {
|
|
|
|
- getTemplateList({
|
|
|
|
|
|
+ getStagecustomerListV2() {
|
|
|
|
+ getStagecustomerListV2({
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
- pageSize: -1
|
|
|
|
|
|
+ pageSize: -1,
|
|
|
|
+ params: [
|
|
|
|
+ {
|
|
|
|
+ param: 'a.higher_prant_id',
|
|
|
|
+ compare: 'like',
|
|
|
|
+ value: this.customerNumber || ''
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
}).then(res => {
|
|
}).then(res => {
|
|
- this.mainContractList = res.data.records.map(v => {
|
|
|
|
|
|
+ this.sonCustomerList = res.data.records.map(k => {
|
|
return {
|
|
return {
|
|
- label: v.contractTemplateName,
|
|
|
|
- value: v.contractTemplateId
|
|
|
|
|
|
+ label: k.name,
|
|
|
|
+ value: k.name
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- getProviderList() {
|
|
|
|
- getProviderList({
|
|
|
|
- pageNum: 1,
|
|
|
|
- pageSize: -1
|
|
|
|
- }).then(res => {
|
|
|
|
- this.serviceProviderList = res.data.records.map(v => {
|
|
|
|
- return {
|
|
|
|
- label: v.websitName,
|
|
|
|
- value: v.websitId
|
|
|
|
|
|
+ handleAddData() {
|
|
|
|
+ this.selectData = [...this.selectData, ...this.recordSelected]
|
|
|
|
+ for (let i = 0; i < this.$refs.pageRef.$children[0].tableData.length; i++) {
|
|
|
|
+ for (let j = 0; j < this.selectData.length; j++) {
|
|
|
|
+ if (this.$refs.pageRef.$children[0].tableData[i].id == this.selectData[j].id) {
|
|
|
|
+ this.$set(this.$refs.pageRef.$children[0].tableData[i], 'disabledId', this.selectData[j].id)
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.selectData = this.selectData.map(k => {
|
|
|
|
+ return {
|
|
|
|
+ materialCode: k.materialCode,
|
|
|
|
+ materialId: '',
|
|
|
|
+ materialName: k.materialName,
|
|
|
|
+ materialOldNumber: k.materialOldNumber,
|
|
|
|
+ notes: '',
|
|
|
|
+ qty: 0,
|
|
|
|
+ specification: k.specification,
|
|
|
|
+ disabledId: k.disabledId,
|
|
|
|
+ stockName: '嘉贤前置仓',
|
|
|
|
+ customerStockId: k.disabledId
|
|
|
|
+ }
|
|
})
|
|
})
|
|
|
|
+ this.visible = false
|
|
|
|
+ this.handleClearSelection()
|
|
},
|
|
},
|
|
- getTemplateFollowType() {
|
|
|
|
- getTemplateFollowType().then(res => {
|
|
|
|
- for (const key in res.data) {
|
|
|
|
- if (Object.hasOwnProperty.call(res.data, key)) {
|
|
|
|
- const element = res.data[key]
|
|
|
|
- this.filetype.push({
|
|
|
|
- label: element,
|
|
|
|
- value: key
|
|
|
|
- })
|
|
|
|
|
|
+ handleAllDel() {
|
|
|
|
+ if (this.itemRecordSelected.length) {
|
|
|
|
+ for (let i = 0; i < this.$refs.pageRef.$children[0].tableData.length; i++) {
|
|
|
|
+ for (let j = 0; j < this.itemRecordSelected.length; j++) {
|
|
|
|
+ if (this.$refs.pageRef.$children[0].tableData[i].id === this.itemRecordSelected[j].disabledId) {
|
|
|
|
+ this.$set(this.$refs.pageRef.$children[0].tableData[i], 'disabledId', null)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ for (let j = 0; j < this.itemRecordSelected.length; j++) {
|
|
|
|
+ for (let k = 0; k < this.selectData.length; k++) {
|
|
|
|
+ if (this.selectData[k].disabledId === this.itemRecordSelected[j].disabledId) {
|
|
|
|
+ this.selectData.splice(k, 1)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.handleClearSelection()
|
|
|
|
+ } else {
|
|
|
|
+ this.$errorMsg('请选择删除项')
|
|
|
|
+ }
|
|
},
|
|
},
|
|
-
|
|
|
|
- onReset() {
|
|
|
|
- this.fileList.splice(0, 1)
|
|
|
|
- this.fileList2.splice(0, 1)
|
|
|
|
- this.$refs.formRef.resetFields()
|
|
|
|
|
|
+ handleDel(index) {
|
|
|
|
+ for (let i = 0; i < this.$refs.pageRef.$children[0].tableData.length; i++) {
|
|
|
|
+ if (this.$refs.pageRef.$children[0].tableData[i].id === this.selectData[index].disabledId) {
|
|
|
|
+ this.$set(this.$refs.pageRef.$children[0].tableData[i], 'disabledId', null)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.selectData.splice(index, 1)
|
|
|
|
+ this.handleClearSelection()
|
|
|
|
+ },
|
|
|
|
+ handleClearSelection() {
|
|
|
|
+ this.recordSelected = []
|
|
|
|
+ this.$refs.pageRef.$children[0].$children[0].$children[2].$children[0].$children[0].clearSelection()
|
|
},
|
|
},
|
|
handlerefreshList() {
|
|
handlerefreshList() {
|
|
this.$emit('refresh')
|
|
this.$emit('refresh')
|
|
- this.$emit('handleClose')
|
|
|
|
|
|
+ this.onClose()
|
|
},
|
|
},
|
|
onClose() {
|
|
onClose() {
|
|
- this.$emit('handleClose')
|
|
|
|
|
|
+ this.formData = {}
|
|
|
|
+ this.selectData = []
|
|
|
|
+ this.$emit('close')
|
|
},
|
|
},
|
|
- onSubmit() {
|
|
|
|
|
|
+ onReset() {
|
|
|
|
+ this.$refs.formRef.resetFields()
|
|
|
|
+ this.selectData = []
|
|
|
|
+ },
|
|
|
|
+ onSubmit(type) {
|
|
this.$refs.formRef.validate(valid => {
|
|
this.$refs.formRef.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
const params = {
|
|
const params = {
|
|
...this.formData,
|
|
...this.formData,
|
|
- websitName: this.authList.find(k => k.value == this.formData.websitId).label
|
|
|
|
|
|
+ orders: this.selectData
|
|
}
|
|
}
|
|
-
|
|
|
|
- if (!this.edit) {
|
|
|
|
- params.contractTemplateId = ''
|
|
|
|
- addTemplateItem(params).then(res => {
|
|
|
|
- this.$successMsg('新增成功')
|
|
|
|
|
|
+ if (this.moduleType === 1) {
|
|
|
|
+ params.status = type
|
|
|
|
+ addCustomerTransfer(params).then(res => {
|
|
|
|
+ this.$successMsg(type === 'SAVE' ? '保存成功' : '新增成功')
|
|
this.handlerefreshList()
|
|
this.handlerefreshList()
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
- updateTemplateItem(params).then(res => {
|
|
|
|
|
|
+ updateCustomerTransfer(params).then(res => {
|
|
this.$successMsg('编辑成功')
|
|
this.$successMsg('编辑成功')
|
|
this.handlerefreshList()
|
|
this.handlerefreshList()
|
|
})
|
|
})
|
|
@@ -238,6 +496,24 @@ export default {
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ },
|
|
|
|
+ onExamine(type) {
|
|
|
|
+ examineCustomerTransfer({
|
|
|
|
+ id: this.detailsId,
|
|
|
|
+ status: type
|
|
|
|
+ }).then(res => {
|
|
|
|
+ this.$successMsg('审核成功')
|
|
|
|
+ this.handlerefreshList()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ onInvoice(type) {
|
|
|
|
+ examineCustomerTransfer({
|
|
|
|
+ id: this.detailsId,
|
|
|
|
+ status: type
|
|
|
|
+ }).then(res => {
|
|
|
|
+ this.$successMsg('撤回成功')
|
|
|
|
+ this.handlerefreshList()
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -250,5 +526,4 @@ export default {
|
|
color: red;
|
|
color: red;
|
|
line-height: 18px;
|
|
line-height: 18px;
|
|
}
|
|
}
|
|
-
|
|
|
|
</style>
|
|
</style>
|