Update core smartproc
This commit is contained in:
@@ -6,11 +6,10 @@
|
||||
<div class="dx-card responsive-paddings">
|
||||
<div id="app-container">
|
||||
<DxDataGrid ref="currDataGrid"
|
||||
:data-source="customDataSource"
|
||||
key-expr="ID"
|
||||
:data-source="dataSource"
|
||||
key-expr="id"
|
||||
:allow-column-reordering="true"
|
||||
:column-auto-width="true"
|
||||
@exporting="onExporting">
|
||||
:column-auto-width="true">
|
||||
<DxEditing
|
||||
:allow-adding="true"
|
||||
:allow-updating="true"
|
||||
@@ -26,7 +25,9 @@
|
||||
cancel-row-changes="Batal"
|
||||
></DxTexts>
|
||||
<DxForm label-location="top" :col-count="1">
|
||||
<DxItem dataField="tahun" />
|
||||
<DxItem dataField="tahun">
|
||||
<DxRequiredRule message="Tahun harus diisi" />
|
||||
</DxItem>
|
||||
</DxForm>
|
||||
<DxPopup
|
||||
:hide-on-outside-click="true"
|
||||
@@ -57,7 +58,7 @@
|
||||
<DxFilterRow :visible="false" />
|
||||
<DxColumn cell-template="row-cell-template" caption="No" :width="45"></DxColumn>
|
||||
<DxColumn data-field="tahun" caption="Tahun DRP"></DxColumn>
|
||||
<DxColumn data-field="isApprove" caption="Status Approve"></DxColumn>
|
||||
<DxColumn data-field="isApprove" caption="Status Approve" editor-type="dxCheckBox"></DxColumn>
|
||||
<DxColumn data-field="approveDate" caption="Tanggal Approve"></DxColumn>
|
||||
<DxColumn type="buttons" caption="Aksi">
|
||||
<DxButton name="edit"/>
|
||||
@@ -76,11 +77,6 @@
|
||||
<DxText>{{ data.rowIndex +1 }}</DxText>
|
||||
</template>
|
||||
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" :width="300" placeholder="Cari Penyusunan DRP..."/>
|
||||
<!--<DxExport
|
||||
:enabled="true"
|
||||
:formats="['xlsx', 'pdf']"
|
||||
:allow-export-selected-data="true"
|
||||
/>-->
|
||||
</DxDataGrid>
|
||||
</div>
|
||||
</div>
|
||||
@@ -104,15 +100,10 @@ import DxDataGrid, {
|
||||
DxButton
|
||||
} from "devextreme-vue/data-grid";
|
||||
import CustomStore from "devextreme/data/custom_store";
|
||||
import { Workbook } from 'exceljs';
|
||||
import { saveAs } from 'file-saver-es';
|
||||
import { exportDataGrid as exportDataGridToExcel } from 'devextreme/excel_exporter';
|
||||
import { jsPDF } from 'jspdf';
|
||||
import { exportDataGrid as exportDataGridToPDF } from 'devextreme/pdf_exporter';
|
||||
|
||||
const URL = process.env.VUE_APP_ROOT_API+'/jenisanggaran';
|
||||
const URL = process.env.VUE_APP_ROOT_API+'/drp';
|
||||
|
||||
const customDataSource = new CustomStore({
|
||||
const dataSource = new CustomStore({
|
||||
key: 'id',
|
||||
|
||||
load: () => {
|
||||
@@ -171,52 +162,14 @@ export default {
|
||||
DxButton
|
||||
},
|
||||
methods: {
|
||||
onExporting(e) {
|
||||
e.cancel = true;
|
||||
|
||||
switch (e.format) {
|
||||
case "pdf": {
|
||||
const doc = new jsPDF();
|
||||
exportDataGridToPDF({
|
||||
jsPDFDocument: doc,
|
||||
component: e.component,
|
||||
indent: 5,
|
||||
}).then(() => {
|
||||
doc.save('Jenispengadaan.pdf');
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
case "xlsx": {
|
||||
const workbook = new Workbook();
|
||||
const worksheet = workbook.addWorksheet('Penyusunan DRP');
|
||||
|
||||
exportDataGridToExcel({
|
||||
component: e.component,
|
||||
worksheet: worksheet,
|
||||
autoFilterEnabled: true,
|
||||
}).then(() => {
|
||||
workbook.xlsx.writeBuffer().then((buffer) => {
|
||||
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), 'DataGrid.xlsx');
|
||||
});
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
},
|
||||
cloneIconClick(e) {
|
||||
e.event.preventDefault();
|
||||
},
|
||||
linkDetail(e) {
|
||||
console.log(e.id);
|
||||
window.location.href= '/#/drp/drp-penyusunan';
|
||||
linkDetail : function() {
|
||||
location.href='master-data/strategi-pengadaan';
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//jsonUrl: URL,
|
||||
customDataSource,
|
||||
dataSource,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user