<!DOCTYPE html>
<html>
<head>
    <title>分销商，distributor</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
        <Row :gutter="16">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.distName" @on-enter="query" placeholder="供货商名称"/>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
            <div class="buttons-group">
                #if($shiro.hasPermission("mkdist:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("mkdist:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("mkdist:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
		<i-form ref="formValidate" :model="mkDist" :rules="ruleValidate" :label-width="120">
            <Form-item label="分销商名称" prop="distName">
                <i-input v-model="mkDist.distName" placeholder="分销商名称"/>
            </Form-item>
            <Form-item label="分销商英文名" prop="distEname">
                <i-input v-model="mkDist.distEname" placeholder="分销商英文名"/>
            </Form-item>
            <Form-item label="分销商标识" prop="distFlag">
                <i-input v-model="mkDist.distFlag" placeholder="分销商标识"/>
            </Form-item>
            <Form-item label="所属三方商户" prop="thirdMerchSn">
                <i-select v-model="mkDist.thirdMerchSn" placeholder="所属三方商户" @on-change="showSupplier" style="width: 268px;">
                    <i-option v-for="thirdMerchant in thirdMerchantBizList" :value="thirdMerchant.thirdMerchSn" :key="thirdMerchant.thirdMerchSn">{{thirdMerchant.thirdPartyMerchName}}</i-option>
                </i-select>
            </Form-item>
            <Form-item label="所属门店" prop="storeId">
                <i-select v-model="mkDist.storeId" placeholder="所属门店" style="width: 268px;">
                    <i-option v-for="store in storeList" :value="store.id" :key="store.id">{{store.storeName}}</i-option>
                </i-select>
            </Form-item>

            <Form-item label="所属供应商" prop="supplierId">
                <i-select v-model="mkDist.supplierId" placeholder="所属供应商" style="width: 268px;">
                    <i-option v-for="supplier in suppliers" :value="supplier.id" :key="supplier.id">{{supplier.childSupplierName}}
                    </i-option>
                </i-select>
            </Form-item>
            <Form-item label="排序" prop="sortOrder">
                <i-input v-model="mkDist.sortOrder" placeholder="排序"/>
            </Form-item>
            <Form-item label="是否有效" prop="isValid">
                <Radio-group v-model="mkDist.isValid">
                    <Radio label="1">
                        <span>无效</span>
                    </Radio>
                    <Radio label="0">
                        <span>有效</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item label="备注" prop="note">
                <i-input v-model="mkDist.note" placeholder="备注"/>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
	</Card>
</div>

<script src="${rc.contextPath}/js/mk/mkdist.js?_${date.systemTime}"></script>
</body>
</html>