|
@@ -51,6 +51,111 @@
|
|
|
/>
|
|
|
</div>
|
|
|
</template>
|
|
|
+
|
|
|
+ <template #btns="{ item }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <div v-if="props.isShowSelect">
|
|
|
+ <el-button text type="primary" @click="handleSelectRow(item)"
|
|
|
+ >选择</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <!-- 制图 -->
|
|
|
+ <div v-if="isZhiTu && item.researchStatus">
|
|
|
+ <span v-if="item.isCustomized == 1">
|
|
|
+ <el-button
|
|
|
+ text
|
|
|
+ type="primary"
|
|
|
+ @click="getDtl(item, item.bomStatus ? true : false)"
|
|
|
+ >{{ item.bomStatus ? "查看" : "调整" }}BOM</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ <span v-if="item.isCustomized == 1">
|
|
|
+ <el-button
|
|
|
+ text
|
|
|
+ type="primary"
|
|
|
+ @click="
|
|
|
+ getDtlOne(item, item.technologyStatus ? true : false)
|
|
|
+ "
|
|
|
+ >{{
|
|
|
+ item.technologyStatus ? "查看" : "调整"
|
|
|
+ }}工艺</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ <span v-if="item.productionQuantity == null">
|
|
|
+ <el-button text type="primary" @click="handleOut(item)"
|
|
|
+ >下发</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ <span>
|
|
|
+ <el-button text type="primary" @click="handlePrint(item)"
|
|
|
+ >打印</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ <span>
|
|
|
+ <el-button
|
|
|
+ text
|
|
|
+ type="primary"
|
|
|
+ @click="handleUploadFile(item, true)"
|
|
|
+ >查看设计资料</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <!-- 研发 -->
|
|
|
+ <span v-if="isYanFa">
|
|
|
+ <el-button
|
|
|
+ text
|
|
|
+ type="primary"
|
|
|
+ @click="handleUploadFile(item, false)"
|
|
|
+ >{{
|
|
|
+ item.researchStatus ? "修改" : "上传"
|
|
|
+ }}设计资料</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ <!-- 都不是 -->
|
|
|
+ <div v-if="!isYanFa && !isZhiTu && item.researchStatus">
|
|
|
+ <span v-if="item.isCustomized == 1">
|
|
|
+ <el-button
|
|
|
+ text
|
|
|
+ type="primary"
|
|
|
+ @click="getDtl(item, item.bomStatus ? true : false)"
|
|
|
+ >{{ item.bomStatus ? "查看" : "调整" }}BOM</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ <span v-if="item.isCustomized == 1">
|
|
|
+ <el-button
|
|
|
+ text
|
|
|
+ type="primary"
|
|
|
+ @click="
|
|
|
+ getDtlOne(item, item.technologyStatus ? true : false)
|
|
|
+ "
|
|
|
+ >{{
|
|
|
+ item.technologyStatus ? "查看" : "调整"
|
|
|
+ }}工艺</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ <span v-if="item.productionQuantity == null">
|
|
|
+ <el-button text type="primary" @click="handleOut(item)"
|
|
|
+ >下发</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ <span>
|
|
|
+ <el-button text type="primary" @click="handlePrint(item)"
|
|
|
+ >打印</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ <span>
|
|
|
+ <el-button
|
|
|
+ text
|
|
|
+ type="primary"
|
|
|
+ @click="handleUploadFile(item, true)"
|
|
|
+ >查看设计资料</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</byTable>
|
|
|
</div>
|
|
|
<el-dialog
|
|
@@ -129,7 +234,6 @@
|
|
|
@click="submitForm(0)"
|
|
|
size="large"
|
|
|
:loading="submitLoading"
|
|
|
- v-if="!isDetail"
|
|
|
>
|
|
|
暂 存
|
|
|
</el-button>
|
|
@@ -224,7 +328,6 @@
|
|
|
:before-upload="
|
|
|
(file) => handleBeforeUpload(file, $index)
|
|
|
"
|
|
|
- accept=".pdf"
|
|
|
>
|
|
|
<el-icon
|
|
|
:size="17"
|
|
@@ -326,7 +429,6 @@
|
|
|
<el-button @click="dialogVisibleTwo = false" size="large"
|
|
|
>取 消</el-button
|
|
|
>
|
|
|
-
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
@click="submitFormTwo()"
|
|
@@ -339,6 +441,77 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<el-dialog
|
|
|
+ :title="'上传设计资料'"
|
|
|
+ v-model="informationDialog"
|
|
|
+ width="500"
|
|
|
+ v-loading="submitLoading"
|
|
|
+ destroy-on-close
|
|
|
+ >
|
|
|
+ <byForm
|
|
|
+ :formConfig="informationFormConfig"
|
|
|
+ :formOption="informationFormOption"
|
|
|
+ v-model="formData.dataThree"
|
|
|
+ >
|
|
|
+ <template #file>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-upload
|
|
|
+ v-model:fileList="formData.dataThree.fileList"
|
|
|
+ action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
|
+ :data="uploadData"
|
|
|
+ multiple
|
|
|
+ :before-upload="handleBeforeUploadOne"
|
|
|
+ :on-success="handleSuccess"
|
|
|
+ :on-preview="onPreviewFile"
|
|
|
+ >
|
|
|
+ <el-button>选择</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </byForm>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="informationDialog = false" size="large"
|
|
|
+ >取 消</el-button
|
|
|
+ >
|
|
|
+ <span v-if="!showUploadSubmitOne">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="submitInformationForm(0)"
|
|
|
+ size="large"
|
|
|
+ :loading="submitLoading"
|
|
|
+ >
|
|
|
+ 暂 存
|
|
|
+ </el-button>
|
|
|
+
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="submitInformationForm(1)"
|
|
|
+ size="large"
|
|
|
+ :loading="submitLoading"
|
|
|
+ v-if="!showUploadSubmit"
|
|
|
+ >
|
|
|
+ 提 交
|
|
|
+ </el-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ title="打印产品需求单"
|
|
|
+ v-if="printDialog"
|
|
|
+ v-model="printDialog"
|
|
|
+ width="680"
|
|
|
+ >
|
|
|
+ <ProductDemandPDF :rowData="rowData"></ProductDemandPDF>
|
|
|
+
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="printDialog = false" size="large">取 消</el-button>
|
|
|
+ <el-button type="primary" v-print="printObj" size="large"
|
|
|
+ >打 印</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
v-model="openMaterial"
|
|
|
title="选择产品"
|
|
|
width="70%"
|
|
@@ -363,6 +536,9 @@ import { computed, defineComponent, nextTick, ref } from "vue";
|
|
|
import useUserStore from "@/store/modules/user";
|
|
|
import SelectMaterial from "@/components/product/SelectMaterial";
|
|
|
import Sortable from "sortablejs";
|
|
|
+import ProductDemandPDF from "@/components/PDF/productDemandPDF.vue";
|
|
|
+
|
|
|
+const userInfo = useUserStore();
|
|
|
const props = defineProps({
|
|
|
isShowSelect: {
|
|
|
type: Boolean,
|
|
@@ -531,6 +707,7 @@ const config = computed(() => {
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "操作",
|
|
|
+ slot: "btns",
|
|
|
width: "220",
|
|
|
align: "center",
|
|
|
fixed: "right",
|
|
@@ -652,6 +829,14 @@ const formOptionTwo = reactive({
|
|
|
rules: [],
|
|
|
disabled: false,
|
|
|
});
|
|
|
+const informationFormOption = reactive({
|
|
|
+ inline: true,
|
|
|
+ labelWidth: 100,
|
|
|
+ itemWidth: 100,
|
|
|
+ rules: [],
|
|
|
+ disabled: false,
|
|
|
+});
|
|
|
+
|
|
|
const byform = ref(null);
|
|
|
const byformOne = ref(null);
|
|
|
|
|
@@ -720,6 +905,13 @@ const formConfigTwo = reactive([
|
|
|
},
|
|
|
},
|
|
|
]);
|
|
|
+const informationFormConfig = reactive([
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "file",
|
|
|
+ label: "上传设计资料",
|
|
|
+ },
|
|
|
+]);
|
|
|
const getList = async (req) => {
|
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
|
loading.value = true;
|
|
@@ -741,7 +933,7 @@ const openModal = () => {
|
|
|
|
|
|
const submitForm = (type) => {
|
|
|
byform.value.handleSubmit((valid) => {
|
|
|
- if (type) {
|
|
|
+ if (type == 1) {
|
|
|
ElMessageBox.confirm(`你确定提交吗?`, "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
@@ -763,7 +955,7 @@ const submitForm = (type) => {
|
|
|
);
|
|
|
});
|
|
|
} else {
|
|
|
- formData.data.bomStatus = type;
|
|
|
+ // formData.data.bomStatus = type;
|
|
|
submitLoading.value = true;
|
|
|
proxy.post("/workOrderBom/edit", formData.data).then(
|
|
|
(res) => {
|
|
@@ -844,7 +1036,7 @@ const submitFormOne = (type) => {
|
|
|
const isDetail = ref(false);
|
|
|
const getDtl = (row, flag) => {
|
|
|
isDetail.value = flag;
|
|
|
- formOption.disabled = flag;
|
|
|
+ // formOption.disabled = flag;
|
|
|
modalType.value = "edit";
|
|
|
proxy.post("/workOrderBom/list", { workOrderId: row.id }).then((res) => {
|
|
|
formData.data = {
|
|
@@ -916,7 +1108,7 @@ const getDtlOne = (row, flag) => {
|
|
|
initSort();
|
|
|
});
|
|
|
proxy
|
|
|
- .post("/fileInfo/getList", { businessIdList: [row.id] })
|
|
|
+ .post("/fileInfo/getList", { businessIdList: [row.id], fileType: 1 })
|
|
|
.then((fileObj) => {
|
|
|
if (fileObj[row.id] && fileObj[row.id].length > 0) {
|
|
|
formData.dataOne.fileList = fileObj[row.id].map((item) => {
|
|
@@ -943,6 +1135,19 @@ const getDict = () => {
|
|
|
}));
|
|
|
});
|
|
|
};
|
|
|
+const isYanFa = ref(false);
|
|
|
+const isZhiTu = ref(false);
|
|
|
+const checkShow = () => {
|
|
|
+ // 当前账号角色是否是研发
|
|
|
+ if (userInfo.roles.includes("dev")) {
|
|
|
+ isYanFa.value = true;
|
|
|
+ }
|
|
|
+ // 当前角色是否是制图
|
|
|
+ if (userInfo.roles.includes("design")) {
|
|
|
+ isZhiTu.value = true;
|
|
|
+ }
|
|
|
+};
|
|
|
+checkShow();
|
|
|
getList();
|
|
|
getDict();
|
|
|
|
|
@@ -1062,6 +1267,74 @@ const submitFormTwo = (type) => {
|
|
|
);
|
|
|
});
|
|
|
};
|
|
|
+const informationDialog = ref(false);
|
|
|
+const showUploadSubmit = ref(false);
|
|
|
+const showUploadSubmitOne = ref(false);
|
|
|
+
|
|
|
+const handleUploadFile = (row, flag) => {
|
|
|
+ showUploadSubmit.value = row.researchStatus == 1 ? true : false;
|
|
|
+ showUploadSubmitOne.value = flag;
|
|
|
+ formData.dataThree = {
|
|
|
+ id: row.id,
|
|
|
+ fileList: [],
|
|
|
+ };
|
|
|
+ informationDialog.value = true;
|
|
|
+ proxy
|
|
|
+ .post("/fileInfo/getList", {
|
|
|
+ businessIdList: [row.id],
|
|
|
+ fileType: 0,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res[row.id] && res[row.id].length > 0) {
|
|
|
+ formData.dataThree.fileList = res[row.id].map((item) => {
|
|
|
+ return {
|
|
|
+ raw: item,
|
|
|
+ name: item.fileName,
|
|
|
+ url: item.fileUrl,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+const submitInformationForm = (type) => {
|
|
|
+ if (formData.dataThree.fileList && formData.dataThree.fileList.length > 0) {
|
|
|
+ formData.dataThree.fileList = formData.dataThree.fileList.map((x) => x.raw);
|
|
|
+ formData.dataThree.researchStatus = type == 1 ? "1" : "";
|
|
|
+ submitLoading.value = true;
|
|
|
+ proxy.post("/workOrder/research", formData.dataThree).then(
|
|
|
+ (res) => {
|
|
|
+ ElMessage({
|
|
|
+ message: "操作成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ informationDialog.value = false;
|
|
|
+ submitLoading.value = false;
|
|
|
+ getList();
|
|
|
+ },
|
|
|
+ (err) => (submitLoading.value = false)
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ return ElMessage({
|
|
|
+ message: "请上传设计资料",
|
|
|
+ type: "info",
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+const printDialog = ref(false);
|
|
|
+const rowData = ref({});
|
|
|
+const handlePrint = (row) => {
|
|
|
+ rowData.value = {
|
|
|
+ id: row.id,
|
|
|
+ };
|
|
|
+ printDialog.value = true;
|
|
|
+};
|
|
|
+const printObj = ref({
|
|
|
+ id: "pdfDom",
|
|
|
+ popTitle: "",
|
|
|
+ extraCss:
|
|
|
+ "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
|
|
|
+ extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
|
|
|
+});
|
|
|
|
|
|
const handleSelectRow = (row) => {
|
|
|
proxy.$emit("handleSelectRow", row);
|