|
@@ -18,161 +18,139 @@
|
|
<a-row>
|
|
<a-row>
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
<a-form-model-item label="申请人" prop="applyPersonSn">
|
|
<a-form-model-item label="申请人" prop="applyPersonSn">
|
|
- <employee style="width: 100%;" id="billOfLading-Employee" v-model="queryParam.applyPersonSn"></employee>
|
|
|
|
|
|
+ <employee style="width: 100%;" id="billOfLading-Employee" v-model="form.applyPersonSn"></employee>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
- <a-form-model-item label="产品编码" prop="code">
|
|
|
|
|
|
+ <a-form-model-item label="主题" prop="code">
|
|
<a-input
|
|
<a-input
|
|
id="billOfLadingEdit-code"
|
|
id="billOfLadingEdit-code"
|
|
- :maxLength="100"
|
|
|
|
- :disabled="form.state&&form.state!='WAIT'"
|
|
|
|
|
|
+ :maxLength="30"
|
|
v-model.trim="form.code"
|
|
v-model.trim="form.code"
|
|
- placeholder="请输入产品编码(最多100个字符)"
|
|
|
|
|
|
+ placeholder="请输入主题(最多30个字符)"
|
|
allowClear />
|
|
allowClear />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
- <a-form-model-item label="原厂编码" prop="origCode">
|
|
|
|
|
|
+ <a-form-model-item label="物流公司" prop="origCode">
|
|
<a-input
|
|
<a-input
|
|
id="billOfLadingEdit-origCode"
|
|
id="billOfLadingEdit-origCode"
|
|
- :maxLength="200"
|
|
|
|
v-model.trim="form.origCode"
|
|
v-model.trim="form.origCode"
|
|
- placeholder="请输入(最多200个字符,多个编码用逗号隔开)"
|
|
|
|
|
|
+ placeholder="请选择物流公司"
|
|
allowClear />
|
|
allowClear />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
- <a-form-model-item label="其他编码" prop="otherCode">
|
|
|
|
|
|
+ <a-form-model-item label="物流点" prop="otherCode">
|
|
<a-input
|
|
<a-input
|
|
id="billOfLadingEdit-otherCode"
|
|
id="billOfLadingEdit-otherCode"
|
|
- :maxLength="60"
|
|
|
|
v-model.trim="form.otherCode"
|
|
v-model.trim="form.otherCode"
|
|
- placeholder="请输入(最多60个字符,多个编码用逗号隔开)"
|
|
|
|
|
|
+ placeholder="请选择物流点"
|
|
allowClear />
|
|
allowClear />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
- <a-form-model-item label="产品品牌" prop="productBrandSn">
|
|
|
|
- <a-select
|
|
|
|
- id="billOfLadingEdit-productBrand"
|
|
|
|
- placeholder="请选择产品品牌"
|
|
|
|
- allowClear
|
|
|
|
- v-model="form.productBrandSn"
|
|
|
|
- :showSearch="true"
|
|
|
|
- option-filter-prop="children"
|
|
|
|
- :filter-option="filterOption">
|
|
|
|
- <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn" :disabled="item.enabledFlag==0">{{ item.brandName }}</a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
|
|
+ <a-form-model-item label="发货方">
|
|
|
|
+ <dealerSubareaScopeList ref="dealerSubareaScopeList" id="billOfLadingEdit-buyerSn" @change="custChange" />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
- <a-form-model-item label="产品分类" prop="productType">
|
|
|
|
- <a-cascader
|
|
|
|
- :disabled="form.state&&form.state!='WAIT'"
|
|
|
|
- expand-trigger="hover"
|
|
|
|
- @change="changeProductType"
|
|
|
|
- :options="productTypeList"
|
|
|
|
- :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
|
|
|
|
- id="billOfLadingEdit-productType"
|
|
|
|
- placeholder="请选择产品分类"
|
|
|
|
- allowClear
|
|
|
|
- v-model="form.productType" />
|
|
|
|
|
|
+ <a-form-model-item label="收货人" prop="qrCode">
|
|
|
|
+ <a-input
|
|
|
|
+ id="billOfLadingEdit-qrCode"
|
|
|
|
+ :maxLength="30"
|
|
|
|
+ v-model.trim="form.qrCode"
|
|
|
|
+ placeholder="请输入收货人(最多30个字符)"
|
|
|
|
+ allowClear />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
- <a-form-model-item label="单位" prop="unit">
|
|
|
|
- <v-select
|
|
|
|
- code="PRODUCT_UNIT"
|
|
|
|
- id="billOfLadingEdit-unit"
|
|
|
|
- v-model="form.unit"
|
|
|
|
- allowClear
|
|
|
|
- placeholder="请选择单位"
|
|
|
|
- ></v-select>
|
|
|
|
|
|
+ <a-form-model-item label="电话" prop="qrCode">
|
|
|
|
+ <a-input
|
|
|
|
+ id="billOfLadingEdit-qrCode"
|
|
|
|
+ :maxLength="30"
|
|
|
|
+ v-model.trim="form.qrCode"
|
|
|
|
+ placeholder="请输入电话(最多30个字符)"
|
|
|
|
+ allowClear />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
- <a-form-model-item label="包装数" prop="packQty" :label-col="{span:4}" :wrapper-col="{span:16}">
|
|
|
|
|
|
+ <a-form-model-item label="件数" prop="packQty">
|
|
<a-input-number
|
|
<a-input-number
|
|
id="billOfLadingEdit-packQty"
|
|
id="billOfLadingEdit-packQty"
|
|
|
|
+ style="width:100%"
|
|
v-model="form.packQty"
|
|
v-model="form.packQty"
|
|
:precision="0"
|
|
:precision="0"
|
|
:min="1"
|
|
:min="1"
|
|
:max="999999"
|
|
:max="999999"
|
|
- placeholder="请输入"
|
|
|
|
|
|
+ placeholder="请输入件数"
|
|
/>
|
|
/>
|
|
- <span style="margin: 0 5px;">/</span>
|
|
|
|
- <v-select
|
|
|
|
- code="PRODUCT_PACK_UNIT"
|
|
|
|
- id="productLevelEdit-packQtyUnit"
|
|
|
|
- v-model="form.packQtyUnit"
|
|
|
|
- allowClear
|
|
|
|
- style="width: 100px;"
|
|
|
|
- placeholder="单位"
|
|
|
|
- ></v-select>
|
|
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
|
|
- <a-form-model-item label="箭冠产品" prop="arrowFalg">
|
|
|
|
- <v-select
|
|
|
|
- code="ARROW_FALG"
|
|
|
|
- id="billOfLadingEdit-arrowFalg"
|
|
|
|
- v-model="form.arrowFalg"
|
|
|
|
- allowClear
|
|
|
|
- placeholder="请选择"
|
|
|
|
- ></v-select>
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
|
|
- <a-form-model-item label="条形码" prop="qrCode">
|
|
|
|
|
|
+ <a-col :span="24">
|
|
|
|
+ <a-form-model-item label="运费" :label-col="{span:2}" :wrapper-col="{span:20}">
|
|
<a-input
|
|
<a-input
|
|
id="billOfLadingEdit-qrCode"
|
|
id="billOfLadingEdit-qrCode"
|
|
- :maxLength="50"
|
|
|
|
|
|
+ :maxLength="100"
|
|
v-model.trim="form.qrCode"
|
|
v-model.trim="form.qrCode"
|
|
- placeholder="请输入条形码(最多50个字符)"
|
|
|
|
|
|
+ placeholder="请输入运费(最多100个字符)"
|
|
allowClear />
|
|
allowClear />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
<a-row>
|
|
<a-row>
|
|
- <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
|
|
- <a-form-model-item label="产品尺寸" prop="size">
|
|
|
|
- <a-input
|
|
|
|
|
|
+ <a-col :spna="24">
|
|
|
|
+ <a-form-model-item style="margin-bottom:0" label="备注" prop="size" :label-col="{span:2}" :wrapper-col="{span:20}">
|
|
|
|
+ <a-textarea
|
|
v-model.trim="form.size"
|
|
v-model.trim="form.size"
|
|
id="billOfLadingEdit-size"
|
|
id="billOfLadingEdit-size"
|
|
- :maxLength="50"
|
|
|
|
|
|
+ :maxLength="500"
|
|
allowClear
|
|
allowClear
|
|
- placeholder="请输入产品尺寸(最多50个字符)" />
|
|
|
|
|
|
+ placeholder="请输入备注(最多500个字符)" />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
|
|
- <a-form-model-item label="产品重量" prop="weight">
|
|
|
|
- <a-input
|
|
|
|
- v-model.trim="form.weight"
|
|
|
|
- id="billOfLadingEdit-weight"
|
|
|
|
- :maxLength="50"
|
|
|
|
- allowClear
|
|
|
|
- placeholder="请输入产品重量(最多50个字符)" />
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
|
|
- <a-form-model-item label="颜色" prop="color">
|
|
|
|
- <a-input
|
|
|
|
- v-model.trim="form.color"
|
|
|
|
- id="productLevelEdit-color"
|
|
|
|
- :maxLength="50"
|
|
|
|
- allowClear
|
|
|
|
- placeholder="请输入颜色(最多50个字符)" />
|
|
|
|
|
|
+ <a-col :spna="24">
|
|
|
|
+ <a-form-model-item label="附件" help="说明:支持图片、word、excel、PDF等格式,最多10个附件。" :label-col="{span:2}" :wrapper-col="{span:20}">
|
|
|
|
+ <Upload
|
|
|
|
+ style="height: 100%;"
|
|
|
|
+ id="billOfLadingEdit-attachList"
|
|
|
|
+ v-model="form.expenseAccountFilesList"
|
|
|
|
+ ref="attachList"
|
|
|
|
+ :fileSize="10"
|
|
|
|
+ :maxNums="10"
|
|
|
|
+ fileType="*"
|
|
|
|
+ uploadType="attach"
|
|
|
|
+ :action="attachAction"
|
|
|
|
+ @change="changeAttach"
|
|
|
|
+ upText="上传附件"></Upload>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
|
|
- <a-form-model-item label="产品内盒尺寸" prop="boxSize">
|
|
|
|
- <a-input
|
|
|
|
- v-model.trim="form.boxSize"
|
|
|
|
- id="billOfLadingEdit-boxSize"
|
|
|
|
- :maxLength="50"
|
|
|
|
- allowClear
|
|
|
|
- placeholder="请输入产品内盒尺寸(最多50个字符)" />
|
|
|
|
|
|
+ <a-col :spna="24">
|
|
|
|
+ <a-form-model-item label="关联销退单" :label-col="{span:2}" :wrapper-col="{span:20}">
|
|
|
|
+ <a-button type="link" @click="openSelModal">选择销退单</a-button>
|
|
|
|
+ <div>
|
|
|
|
+ <a-table :columns="columns" :scroll="{ y: 400 }" :pagination="false" :data-source="chooseData" bordered>
|
|
|
|
+ <!-- 编号 -->
|
|
|
|
+ <template slot="no" slot-scope="text, record,index">
|
|
|
|
+ <span>{{ index+1 }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 单号 -->
|
|
|
|
+ <template slot="salesReturnBillNo" slot-scope="text, record">
|
|
|
|
+ <span>{{ record.salesReturnBillNo }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 操作 -->
|
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
|
+ <a-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="link"
|
|
|
|
+ class="button-error"
|
|
|
|
+ @click="handleDel(record)"
|
|
|
|
+ >
|
|
|
|
+ 删除
|
|
|
|
+ </a-button>
|
|
|
|
+ </template>
|
|
|
|
+ </a-table>
|
|
|
|
+ </div>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
@@ -184,11 +162,23 @@
|
|
type="primary"
|
|
type="primary"
|
|
class="button-primary"
|
|
class="button-primary"
|
|
:disabled="spinning"
|
|
:disabled="spinning"
|
|
- id="billOfLadingEdit-submit-btn"
|
|
|
|
|
|
+ id="billOfLadingEdit-save-btn"
|
|
size="large"
|
|
size="large"
|
|
- @click="handleSubmit"
|
|
|
|
|
|
+ @click="handleSave('save')"
|
|
style="padding: 0 60px;">保存</a-button>
|
|
style="padding: 0 60px;">保存</a-button>
|
|
|
|
+ <a-button
|
|
|
|
+ type="primary"
|
|
|
|
+ class="button-error"
|
|
|
|
+ :disabled="spinning"
|
|
|
|
+ id="billOfLadingEdit-submit-btn"
|
|
|
|
+ size="large"
|
|
|
|
+ @click="handleSave('submit')"
|
|
|
|
+ style="padding: 0 60px;">提交</a-button>
|
|
</div>
|
|
</div>
|
|
|
|
+ <!-- 关联销退单 -->
|
|
|
|
+ <selectXtModal ref="selXtModal" modalTit="选择销退单" :chooseData="chooseData" :openModal="showXtModal" @cancel="showXtModal=false"></selectXtModal>
|
|
|
|
+ <!-- 选择审核人员 -->
|
|
|
|
+ <chooseDepartUserModal :openModal="openDepartUserModal" @close="openDepartUserModal=false" @submit="handleSubmit"></chooseDepartUserModal>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -196,22 +186,27 @@
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { STable, VSelect, Upload } from '@/components'
|
|
import { STable, VSelect, Upload } from '@/components'
|
|
import { productSave, productSnDetail } from '@/api/product'
|
|
import { productSave, productSnDetail } from '@/api/product'
|
|
-import { productTypeQueryAll } from '@/api/productType'
|
|
|
|
-import { productBrandQuery } from '@/api/productBrand'
|
|
|
|
|
|
+import selectXtModal from './selectXtModal.vue'
|
|
import employee from '../../expenseManagement/expenseReimbursement/employee.js'
|
|
import employee from '../../expenseManagement/expenseReimbursement/employee.js'
|
|
|
|
+import chooseDepartUserModal from '../../expenseManagement/expenseReimbursement/chooseDepartUserModal.vue'
|
|
|
|
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
|
|
export default {
|
|
export default {
|
|
name: 'ProductInfoEdit',
|
|
name: 'ProductInfoEdit',
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
- components: { VSelect, Upload, STable, employee },
|
|
|
|
|
|
+ components: { VSelect, Upload, STable, employee, dealerSubareaScopeList, chooseDepartUserModal, selectXtModal },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
spinning: false,
|
|
spinning: false,
|
|
|
|
+ showXtModal: false,
|
|
|
|
+ openDepartUserModal: false,
|
|
formItemLayout: {
|
|
formItemLayout: {
|
|
labelCol: { span: 4 },
|
|
labelCol: { span: 4 },
|
|
wrapperCol: { span: 16 }
|
|
wrapperCol: { span: 16 }
|
|
},
|
|
},
|
|
|
|
+ attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo',
|
|
form: {
|
|
form: {
|
|
- name: '', // 产品名称
|
|
|
|
|
|
+ applyPersonSn: '', // 申请人
|
|
|
|
+ applyPersonName: '',
|
|
code: '', // 产品编码
|
|
code: '', // 产品编码
|
|
origCode: '', // 原厂编码
|
|
origCode: '', // 原厂编码
|
|
otherCode: '', // 其他编码
|
|
otherCode: '', // 其他编码
|
|
@@ -234,8 +229,8 @@ export default {
|
|
otherDesc: '' // 其他说明
|
|
otherDesc: '' // 其他说明
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
- name: [
|
|
|
|
- { required: true, message: '请输入产品名称', trigger: 'blur' }
|
|
|
|
|
|
+ applyPersonSn: [
|
|
|
|
+ { required: true, message: '请选择申请人', trigger: 'blur' }
|
|
],
|
|
],
|
|
code: [
|
|
code: [
|
|
{ required: true, message: '请输入产品编码', trigger: 'blur' }
|
|
{ required: true, message: '请输入产品编码', trigger: 'blur' }
|
|
@@ -249,177 +244,107 @@ export default {
|
|
unit: [
|
|
unit: [
|
|
{ required: true, message: '请选择单位', trigger: 'change' }
|
|
{ required: true, message: '请选择单位', trigger: 'change' }
|
|
],
|
|
],
|
|
- // packQty: [
|
|
|
|
- // { required: true, message: '请输入包装数', trigger: 'blur' }
|
|
|
|
- // ],
|
|
|
|
arrowFalg: [
|
|
arrowFalg: [
|
|
{ required: true, message: '请选择是否为箭冠产品', trigger: 'change' }
|
|
{ required: true, message: '请选择是否为箭冠产品', trigger: 'change' }
|
|
- ],
|
|
|
|
- qrCode: [
|
|
|
|
- { required: false, message: '请输入条形码', trigger: 'blur' },
|
|
|
|
- { validator: this.validateQrCode }
|
|
|
|
]
|
|
]
|
|
},
|
|
},
|
|
- productBrandList: [], // 品牌下拉数据
|
|
|
|
- productTypeList: [] // 分类下拉数据
|
|
|
|
|
|
+ chooseData: [],
|
|
|
|
+ columns: [
|
|
|
|
+ { title: '序号', scopedSlots: { customRender: 'no' }, width: '8%', align: 'center' },
|
|
|
|
+ { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '15%', align: 'center' },
|
|
|
|
+ { title: '客户名称', dataIndex: 'buyerName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
+ { title: '申请退货数量', dataIndex: 'totalQty', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '审核时间', dataIndex: 'auditTime', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '业务状态', dataIndex: 'billStatusDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
|
|
|
|
+ ]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ custChange (val) {
|
|
|
|
+ this.queryParam.buyerSn = val.key
|
|
|
|
+ },
|
|
|
|
+ openSelModal () {
|
|
|
|
+ this.showXtModal = true
|
|
|
|
+ },
|
|
// 详情
|
|
// 详情
|
|
getDetail () {
|
|
getDetail () {
|
|
- productSnDetail({ sn: this.$route.params.sn }).then(res => {
|
|
|
|
|
|
+ this.spinning = true
|
|
|
|
+ this.disabled = true
|
|
|
|
+ expenseAccountDetail({ expenseAccountSn: this.expenseAccountSn }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
const data = res.data
|
|
const data = res.data
|
|
this.form = Object.assign(this.form, data)
|
|
this.form = Object.assign(this.form, data)
|
|
- this.form.productType = [ this.form.productTypeSn1, this.form.productTypeSn2, this.form.productTypeSn3 ]
|
|
|
|
- if (res.data.productPicList && res.data.productPicList.length > 0) {
|
|
|
|
- let str = ''
|
|
|
|
- res.data.productPicList.map(item => {
|
|
|
|
- if (item.imageUrl) {
|
|
|
|
- str += item.imageUrl + ','
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- str = str.substr(0, str.length - 1)
|
|
|
|
- this.$refs.productMsg.setFileList(str)
|
|
|
|
- this.form.productMsg = str
|
|
|
|
- } else {
|
|
|
|
- this.$refs.productMsg.setFileList('')
|
|
|
|
- this.form.productMsg = ''
|
|
|
|
- }
|
|
|
|
- this.$refs.editor.setHtml(res.data.description)
|
|
|
|
- this.$refs.otherDesc.setHtml(res.data.otherDesc)
|
|
|
|
|
|
+ // 获取附件列表
|
|
|
|
+ this.form.expenseAccountFilesList = ''
|
|
|
|
+ this.attachList = res.data.expenseAccountFilesList
|
|
|
|
+ this.$refs.attachList.setFileList(this.attachList)
|
|
} else {
|
|
} else {
|
|
this.$refs.ruleForm.resetFields()
|
|
this.$refs.ruleForm.resetFields()
|
|
}
|
|
}
|
|
|
|
+ this.spinning = false
|
|
|
|
+ this.disabled = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 提交
|
|
// 提交
|
|
- handleSubmit (e) {
|
|
|
|
- e.preventDefault()
|
|
|
|
|
|
+ handleSave (type) {
|
|
const _this = this
|
|
const _this = this
|
|
- if (!this.form.productTypeSn3) {
|
|
|
|
- this.$message.warning('产品分类未选到第三级,请修改后再提交!')
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
this.$refs.ruleForm.validate(valid => {
|
|
this.$refs.ruleForm.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- const form = JSON.parse(JSON.stringify(_this.form))
|
|
|
|
- form.id = _this.$route.params.id ? _this.$route.params.id : undefined
|
|
|
|
- form.productPicList = []
|
|
|
|
- if (form.productMsg) {
|
|
|
|
- const arr = form.productMsg.split(',')
|
|
|
|
- arr.map(item => {
|
|
|
|
- form.productPicList.push({ imageUrl: item })
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- delete form.productMsg
|
|
|
|
- delete form.productType
|
|
|
|
- delete form.updateDate
|
|
|
|
- _this.spinning = true
|
|
|
|
- productSave(form).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- _this.$message.success(res.message)
|
|
|
|
- setTimeout(() => {
|
|
|
|
- _this.handleBack()
|
|
|
|
|
|
+ if (this.chooseData.length == 0) {
|
|
|
|
+ _this.$message.info('请选择销退单')
|
|
|
|
+ } else {
|
|
|
|
+ // 保存
|
|
|
|
+ if (type == 'save') {
|
|
|
|
+ const form = JSON.parse(JSON.stringify(_this.form))
|
|
|
|
+ form.id = _this.$route.params.id ? _this.$route.params.id : undefined
|
|
|
|
+ form.expenseAccountFilesList = _this.attachList
|
|
|
|
+ _this.spinning = true
|
|
|
|
+ productSave(form).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ _this.$message.success(res.message)
|
|
|
|
+ _this.handleBack()
|
|
|
|
+ }
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
- }, 1000)
|
|
|
|
- } else {
|
|
|
|
- _this.spinning = false
|
|
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ // 提交
|
|
|
|
+ if (type == 'submit') {
|
|
|
|
+ _this.openDepartUserModal = true
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
- console.log('error submit!!')
|
|
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 返回
|
|
|
|
- handleBack () {
|
|
|
|
- this.$router.push({ path: '/productManagement/productInfo/list', query: { closeLastOldTab: true } })
|
|
|
|
- },
|
|
|
|
- // 产品图片上传
|
|
|
|
- changeImage (file) {
|
|
|
|
- this.form.productMsg = file
|
|
|
|
- },
|
|
|
|
- validateQrCode (rule, value, callback) {
|
|
|
|
- const reg = /^[0-9a-zA-Z]+$/
|
|
|
|
- if (value && !reg.test(value)) {
|
|
|
|
- callback('条形码由大小写英文字母和数字组成')
|
|
|
|
- } else {
|
|
|
|
- callback()
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 产品说明 文本编辑器
|
|
|
|
- editorDescriptionChange (html, text) {
|
|
|
|
- this.form.description = html
|
|
|
|
- },
|
|
|
|
- // 其他说明 文本编辑器
|
|
|
|
- editorOtherChange (html, text) {
|
|
|
|
- this.form.otherDesc = html
|
|
|
|
- },
|
|
|
|
- // 产品分类 change
|
|
|
|
- changeProductType (val, opt) {
|
|
|
|
- this.form.productTypeSn1 = val[0] ? val[0] : ''
|
|
|
|
- this.form.productTypeSn2 = val[1] ? val[1] : ''
|
|
|
|
- this.form.productTypeSn3 = val[2] ? val[2] : ''
|
|
|
|
- },
|
|
|
|
- // 产品品牌 列表
|
|
|
|
- getProductBrand () {
|
|
|
|
- productBrandQuery({}).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.productBrandList = res.data
|
|
|
|
- } else {
|
|
|
|
- this.productBrandList = []
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 产品分类 列表
|
|
|
|
- getProductType () {
|
|
|
|
- productTypeQueryAll({}).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- if (res.data && res.data.length > 0) {
|
|
|
|
- // 递归处理disabled禁用
|
|
|
|
- this.recursionFun(res.data, false)
|
|
|
|
- this.productTypeList = res.data
|
|
|
|
- } else {
|
|
|
|
- this.productTypeList = []
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- this.productTypeList = []
|
|
|
|
|
|
+ // 提交信息
|
|
|
|
+ handleSubmit (data) {
|
|
|
|
+ this.spinning = true
|
|
|
|
+ expenseAccountSubmit({ expenseAccountSn: this.$route.params.sn, ...data }).then(res => {
|
|
|
|
+ if (res.status == '200') {
|
|
|
|
+ this.$message.success(res.message)
|
|
|
|
+ this.handleBack()
|
|
}
|
|
}
|
|
|
|
+ this.spinning = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 递归函数
|
|
|
|
- recursionFun (data, state) {
|
|
|
|
- if (data) {
|
|
|
|
- data.map((item, index) => {
|
|
|
|
- // enabledFlag为0表示禁用,父级禁用则子级也为禁用
|
|
|
|
- if ((item.enabledFlag && item.enabledFlag == 0) || state) {
|
|
|
|
- item.disabled = true
|
|
|
|
- } else {
|
|
|
|
- item.disabled = false
|
|
|
|
- }
|
|
|
|
- if (item.children && item.children.length == 0) {
|
|
|
|
- delete item.children
|
|
|
|
- } else {
|
|
|
|
- this.recursionFun(item.children, item.disabled)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ // 返回
|
|
|
|
+ handleBack () {
|
|
|
|
+ this.$router.push({ name: 'billOfLadingList' })
|
|
},
|
|
},
|
|
- filterOption (input, option) {
|
|
|
|
- return (
|
|
|
|
- option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
|
- )
|
|
|
|
|
|
+ // 附件上传
|
|
|
|
+ changeAttach (file) {
|
|
|
|
+ this.attachList = JSON.parse(file)
|
|
|
|
+ this.attachList.map(item => {
|
|
|
|
+ item.fileType = item.extName
|
|
|
|
+ })
|
|
},
|
|
},
|
|
pageInit () {
|
|
pageInit () {
|
|
- this.$refs.productMsg.setFileList('')
|
|
|
|
- this.$refs.editor.setHtml('')
|
|
|
|
- this.$refs.otherDesc.setHtml('')
|
|
|
|
|
|
+ this.attachList = []
|
|
|
|
+ this.form.expenseAccountFilesList = ''
|
|
|
|
+ this.$refs.attachList.setFileList('')
|
|
this.$refs.ruleForm.resetFields()
|
|
this.$refs.ruleForm.resetFields()
|
|
- this.form.packQtyUnit = undefined
|
|
|
|
- this.getProductBrand()
|
|
|
|
- this.getProductType()
|
|
|
|
if (this.$route.params.id) { // 编辑页
|
|
if (this.$route.params.id) { // 编辑页
|
|
this.getDetail()
|
|
this.getDetail()
|
|
}
|
|
}
|