Merge pull request !281 from 杨建炊/fix-release-1.0.0/yjc-migrate
This commit is contained in:
杨建炊 2024-12-30 08:03:53 +00:00 committed by Gitee
commit c62807cd0b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
10 changed files with 63 additions and 13 deletions

View File

@ -18,6 +18,9 @@ class WayBillService
public $adminUser;
// 标准模板
public $templateUrl = 'https://template-content.jd.com/template-oss?tempCode=jdkd76x130';
// 标准模板
public $customerTempUrl = "https://template-content.jd.com/template-open?templateCode=customerInfo";
// 时效类型
public $timedDeliveryCode;
@ -55,6 +58,8 @@ class WayBillService
if (!empty($resp[0]['perPrintData'])) {
$waybill->status = Waybill::$STATUS_CREATE_WAYBILL_ENCRYPTED_DATA;
$waybill->templateUrl = $this->templateUrl;
$waybill->customer_temp_url = $this->customerTempUrl;
$waybill->customer_temp_data = json_encode(['productInfo' => $item['productInfo']], 256);
$waybill->encryptedData = $resp[0]['perPrintData'];
$waybill->save();
}
@ -251,8 +256,7 @@ class WayBillService
];
$note .= $item['goods_name'] . " " . $count . "件,";
}
$note .= "[备注:" . $info['note'] . "]";
$info['note'] = $note;
$info['productInfo'] = $note;
$this->orders[$order['shop_id']][] = $info;
}
@ -262,7 +266,8 @@ class WayBillService
private function getShopSend($shopId)
{
return ShopSender::query()
->where('status', 1)->orderBy('sort')
->where('shop_id', $shopId)
->where('status', 1)->orderByDesc('sort')
->first();
}

View File

@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddCustomerTempUrlToWaybillsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
if (Schema::hasColumns('waybills', ["customer_temp_url"])) {
return;
}
Schema::table('waybills', function (Blueprint $table) {
$table->string('customer_temp_url', 191)->default('')->comment('自定义模版url');
$table->text('customer_temp_data')->nullable()->comment('自定义模版参数');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
Schema::table('waybills', function (Blueprint $table) {
//
$table->dropColumn('customer_temp_url');
$table->dropColumn('customer_temp_data');
});
}
}

View File

@ -1 +1 @@
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>erp</title><script defer="defer" src="js/chunk-vendors.04652b46.js"></script><script defer="defer" src="js/app.0a4e86cb.js"></script><link href="css/chunk-vendors.77489a8d.css" rel="stylesheet"><link href="css/app.7e37f273.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but erp doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>erp</title><script defer="defer" src="js/chunk-vendors.04652b46.js"></script><script defer="defer" src="js/app.22d028f8.js"></script><link href="css/chunk-vendors.77489a8d.css" rel="stylesheet"><link href="css/app.7e37f273.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but erp doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

File diff suppressed because one or more lines are too long

1
public/dist/js/382.6d3d83e3.js.map vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -462,7 +462,9 @@ export default {
that.$set(that.tempList[it.seq * 1 - 1], 'print_status', 2)
that.$set(that.tempList[it.seq * 1 - 1], 'fail_msg', it.msg)
}
}
} else if(json.code == "8"){
console.log("data:image/png;base64, " + content) //
}
}
that.webSocket.onclose = function() {
that.$message({ type: 'info', message: State[that.webSocket.readyState] })
@ -508,7 +510,7 @@ export default {
let printObject = res.data.data
console.log(printObject)
let parameters = {
"orderType": "print",
"orderType": "print", // PRE_View print
"version": "2",
"parameters": {
"printName": this.printName,
@ -519,7 +521,9 @@ export default {
console.log(key)
parameters.parameters.contents.push({
"tempUrl": printObject[key].templateUrl,
"printData": printObject[key].encryptedData
"printData": printObject[key].encryptedData,
"customTempUrl": printObject[key].customer_temp_url,
"customData": printObject[key].customer_temp_data
})
}
this.webSocket.send(JSON.stringify(parameters))