张诺
10 小时以前 de5d72a1ee25654826103e38f67188b1f444ec2a
阳光印刷web 生产订单工艺路线增加书号单据类型增加切料图示的选择
已修改1个文件
71 ■■■■■ 文件已修改
src/views/productionManagement/productionOrder/BindRouteDialog.vue 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionOrder/BindRouteDialog.vue
@@ -45,8 +45,9 @@
      <el-descriptions-item label="单据类型" :span="2" align="center">
        <el-checkbox-group v-model="introductionLetterList" :disabled="isDetail">
          <el-checkbox label="介绍信" value="介绍信" />
          <el-checkbox label="商标注册书" value="商标注册书" />
          <el-checkbox label="商标注册" value="商标注册" />
          <el-checkbox label="委印单" value="委印单" />
          <el-checkbox label="书号" value="书号" />
        </el-checkbox-group>
      </el-descriptions-item>
    </el-descriptions>
@@ -58,14 +59,14 @@
    </div>
    <el-table border :data="formData.materialInfo" style="width: 100%">
      <el-table-column label="材料名称">
        <template #default="{ row }" >
        <template #default="{ row, $index }" >
          <el-tree-select
          v-if="!isDetail"
            v-model="row.productById"
            placeholder="请选择"
            clearable
            check-strictly
            @change="(val) => getModels(val, row)"
            @change="(val) => getModels(val, row, $index)"
            :data="productOptions"
            :render-after-expand="false"
            :disabled="isDetail"
@@ -89,7 +90,7 @@
            :disabled="isDetail"
          >
            <el-option
              v-for="item in row.modelOptions || []"
              v-for="item in row.modelOptions"
              :key="item.id"
              :label="item.model"
              :value="item.id"
@@ -128,8 +129,19 @@
    </el-table>
    <el-descriptions border :column="2" :span="2">
      <el-descriptions-item
          label="注意事项"
          :span="2"
          label="切料图示选择"
          :span="1"
          align="center"
          style="white-space: pre-line; word-break: break-all; min-height: 60px;"
      >
        <el-radio-group v-model="formData.cuttingDiagramCheckout">
          <el-radio value="平张">平张</el-radio>
          <el-radio value="卷筒">卷筒</el-radio>
        </el-radio-group>
      </el-descriptions-item>
      <el-descriptions-item
          label="切料注意事项"
          :span="1"
          align="center"
          style="white-space: pre-line; word-break: break-all; min-height: 60px;"
      >
@@ -388,18 +400,18 @@
</template>
<script setup>
import { ref, reactive, computed, onMounted, watch, getCurrentInstance } from 'vue'
import {computed, getCurrentInstance, onMounted, reactive, ref, watch} from 'vue'
import dayjs from 'dayjs'
import FormDialog from '@/components/Dialog/FormDialog.vue'
import ActionFileUpload from "@/components/Upload/ActionFileUpload.vue";
import { list } from "@/api/productionManagement/productionProcess.js"
import { modelList, productTreeList } from "@/api/basicData/product.js"
import {list} from "@/api/productionManagement/productionProcess.js"
import {modelList, productTreeList} from "@/api/basicData/product.js"
import {getSalesLedgerWithProducts} from "@/api/salesManagement/salesLedger.js"
import { getDeviceLedger } from "@/api/equipmentManagement/ledger.js"
import { userListNoPageByTenantId } from "@/api/system/user.js"
import { getToken } from "@/utils/auth";
import {getDeviceLedger} from "@/api/equipmentManagement/ledger.js"
import {userListNoPageByTenantId} from "@/api/system/user.js"
import {getToken} from "@/utils/auth";
import filePreview from '@/components/filePreview/index.vue'
import { ElMessage } from "element-plus";
import {ElMessage} from "element-plus";
const props = defineProps({
  modelValue: {
@@ -517,7 +529,6 @@
})
const getUploadFileUrl = (file) => {
  console.log("file", file)
  const response = file?.response
  const data = response?.data
  if (Array.isArray(data) && data.length) {
@@ -642,7 +653,6 @@
}
const resolveFileUrl = (rawUrl) => {
  console.log("rawUrl", rawUrl)
  const u = String(rawUrl || "")
  if (!u) return ""
  if (/^(https?:)?\/\//i.test(u)) return u
@@ -655,7 +665,6 @@
// 文件预览/下载
const onDownload = (file) => {
  console.log(file)
  const url = resolveFileUrl(getUploadFileUrl(file))
  if (!url) return
  proxy?.$modal?.loading?.("正在下载文件,请稍候...")
@@ -727,7 +736,6 @@
    if(res){
      formData.productOrderList = res
    }
    console.log(formData)
  })
}
@@ -796,11 +804,9 @@
}
const handleProcessChange = (val, row) => {
  console.log(row)
  const process = processOptions.value.find(item => item.id === val)
  if (process) {
    row.processName = process.name
    console.log(process)
    if (process.deviceId) {
      row.deviceId = process.deviceId || ""
      row.deviceName = process.deviceName || ""
@@ -824,21 +830,34 @@
  }))
}
const getModels = (val, row) => {
const getModels = async (val, row, index) => {
  const targetRow = formData.materialInfo[index]
  row.productId = val || ""
  row.productById = val || ""
  row.productName = row.name || ""
  row.name = val ? findProductLabelById(productOptions.value, val) : ""
  row.productModelId = ""
  row.model = ""
  row.unit = ""
  row.modelOptions = []
  if (!val) {
    return
  if (!val) return
  const res = await modelList({ id: val })
  formData.materialInfo[index] = {
    ...targetRow,
    modelOptions: Array.isArray(res) ? res :
        Array.isArray(res?.data) ? res.data :
            Array.isArray(res?.rows) ? res.rows :
                Array.isArray(res?.data?.records) ? res.data.records :
                    []
  }
  modelList({ id: val }).then(res => {
    row.modelOptions = Array.isArray(res) ? res : Array.isArray(res?.data) ? res.data : []
  })
  // row.modelOptions = Array.isArray(res) ? res :
  //     Array.isArray(res?.data) ? res.data :
  //         Array.isArray(res?.rows) ? res.rows :
  //             Array.isArray(res?.data?.records) ? res.data.records :
  //                 []
}
const handleMaterialModelChange = (val, row) => {