|
|
|
@ -106,6 +106,18 @@
|
|
|
|
|
v-hasPermi="['wms:matenews:export']"
|
|
|
|
|
>导出</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="info"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-printer"
|
|
|
|
|
size="mini"
|
|
|
|
|
:disabled="single"
|
|
|
|
|
@click="openPrintDialog"
|
|
|
|
|
v-hasPermi="['mes:pro:workorder:edit']"
|
|
|
|
|
>打印标识卡
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
@ -135,19 +147,6 @@
|
|
|
|
|
<el-table-column label="备用7" align="center" prop="userDefined7" v-if="false" />
|
|
|
|
|
<el-table-column label="备用8" align="center" prop="userDefined8" v-if="false" />
|
|
|
|
|
<el-table-column label="备用9" align="center" prop="userDefined9" v-if="false" />
|
|
|
|
|
<!-- <el-table-column label="备用10" align="center" prop="userDefined10" v-if="false" />-->
|
|
|
|
|
<!-- <el-table-column label="创建时间" align="center" prop="gmtCreate" width="180">-->
|
|
|
|
|
<!-- <template slot-scope="scope">-->
|
|
|
|
|
<!-- <span>{{ parseTime(scope.row.gmtCreate, '{y}-{m}-{d}') }}</span>-->
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<!-- <el-table-column label="更新人" align="center" prop="lastModifiedBy" />-->
|
|
|
|
|
<!-- <el-table-column label="更新时间" align="center" prop="gmtModified" width="180">-->
|
|
|
|
|
<!-- <template slot-scope="scope">-->
|
|
|
|
|
<!-- <span>{{ parseTime(scope.row.gmtModified, '{y}-{m}-{d}') }}</span>-->
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<!-- <el-table-column label="有效标记" align="center" prop="activeFlag" v-if="false" />-->
|
|
|
|
|
|
|
|
|
|
<el-table-column label="SAP工厂号" align="center" prop="sapFactoryCode" v-if="false" />
|
|
|
|
|
|
|
|
|
@ -284,11 +283,26 @@
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="打印标识卡" :visible.sync="dialogVisible">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="printCount"
|
|
|
|
|
type="number"
|
|
|
|
|
placeholder="请输入要打印的张数"
|
|
|
|
|
min="1"
|
|
|
|
|
></el-input>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
|
|
<el-button type="primary" @click="confirmPrint">确 定</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { listMatenews, getMatenews, delMatenews, addMatenews, updateMatenews } from "@/api/wms/matenews";
|
|
|
|
|
import { listMatenews, getMatenews, delMatenews, addMatenews, updateMatenews ,addBS} from "@/api/wms/matenews";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "Matenews",
|
|
|
|
@ -298,8 +312,12 @@ export default {
|
|
|
|
|
loading: true,
|
|
|
|
|
// 选中数组
|
|
|
|
|
ids: [],
|
|
|
|
|
dialogVisible: false,
|
|
|
|
|
// 非单个禁用
|
|
|
|
|
single: true,
|
|
|
|
|
printCount: null,
|
|
|
|
|
selectedRows: [],
|
|
|
|
|
|
|
|
|
|
// 非多个禁用
|
|
|
|
|
multiple: true,
|
|
|
|
|
// 显示搜索条件
|
|
|
|
@ -443,6 +461,15 @@ export default {
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "添加包材库存主表";
|
|
|
|
|
},
|
|
|
|
|
openPrintDialog() {
|
|
|
|
|
// 检查是否选择了行
|
|
|
|
|
if (this.ids.length === 0) {
|
|
|
|
|
this.$message.warning('请先选择要打印的物料!');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 打开打印对话框
|
|
|
|
|
this.dialogVisible = true;
|
|
|
|
|
},
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
this.reset();
|
|
|
|
@ -453,6 +480,48 @@ export default {
|
|
|
|
|
this.title = "修改包材库存主表";
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
confirmPrint() {
|
|
|
|
|
if (this.printCount < 1) {
|
|
|
|
|
this.$message.warning('打印张数必须大于 0!');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const ids = this.ids[0];
|
|
|
|
|
// 发送请求到后端
|
|
|
|
|
// 发送请求到后端
|
|
|
|
|
const payload = {
|
|
|
|
|
storageId: ids, // 传递选中的 ID
|
|
|
|
|
userDefined10: this.printCount // 传递打印数量
|
|
|
|
|
};
|
|
|
|
|
// 这里假设 addBS 是一个 API 函数
|
|
|
|
|
addBS(payload)
|
|
|
|
|
.then(response => {
|
|
|
|
|
// 处理成功响应
|
|
|
|
|
this.$message.success(response.msg);
|
|
|
|
|
this.dialogVisible = false; // 关闭对话框
|
|
|
|
|
this.printCount = null; // 重置打印数量
|
|
|
|
|
this.getList(); // 重新获取数据
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
// 处理错误响应
|
|
|
|
|
this.$message.error('打印请求失败,请重试!');
|
|
|
|
|
console.error(error); // 打印错误到控制台
|
|
|
|
|
});
|
|
|
|
|
// this.$axios.post('/api/print', {
|
|
|
|
|
// ids,
|
|
|
|
|
// printCount: this.printCount,
|
|
|
|
|
// })
|
|
|
|
|
// .then(response => {
|
|
|
|
|
// this.$message.success('打印请求已发送成功!');
|
|
|
|
|
// this.dialogVisible = false; // 关闭对话框
|
|
|
|
|
// this.printCount = 1; // 重置打印数量
|
|
|
|
|
// // 这里可以根据需要重新获取数据
|
|
|
|
|
// this.getList();
|
|
|
|
|
// })
|
|
|
|
|
// .catch(error => {
|
|
|
|
|
// this.$message.error('打印请求失败,请重试!');
|
|
|
|
|
// });
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
@ -489,6 +558,7 @@ export default {
|
|
|
|
|
...this.queryParams
|
|
|
|
|
}, `matenews_${new Date().getTime()}.xlsx`)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|