|
|
|
@ -27,6 +27,8 @@ let site = { |
|
|
|
active: '', |
|
|
|
buNo: '', |
|
|
|
defaultCountry:'', |
|
|
|
autoSerialNumber: '', |
|
|
|
siteCode: '', |
|
|
|
} |
|
|
|
export default { |
|
|
|
name: 'TblBaseData', |
|
|
|
@ -49,11 +51,13 @@ export default { |
|
|
|
siteForm:{ |
|
|
|
...site, |
|
|
|
active: 'Y', |
|
|
|
autoSerialNumber: 'N', |
|
|
|
}, |
|
|
|
saveFormRules:{ |
|
|
|
siteName: [{ required: true, message: 'Please input Site Name', trigger: ['blur','change'] }], |
|
|
|
active: [{ required: true, message: 'Please select Active', trigger: ['blur','change'] }], |
|
|
|
defaultCountry: [{ required: true, message: 'Please select Default Country', trigger: ['blur','change'] }], |
|
|
|
siteCode: [{ required: true, message: 'Please input Site Code', trigger: ['blur','change'] }], |
|
|
|
}, |
|
|
|
saveVisible: false, |
|
|
|
tableLoading: false, |
|
|
|
@ -331,6 +335,7 @@ export default { |
|
|
|
closeSaveForm(){ |
|
|
|
this.siteForm = { |
|
|
|
...site, |
|
|
|
autoSerialNumber: 'N', |
|
|
|
active: 'Y' |
|
|
|
} |
|
|
|
this.$refs.siteForm.resetFields(); |
|
|
|
@ -447,6 +452,11 @@ export default { |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
watch:{ |
|
|
|
'siteForm.siteCode'(newVal, oldVal){ |
|
|
|
this.siteForm.siteCode = newVal.toUpperCase() |
|
|
|
} |
|
|
|
}, |
|
|
|
created () { |
|
|
|
if (this.$store.state.user.userType === 'Site Admin'){ |
|
|
|
this.site.siteId = this.$store.state.user.site |
|
|
|
@ -454,6 +464,7 @@ export default { |
|
|
|
this.getSiteList(); |
|
|
|
this.getTableUserColumn("998001Table",1) |
|
|
|
// this.getTableDefaultListGroupLanguage("998001Table") |
|
|
|
console.log(this.$store.state.user.autoSerialNumber) |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
@ -515,24 +526,37 @@ export default { |
|
|
|
<el-dialog v-drag modal-append-to-body :close-on-click-modal="false" :title="`Site`" @close="closeSaveForm" width="600px" :visible.sync="saveVisible"> |
|
|
|
<el-form :model="siteForm" label-position="top" style="padding: 10px" :rules="saveFormRules" ref="siteForm"> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="Site ID" prop="siteId" :show-message="false"> |
|
|
|
<el-input v-model="siteForm.siteId" readonly disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="18"> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="Site Name" prop="siteName" :show-message="false"> |
|
|
|
<el-input v-model="siteForm.siteName"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label=" " :show-message="false"> |
|
|
|
<el-checkbox v-model="siteForm.autoSerialNumber" true-label="Y" false-label="N">Auto SN Generation</el-checkbox> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item key="siteCode" label="Site Code" v-if="siteForm.autoSerialNumber === 'Y'" prop="siteCode" :show-message="false"> |
|
|
|
<el-input v-model="siteForm.siteCode"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="Site Code" v-else :show-message="false"> |
|
|
|
<el-input v-model="siteForm.siteCode"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="16"> |
|
|
|
<el-form-item label="Address" prop="address" :show-message="false"> |
|
|
|
<el-input v-model="siteForm.address"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="Contact" prop="contact" :show-message="false"> |
|
|
|
<el-input v-model="siteForm.contact"></el-input> |
|
|
|
</el-form-item> |
|
|
|
@ -542,11 +566,6 @@ export default { |
|
|
|
<el-input v-model="siteForm.email" ></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<!-- <el-col :span="18">--> |
|
|
|
<!-- <el-form-item label="Contact Phone No" prop="phoneNo" :show-message="false">--> |
|
|
|
<!-- <el-input v-model="siteForm.phoneNo"></el-input>--> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
<!-- </el-col>--> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="Contact Phone No" prop="phoneNo" :show-message="false"> |
|
|
|
<el-input v-model="siteForm.phoneNo"></el-input> |
|
|
|
@ -559,7 +578,7 @@ export default { |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label=" " :show-message="false"> |
|
|
|
<el-checkbox v-model="siteForm.active" true-label="Y" false-label="N">Active</el-checkbox> |
|
|
|
</el-form-item> |
|
|
|
|