| | |
| | | <!-- |
| | | * @Date: 2024-05-08 21:29:53 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-05-09 20:41:57 |
| | | * @LastEditTime: 2024-06-16 14:41:35 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/console/basic-data/material-warehousing-data/material-infoComp1.vue |
| | | --> |
| | | <template> |
| | | <el-containter> |
| | | <el-header> |
| | | <el-button @click="table_add" type="primary" icon="el-icon-plus"></el-button> |
| | | <el-button type="primary">导入</el-button> |
| | | <el-button type="primary">导出</el-button> |
| | | <!-- <el-button type="primary">导入</el-button> --> |
| | | <import-table style="margin:0 8px" :exportUrl="exportUrl" :uploadUrl="uploadUrl"></import-table> |
| | | <el-button type="primary" @click="getExport">导出</el-button> |
| | | <el-popconfirm width="220" cancel-button-text="停用" confirm-button-text="删除" |
| | | title="删除数据会影响已关联的业务 ,若您想在已关联的业务中依然显示这些数据, 您可以选择 停用 操作。停用后此数据将不能再被新业务使用。" |
| | | @confirm="table_del(selection, '0')" @cancel="table_del(selection, '1')"> |
| | | <template #reference> |
| | | <el-button :disabled="selection.length == 0" type="danger" plain icon="el-icon-delete" |
| | | @click="batchDel"></el-button> |
| | | <el-button :disabled="selection.length == 0" type="danger" plain icon="el-icon-delete"></el-button> |
| | | </template> |
| | | </el-popconfirm> |
| | | |
| | |
| | | <el-table-column prop="stuff" label="材质" /> |
| | | <el-table-column prop="property" label="物料属性"> |
| | | <template #default="scope"> |
| | | {{ this.options.property.find(v => v.value == scope.row.property).label }} |
| | | {{ this.options.property.find(v => v.value == scope.row.property)?.label }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="isMustCheckName" label="是否必检"> |
| | |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="额定库存" prop="lowerLimit"> |
| | | <el-input-number v-model="form.upperLimit" :precision="2" :step="0.01" :max="10" /> |
| | | <el-input-number v-model="form.lowerLimit" :precision="2" :step="0.01" :max="10" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import importTable from '@/layout/components/importTable.vue' |
| | | export default { |
| | | components: { |
| | | importTable, |
| | | }, |
| | | data() { |
| | | return { |
| | | uploadUrl: "/api/smis/material/import-material", |
| | | exportUrl: "/api/smis/material/export-template", |
| | | options: { |
| | | status: [ |
| | | { |
| | |
| | | let params = { |
| | | ...data |
| | | } |
| | | return await this.$HTTP.get(`/api/blade-cps/material/page`, params).then(res => { |
| | | return await this.$HTTP.get(`/api/smis/material/page`, params).then(res => { |
| | | return res |
| | | }) |
| | | } |
| | |
| | | }, |
| | | methods: { |
| | | init() { |
| | | this.$HTTP.get(`/api/blade-cps/material-type/list`).then(res => { |
| | | this.$HTTP.get(`/api/smis/material-type/list`).then(res => { |
| | | this.options.typeId = res.data.map(item => ({ |
| | | label: item.name, |
| | | value: item.id |
| | |
| | | ...row |
| | | } |
| | | }, |
| | | batchDel() { |
| | | |
| | | getExport() { |
| | | this.$HTTP.post(`/api/smis/material/export-material`, { ...this.params }).then(res => { |
| | | if (res.code == 200) { |
| | | window.open(res.data.link); |
| | | } |
| | | }).catch(() => { }) |
| | | }, |
| | | dataChange() { |
| | | |
| | | }, |
| | | table_del(rowArr, type) { |
| | | this.$HTTP.delete(`/api/blade-cps/material/delete-material?ids=${rowArr.map(v => v.id).toString()}&type=${type}`).then(res => { |
| | | this.$HTTP.delete(`/api/smis/material/delete-material?ids=${rowArr.map(v => v.id).toString()}&type=${type}`).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功"); |
| | | this.$refs.table.reload(this.params) |
| | |
| | | this.$refs.dialogForm.validate(async (valid) => { |
| | | if (valid) { |
| | | if (this.form.id) { |
| | | this.$HTTP.put(`/api/blade-cps/material/update-material`, { |
| | | this.$HTTP.put(`/api/smis/material/update-material`, { |
| | | ...this.form |
| | | }).then(res => { |
| | | this.drawer = false |
| | | this.$refs.table.reload(this.params) |
| | | }) |
| | | } else { |
| | | this.$HTTP.post(`/api/blade-cps/material/create-material`, { |
| | | this.$HTTP.post(`/api/smis/material/create-material`, { |
| | | ...this.form |
| | | }).then(res => { |
| | | this.drawer = false |