master
lynn 6 months ago
parent 79f8e8c499
commit eb411371f7

@ -3,7 +3,7 @@ import request from '@/utils/request'
// 绑定/更新物资与运维规则的关系
export function saveStocksItem(data) {
return request({
url: '/api/admin/stocks-item/save',
url: '/api/admin/material-infos/save',
method: 'post',
data
})

@ -190,7 +190,7 @@
</template>
<script>
import { Button, Modal, Form, FormItem, Input, Select, Option, InputNumber, Table, Checkbox, Page } from 'view-design'
import { Button, Modal, Form, FormItem, Input, Select, Option, InputNumber, Table } from 'view-design'
import { getStorehouseTypeList } from '@/api/system/storehouseType'
import { getparameteritem } from '@/api/system/dictionary.js'
import { index } from '@/api/system/baseForm.js'
@ -209,9 +209,7 @@ export default {
Select,
Option,
InputNumber,
Table,
Checkbox,
Page
Table
},
data() {
return {
@ -242,11 +240,11 @@ export default {
table: [
{ label: '序号', type: 'index', width: 60 },
{ label: '规则名称', prop: 'name', minWidth: 160 },
{ label: '重复周期', prop: 'month_frequency', minWidth: 120, formatter: row => this.cycleOptions.find(opt => opt.value == row.month_frequency)?.label || row.month_frequency },
{ label: '起始日期设定', prop: 'start_standard', minWidth: 160, formatter: row => this.startStandardOptions.find(opt => opt.value == row.start_standard)?.label || row.start_standard },
{ label: '重复周期', prop: 'month_frequency', minWidth: 120, formatter: row => this.cycleOptions.find(opt => opt.value === row.month_frequency)?.label || row.month_frequency },
{ label: '起始日期设定', prop: 'start_standard', minWidth: 160, formatter: row => this.startStandardOptions.find(opt => opt.value === row.start_standard)?.label || row.start_standard },
{ label: '生成计划时机(天)', prop: 'advance_days', minWidth: 120 },
{ label: '已用于物资数', prop: 'stocks_items_count', minWidth: 120 },
{ label: '未完成时下次计划', prop: 'next_plan_type', minWidth: 160, formatter: row => this.nextPlanOptions.find(opt => opt.value == row.next_plan_type)?.label || row.next_plan_type }
{ label: '未完成时下次计划', prop: 'next_plan_type', minWidth: 160, formatter: row => this.nextPlanOptions.find(opt => opt.value === row.next_plan_type)?.label || row.next_plan_type }
],
tableHeight: 550,
showModal: false,
@ -514,7 +512,7 @@ export default {
'filter[1][value]': '一物一码'
}
const res = await request({
url: '/api/admin/stocks-item/index',
url: '/api/admin/material-infos/index',
method: 'post',
data: qs.stringify(data),
headers: {
@ -543,7 +541,7 @@ export default {
id: row.id,
equipment_maintain_config_id: null
})
this.$message.success(`已解除绑定物资"${row.material_info.suozaicangku}"`)
this.$message.success('已解除绑定物资')
this.searchMaterialsPost()
} catch (e) {
this.$message.error('解除绑定失败')
@ -555,10 +553,10 @@ export default {
id: row.id,
equipment_maintain_config_id: this.currentRule.id
})
this.$message.success(`已成功绑定物资"${row.material_info.suozaicangku}"`)
this.$message.success('已成功绑定物资')
this.searchMaterialsPost()
} catch (e) {
this.$message.error('绑定失败')
this.$message.error('绑定失败:' + e.message)
}
}
},
@ -654,12 +652,12 @@ export default {
clearArea(e) {
this.select.area = e || ''
this.getWarehouseNames()
this.filterWarehouses()
},
clearType(e) {
this.select.storehouses_id = e || ''
this.getWarehouseNames()
this.filterWarehouses()
},
async getAllWarehouses() {
try {
@ -703,15 +701,6 @@ export default {
}))
},
clearArea(e) {
this.select.area = e || ''
this.filterWarehouses()
},
clearType(e) {
this.select.storehouses_id = e || ''
this.filterWarehouses()
},
async handleCustomSubmit() {
this.$refs.form.validate(async(valid) => {
if (valid) {

Loading…
Cancel
Save