|
@@ -1,22 +1,22 @@
|
|
|
<template>
|
|
|
<div class="mainContentBox">
|
|
|
<avue-crud
|
|
|
- ref="crudRef"
|
|
|
- v-model:search="search"
|
|
|
- v-model="form"
|
|
|
- :data="data"
|
|
|
- :option="option"
|
|
|
- v-model:page="page"
|
|
|
- @row-save="createRow"
|
|
|
- @row-update="updateRow"
|
|
|
- @row-del="deleteRow"
|
|
|
- @search-change="searchChange"
|
|
|
- @search-reset="resetChange"
|
|
|
- @size-change="dataList"
|
|
|
- @current-change="dataList"
|
|
|
- :row-style="rowStyle"
|
|
|
- :cell-style="cellStyle"
|
|
|
- @selection-change="selectionChange"
|
|
|
+ ref="crudRef"
|
|
|
+ v-model:search="search"
|
|
|
+ v-model="form"
|
|
|
+ :data="data"
|
|
|
+ :option="option"
|
|
|
+ v-model:page="page"
|
|
|
+ @row-save="createRow"
|
|
|
+ @row-update="updateRow"
|
|
|
+ @row-del="deleteRow"
|
|
|
+ @search-change="searchChange"
|
|
|
+ @search-reset="resetChange"
|
|
|
+ @size-change="dataList"
|
|
|
+ @current-change="dataList"
|
|
|
+ :row-style="rowStyle"
|
|
|
+ :cell-style="cellStyle"
|
|
|
+ @selection-change="selectionChange"
|
|
|
>
|
|
|
<template #menu-left="{ size }">
|
|
|
<el-button
|
|
@@ -30,12 +30,12 @@
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
<el-dialog
|
|
|
- v-model="dialog1.visible"
|
|
|
- :title="dialog1.title"
|
|
|
- width="950px"
|
|
|
- @close="dialog1.visible = false"
|
|
|
+ v-model="dialog1.visible"
|
|
|
+ :title="dialog1.title"
|
|
|
+ width="950px"
|
|
|
+ @close="dialog1.visible = false"
|
|
|
>
|
|
|
- <choice-item-page @materialInfo="materialInfo"/>
|
|
|
+ <choice-item-page @material-info="materialInfo" />
|
|
|
</el-dialog>
|
|
|
<ExcelUpload ref="uploadRef" @finished="uploadFinished" />
|
|
|
</div>
|
|
@@ -58,7 +58,8 @@ const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
useCrud({
|
|
|
src: "/api/v1/wms/stock",
|
|
|
});
|
|
|
-const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
|
|
|
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
|
+ Methords; //增删改查
|
|
|
const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
|
const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
|
|
|
@@ -68,12 +69,12 @@ const dialog1 = reactive({
|
|
|
visible: false,
|
|
|
});
|
|
|
const materialInfo = (value) => {
|
|
|
- form.value.materialNo = value.materialCode
|
|
|
- form.value.materialName = value.materialName
|
|
|
- form.value.materialModel = value.spec
|
|
|
- form.value.unit = value.unitDictValue
|
|
|
- dialog1.visible = false
|
|
|
-}
|
|
|
+ form.value.materialNo = value.materialCode;
|
|
|
+ form.value.materialName = value.materialName;
|
|
|
+ form.value.materialModel = value.spec;
|
|
|
+ form.value.unit = value.unitDictValue;
|
|
|
+ dialog1.visible = false;
|
|
|
+};
|
|
|
// 设置表格列或者其他自定义的option
|
|
|
option.value = Object.assign(option.value, {
|
|
|
delBtn: false,
|
|
@@ -133,8 +134,7 @@ option.value = Object.assign(option.value, {
|
|
|
search: true,
|
|
|
width: 90,
|
|
|
overHidden: true,
|
|
|
- dicUrl:
|
|
|
- dictDataUtil.request_url +"stock_material_type",
|
|
|
+ dicUrl: dictDataUtil.request_url + "stock_material_type",
|
|
|
props: {
|
|
|
label: "dictLabel",
|
|
|
value: "dictValue",
|
|
@@ -151,6 +151,7 @@ option.value = Object.assign(option.value, {
|
|
|
label: "料箱编号",
|
|
|
prop: "vehicleCode",
|
|
|
editDisabled: true,
|
|
|
+ search: true,
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -176,7 +177,7 @@ option.value = Object.assign(option.value, {
|
|
|
width: 120,
|
|
|
overHidden: true,
|
|
|
prop: "batchCode",
|
|
|
- search: true
|
|
|
+ search: true,
|
|
|
},
|
|
|
/*{
|
|
|
label: "流转卡号",
|
|
@@ -189,9 +190,10 @@ option.value = Object.assign(option.value, {
|
|
|
prop: "materialName",
|
|
|
width: 130,
|
|
|
overHidden: true,
|
|
|
+ search: true,
|
|
|
click: ({ value, column }) => {
|
|
|
- if(column.boxType){
|
|
|
- dialog1.visible = true
|
|
|
+ if (column.boxType) {
|
|
|
+ dialog1.visible = true;
|
|
|
}
|
|
|
},
|
|
|
/*rules: [
|
|
@@ -205,18 +207,18 @@ option.value = Object.assign(option.value, {
|
|
|
{
|
|
|
label: "数量",
|
|
|
prop: "num",
|
|
|
- type: 'number',
|
|
|
+ type: "number",
|
|
|
min: 0,
|
|
|
max: 99999,
|
|
|
width: 150,
|
|
|
overHidden: true,
|
|
|
- formatter:(val,value,label)=>{
|
|
|
- if(val.warningMsg){
|
|
|
- return val.num+"("+val.warningMsg+")"
|
|
|
- }else{
|
|
|
- return val.num
|
|
|
+ formatter: (val, value, label) => {
|
|
|
+ if (val.warningMsg) {
|
|
|
+ return val.num + "(" + val.warningMsg + ")";
|
|
|
+ } else {
|
|
|
+ return val.num;
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
label: "单位",
|
|
@@ -224,31 +226,31 @@ option.value = Object.assign(option.value, {
|
|
|
},
|
|
|
],
|
|
|
});
|
|
|
-const rowStyle = ({row,column,rowIndex}) =>{
|
|
|
- if(row.warningMsg){
|
|
|
+const rowStyle = ({ row, column, rowIndex }) => {
|
|
|
+ if (row.warningMsg) {
|
|
|
return {
|
|
|
- backgroundColor:'#f3d2d2',
|
|
|
- color:'#6c6a6a'
|
|
|
- }
|
|
|
+ backgroundColor: "#f3d2d2",
|
|
|
+ color: "#6c6a6a",
|
|
|
+ };
|
|
|
}
|
|
|
-}
|
|
|
-const cellStyle = ({row,column,rowIndex,columnIndex})=>{
|
|
|
- if(columnIndex === 10){
|
|
|
- if(row.warningMsg){
|
|
|
+};
|
|
|
+const cellStyle = ({ row, column, rowIndex, columnIndex }) => {
|
|
|
+ if (columnIndex === 10) {
|
|
|
+ if (row.warningMsg) {
|
|
|
return {
|
|
|
- color:'red',
|
|
|
- fontWeight:'bold',
|
|
|
- fontSize:'20'
|
|
|
- }
|
|
|
- }else{
|
|
|
+ color: "red",
|
|
|
+ fontWeight: "bold",
|
|
|
+ fontSize: "20",
|
|
|
+ };
|
|
|
+ } else {
|
|
|
return {
|
|
|
- color: '#60fc56',
|
|
|
- fontWeight:'bold',
|
|
|
- fontSize:'20'
|
|
|
- }
|
|
|
+ color: "#60fc56",
|
|
|
+ fontWeight: "bold",
|
|
|
+ fontSize: "20",
|
|
|
+ };
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+};
|
|
|
onMounted(() => {
|
|
|
// console.log("crudRef", crudRef)
|
|
|
dataList();
|