Commit 50756dbd authored by 黄卓's avatar 黄卓

readonly

parent 5d38fd12
...@@ -14,13 +14,13 @@ ...@@ -14,13 +14,13 @@
:key="index" v-model="dataList[index]" :key="index" v-model="dataList[index]"
:index="index" :attr-list="attrList" :index="index" :attr-list="attrList"
@handle-delete="handleDelete(index)" @handle-delete="handleDelete(index)"
:read-only="readOnly" :readonly="readonly"
/> />
</el-form> </el-form>
<el-button v-show="!readOnly" type="primary" size="mini" @click="handleAddItem">添加一条明细</el-button> <el-button v-show="!readonly" type="primary" size="mini" @click="handleAddItem">添加一条明细</el-button>
<span v-show="!readOnly" slot="footer" class="dialog-footer"> <span v-show="!readonly" slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button> <el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="handleSave">确 定</el-button> <el-button type="primary" @click="handleSave">确 定</el-button>
</span> </span>
...@@ -45,7 +45,7 @@ export default { ...@@ -45,7 +45,7 @@ export default {
type: Array, type: Array,
default: () => [] default: () => []
}, },
readOnly: { readonly: {
type: Boolean, type: Boolean,
default: false default: false
} }
...@@ -117,7 +117,7 @@ export default { ...@@ -117,7 +117,7 @@ export default {
this.dialogVisible = true this.dialogVisible = true
}, },
handleClose(done) { handleClose(done) {
if (this.readOnly) { if (this.readonly) {
return done() return done()
} }
this.$confirm('确认关闭?') this.$confirm('确认关闭?')
...@@ -134,7 +134,7 @@ export default { ...@@ -134,7 +134,7 @@ export default {
computed: { computed: {
title() { title() {
if (this.readOnly) { if (this.readonly) {
return '查看箱明细' return '查看箱明细'
} }
return !this.value || this.value.length === 0 ? '添加箱明细' : '编辑箱明细' return !this.value || this.value.length === 0 ? '添加箱明细' : '编辑箱明细'
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
<el-card style="margin-bottom: 10px"> <el-card style="margin-bottom: 10px">
<div slot="header"> <div slot="header">
<span>序号{{ index + 1 }}</span> <span>序号{{ index + 1 }}</span>
<el-link v-show="!readOnly" type="danger" @click="handleDelete" style="float: right">删除</el-link> <el-link v-show="!readonly" type="danger" @click="handleDelete" style="float: right">删除</el-link>
</div> </div>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('中文品名')"> <el-form-item :label="$t('中文品名')">
<product-selector v-model="value.prodId" determined protect-once :disabled="readOnly" /> <product-selector v-model="value.prodId" determined protect-once :disabled="readonly" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
filterable filterable
remote remote
:remote-method="getProductBrandPage" :remote-method="getProductBrandPage"
:disabled="readOnly" :disabled="readonly"
clearable> clearable>
<el-option <el-option
v-for="item in brandList" v-for="item in brandList"
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('商品特性')"> <el-form-item :label="$t('商品特性')">
<el-checkbox-group v-model="prodAttrIds"> <el-checkbox-group v-model="prodAttrIds">
<el-checkbox v-for="item in attrList" :key="item.id" :label="item.id" :disabled="readOnly">{{ item.attrName }}</el-checkbox> <el-checkbox v-for="item in attrList" :key="item.id" :label="item.id" :disabled="readonly">{{ item.attrName }}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
:type="DICT_TYPE.WAREHOUSING_RECORD_DETAIL_USAGE" :type="DICT_TYPE.WAREHOUSING_RECORD_DETAIL_USAGE"
multiple multiple
form-type="checkbox" form-type="checkbox"
:disabled="readOnly" :disabled="readonly"
></dict-selector> ></dict-selector>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -53,44 +53,44 @@ ...@@ -53,44 +53,44 @@
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="4"> <el-col :span="4">
<el-form-item :label="$t('长')"> <el-form-item :label="$t('长')">
<el-input v-model="boxGauge1" :disabled="readOnly" /> <el-input v-model="boxGauge1" :disabled="readonly" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item :label="$t('宽')"> <el-form-item :label="$t('宽')">
<el-input v-model="boxGauge2" :disabled="readOnly" /> <el-input v-model="boxGauge2" :disabled="readonly" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item :label="$t('高')"> <el-form-item :label="$t('高')">
<el-input v-model="boxGauge3" :disabled="readOnly" /> <el-input v-model="boxGauge3" :disabled="readonly" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item :label="$t('重量')"> <el-form-item :label="$t('重量')">
<el-input v-model="value.weight" :disabled="readOnly" /> <el-input v-model="value.weight" :disabled="readonly" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item :label="$t('体积')"> <el-form-item :label="$t('体积')">
<el-input v-model="value.volume" :disabled="readOnly" /> <el-input v-model="value.volume" :disabled="readonly" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="4"> <el-col :span="4">
<el-form-item :label="$t('快递单号')"> <el-form-item :label="$t('快递单号')">
<el-input v-model="value.expressNo" :disabled="readOnly" /> <el-input v-model="value.expressNo" :disabled="readonly" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item :label="$t('包装类型')"> <el-form-item :label="$t('包装类型')">
<dict-selector :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="value.unit" :disabled="readOnly"></dict-selector> <dict-selector :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="value.unit" :disabled="readonly"></dict-selector>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item :label="$t('数量')"> <el-form-item :label="$t('数量')">
<el-input v-model="value.quantityAll" :disabled="readOnly" /> <el-input v-model="value.quantityAll" :disabled="readonly" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -120,7 +120,7 @@ export default { ...@@ -120,7 +120,7 @@ export default {
type: Number, type: Number,
default: 0 default: 0
}, },
readOnly: { readonly: {
type: Boolean, type: Boolean,
default: false default: false
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment